aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_qmp.c
Commit message (Collapse)AuthorAgeFilesLines
* libxl: Add "cpu-add" QMP command.Anthony PERARD2013-06-261-0/+21
| | | | | | | Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> [ ijc -- rename index parameter to avoid Wshadow due to index(3) in strings.h ]
* tools: Fix memset(&p,0,sizeof(p)) idiom in several places.Michael Young2013-02-131-1/+1
| | | | | | | | | gcc 4.8 identifies several places where code of the form memset(x, 0, sizeof(x)); is used incorrectly, meaning that less memory is set to zero than required. Signed-off-by: Michael Young <m.a.young@durham.ac.uk> Committed-by: Keir Fraser <keir@xen.org>
* libxl_qmp: Introduce libxl__qmp_insert_cdrom.Anthony PERARD2012-10-091-0/+16
| | | | | | | | | This function can eject or change the CDROM for a guest that use qemu-xen as a device-model. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl_qmp: Introduce libxl__qmp_set_global_dirty_log.Anthony PERARD2012-10-081-2/+10
| | | | | | | | | This function will enable or disable the global dirty log on QEMU, used during a migration. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl_qmp: Simplify run of single QMP commands.Anthony PERARD2012-10-081-48/+22
| | | | | | | | This new function connects to QEMU, sends the command and disconnects. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl_qmp: Use qmp_parameters_* functions for param list of a QMP command.Anthony PERARD2012-10-081-43/+28
| | | | | | Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl_qmp: Introduces helpers to create an argument list.Anthony PERARD2012-10-081-0/+51
| | | | | | | | | | | | | Those functions will be used to create a "list" of parameters that contain more than just strings. This list is converted by qmp_send to a string to be sent to QEMU. Those functions will be used in the next two patches, so right now there are not compiled. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl_json: Replace JSON_TRUE/FALSE by JSON_BOOL.Anthony PERARD2012-10-081-1/+2
| | | | | | | | | Those two JSON_TRUE and JSON_FALSE were types of node. But it's better to have a unique JSON_BOOL type. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl_json: Use libxl alloc function.Anthony PERARD2012-10-051-1/+0
| | | | | | | | | This patch makes use of the libxl allocation API and the GC and removes the check for allocation failure. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: Have flexarray using the GCAnthony PERARD2012-10-051-24/+4
| | | | | | | | | | | This patch makes the flexarray function libxl__gc aware. It also updates every function that use a flexarray to pass the gc and removes every memory allocation check and free. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: Enable -Wshadow.Ian Campbell2012-09-171-4/+4
| | | | | | | | | | | | | | | | | | | | | | It was convenient to invent $(CFLAGS_LIBXL) to do this. Various renamings to avoid shadowing standard functions: - index(3) - listen(2) - link(2) - abort(3) - abs(3) Reduced the scope of some variables to avoid conflicts. Change to libxc is due to the nested hypercall buf macros in set_xen_guest_handle (used in libxl) using the same local private vars. Build tested only. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: Store VNC passwd in xenstore with QEMU upstream.Anthony PERARD2012-06-081-0/+1
| | | | | Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: QMP stop/resume & refactor QEMU suspend/resume/saveShriram Rajagopalan2012-05-181-0/+32
| | | | | | | | | | | | | | Implement QMP stop and resume functionality and split device model save into 3 parts: suspend_dm(domid) save_dm(domid, fd) resume_dm(domid) Integrate Device model suspend into suspend_common_callback Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl_qmp: remove libxl__qmp_migrate, introduce libxl__qmp_saveStefano Stabellini2012-05-111-79/+3
| | | | | | | | | | Following the recent changes to upstream Qemu, the best monitor command to suit or needs is "xen-save-devices-state" rather than "migrate". This patch removes libxl__qmp_migrate and introduces libxl__qmp_save instead, that uses "xen-save-devices-state". Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: make most libxl_FOO_path() functions internal.Ian Campbell2012-04-121-2/+2
| | | | | | | | | | Only libxl_xen_config_dir_path and libxl_lock_dir_path are used outside the library. Also bindir, sbindir, sharedir and xenpagingdir appeared to be completely unused so nuke them. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: Query VNC listening port through QMPAnthony PERARD2012-04-171-0/+59
| | | | | | | | | | Currently `xl vncviewer $dom` does not work because the VNC port is not registered in xenstore when using qemu-upstream. This patch attempted to fix this. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: rename libxl__yajl_gen_allocOlaf Hering2012-02-291-1/+1
| | | | | | | | | libxl__yajl_gen_alloc() is called by generic code, rename it to libx_yajl_gen_alloc(). Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: Set VNC password through QMPAnthony PERARD2012-02-201-1/+29
| | | | | | | | | | This patch provide the code to set the VNC password to QEMU upstream through VNC. The password is still stored in xenstore but will not be used by QEMU upstream. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Campbell <ian.campbell.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl_qmp: Use GC instead of CTX as parameter for _initialize.Anthony PERARD2012-02-201-15/+12
| | | | | | | | This make things a bit easier. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Campbell <ian.campbell.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl_qmp: Handle unexpected end-of-socketAnthony PERARD2012-02-201-1/+4
| | | | | | | | | | | When read() return 0, the current code just tries again. But this leads to an infinite loop if QEMU died too soon. Also, retry select if a signal was caught. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: add support for yajl 2.xRoger Pau Monne2012-01-311-3/+3
| | | | | | | | | This patch adds support for yajl versions 2.x, while retaining 1.x compatibility. All the needed ifdefs can be found in libxl_json.h. Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl_qmp: fix qmp_next to cope with multiple lines read in a single bufferStefano Stabellini2012-01-271-3/+4
| | | | | | | | qmp_next doesn't handle multiple lines read together in a single buffer correctly at the moment. This patch fixes it. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: introduce libxl_fd_set_nonblock, rationalise _cloexecIan Jackson2012-01-271-1/+2
| | | | | | | | | | | | | | | | | | | | We want a function for setting fds to nonblocking, so introduce one. This is a very similar requirement to that for libxl_fd_set_cloexec, so make it common with that. While we're at it, fix a few deficiences that make this latter function less desirable than it could be: * Change the return from 0/-1 (like a syscall) to a libxl error code * Take a boolean parameter for turning the flag on and off * Log on error (and so, take a ctx for this purpose) Change callers of libxl_fd_set_cloexec to notice errors. (Although, such errors are highly unlikely.) Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: libxl_qmp.c should use libxl's own list macros, since theyKeir Fraser2012-01-211-9/+10
| | | | | | | exist. Also, older Linux versions do not have SIMPLEQ macros in sys/queue.h. Signed-off-by: Keir Fraser <keir@xen.org>
* libxl: move a lot more includes into libxl_internal.hIan Jackson2012-01-131-3/+1
| | | | | | | | | | | | | | | | | Move a lot of #include <stdfoo.h> from individual files into libxl_internal.h. This helps avoid portability mistakes where necessary system headers are omitted from individual files, and is also of course a convenience when developing. Also add #include "libxl_osdeps.h" /* must come before any other headers */ to the top of most libxl*.c files, so that anyone who adds any headers before libxl_internal.h will put the in the right place. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: make LIBXL_INIT_GC a statement, not an initialiserIan Jackson2012-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | | Previously LIBXL_INIT_GC was an initialiser, which you were expected to use like this: libxl__gc gc = LIBXL_INIT_GC(ctx); But we are going to want to put things in the gc which are to be initialised using other macros. That means that LIBXL_INIT_GC has to become a statement too. So instead, we make it so that it's used like this: libxl_gc gc; LIBXL_INIT_GC(gc,ctx); In fact there are only a couple of callers now, including GC_INIT which uses this trick: libxl_gc gc[1]; LIBXL_INIT_GC(gc[0],ctx); Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: Use GC_INIT and GC_FREE everywhereIan Jackson2011-12-121-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | Replace libxl__gc gc = LIBXL_INIT_GC(ctx); ... libxl__free_all(&gc); with GC_INIT(ctx); ... GC_FREE; throughout with a couple of perl runes. We must then adjust uses of the resulting gc for pointerness, which is mostly just replacing all occurrences of "&gc" with "gc". Also a couple of unusual uses of LIBXL_INIT_GC needed to be fixed up by hand. Here are those runes: perl -i -pe 's/\Q libxl__gc gc = LIBXL_INIT_GC(ctx);/ GC_INIT(ctx);/' tools/libxl/*.c perl -i -pe 's/\Q libxl__free_all(&gc);/ GC_FREE;/' tools/libxl/*.c Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: Rationalise #includesIan Jackson2011-12-121-0/+2
| | | | | | | | | | | | | | | | | | | | libxl_internal.h now #includes libxl.h and various system headers. This 1. makes the order of header inclusion more predictable 2. explicitly allows libxl_internal.h to use objects defined in libxl.h 3. removes the need for individual files to include these headers Also - remove some unnecessary #includes of libxl_utils.h, flexarray.h, etc. in some libxl*.c files, - include libxl_osdeps.h at the top of libxl_internal.h - add missing includes of libxl_osdeps.h to a couple of files - change libxl.h to libxl_internal.h in a couple of files Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: libxl__qmp_migrateAnthony PERARD2011-12-011-0/+109
| | | | | | | | | | | | This command works in two steps. First, a fd is sent to QEMU through the QMP socket. And then, the second command "migrate" use the fd previously sent to ask QEMU to save its states. This comes with an alternative qmp_send function that can send a fd. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: split libxl__qmp_sendAnthony PERARD2011-12-011-18/+38
| | | | | | | | | This patch prepares for the next patch, that will introduce an alternative send function. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* xl: Apply CLOEXEC to the restore_fd.Anthony Perard2011-12-011-1/+1
| | | | | | | | | | | At restore time, the file descriptor opened on the migration state file is still open in the device model. Let's apply FD_CLOEXEC to it. This patch provides libxl_fd_set_cloexec to users of libxl, instead of keeping this function internal. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: libxl_qmp: Introduce libxl__qmp_pci_delAnthony PERARD2011-11-041-0/+35
| | | | | | | | | | | To remove a pci passthough device from QEMU (upstream). Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> --- tools/libxl/libxl_internal.h | 2 ++ tools/libxl/libxl_qmp.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 0 deletions(-)
* libxl: libxl_qmp: Introduce libxl__qmp_pci_add.Anthony PERARD2011-11-041-0/+95
| | | | | | | This function insert a PCI passthrough device in qemu. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: libxl_qmp: Introduce qmp_request_context.Anthony PERARD2011-11-041-15/+34
| | | | | | | | | | | This structure helps to track the return code of a callback. It's only used between qmp_synchronous_send and qmp_send. Now, qmp_synchronous_send will return the rc of the callback if there is no error. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: libxl_qmp: Always insert a command id in the callback_list.Anthony PERARD2011-11-041-16/+18
| | | | | | | | | Because the function qmp_synchronous_send rely on the presence of the id in the callback_list. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: libxl_qmp: Introduce list of arguments to qmp_sendAnthony PERARD2011-11-041-5/+11
| | | | | | Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: libxl_qmp: Introduce an opaque argument to the callbacks.Anthony PERARD2011-11-041-11/+19
| | | | | | Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: libxl_qmp: Better error message after a parse error.Anthony PERARD2011-11-041-1/+2
| | | | | | | By setting the next string to parse after having printed any error messages. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: libxl_qmp: Fix return check of fcntlAnthony PERARD2011-11-041-1/+1
| | | | | Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: remove QMP warning when no pty style serial device is configuredIan Campbell2011-10-131-1/+1
| | | | | | | | | | | | If the serial device is not "pty" then there is nothing to do but this is not an error. Removes a spurious warning if e.g. serial="file:/tmp/serial.log" is used: libxl: error: libxl_qmp.c:137:register_serials_chardev_callback: Failed to store serial port information in xenstore: No such file or directory Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: fixup incorrect indentationIan Campbell2011-10-121-0/+8
| | | | | | | | | Several places which were previsously indented using hard tabs are now incorrectly indented. Fix them up. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: libxl_qmp: use of libxl__fd_set_cloexec.Anthony PERARD2011-09-291-0/+1
| | | | | | Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: Introduce a QMP clientAnthony PERARD2011-09-291-0/+595
QMP stands for QEMU Monitor Protocol and it is used to query information from QEMU or to control QEMU. This implementation will ask QEMU the list of chardevice and store the path to serial ports in xenstored. So we will be able to use xl console with QEMU upstream. In order to connect to the QMP server, a socket file is created in /var/run/xen/qmp-libxl-$(domid). Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>