aboutsummaryrefslogtreecommitdiff
path: root/ui/spice-core.c
AgeCommit message (Collapse)Author
2013-01-30spice: Fix unchecked strdup() by converting to g_strdup()Markus Armbruster
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-12qemu-option: move standard option definitions out of qemu-config.cPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-04spice: drop incorrect vm_change_state_handler() opaqueStefan Hajnoczi
The spice_server pointer is a global variable and vm_change_state_handler() therefore does not use its opaque parameter. The vm change state handler is added with a pointer to the spice_server pointer. This is useless and we probably would not want 2 levels of pointers. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Uri Lublin <uril@redhat.com>
2012-12-19Merge remote-tracking branch 'bonzini/header-dirs' into stagingAnthony Liguori
* bonzini/header-dirs: (45 commits) janitor: move remaining public headers to include/ hw: move executable format header files to hw/ fpu: move public header file to include/fpu softmmu: move remaining include files to include/ subdirectories softmmu: move include files to include/sysemu/ misc: move include files to include/qemu/ qom: move include files to include/qom/ migration: move include files to include/migration/ monitor: move include files to include/monitor/ exec: move include files to include/exec/ block: move include files to include/block/ qapi: move include files to include/qobject/ janitor: add guards to headers qapi: make struct Visitor opaque qapi: remove qapi/qapi-types-core.h qapi: move inclusions of qemu-common.h from headers to .c files ui: move files to ui/ and include/ui/ qemu-ga: move qemu-ga files to qga/ net: reorganize headers net: move net.c to net/ ... Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-12-19softmmu: move include files to include/sysemu/Paolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19misc: move include files to include/qemu/Paolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19migration: move include files to include/migration/Paolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19monitor: move include files to include/monitor/Paolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19qapi: move include files to include/qobject/Paolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19ui: move files to ui/ and include/ui/Paolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-17spice-qemu-char: register spicevmc ports during qemu_spice_init()Marc-André Lureau
Do the delayed registration of spicevmc ports after Spice server is initialized. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-17qxl+vnc: register a vm state change handler for dummy spice_serverUri Lublin
When qxl + vnc are used, a dummy spice_server is initialized. The spice_server has to be told when the VM runstate changes, which is what this patch does. Without it, from qxl_send_events(), the following error message is shown: qxl_send_events: spice-server bug: guest stopped, ignoring Cc: qemu-stable@nongnu.org Signed-off-by: Uri Lublin <uril@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-11-21Fix the inconsistency in x509-dh-key-file parameterLei Li
Commit c448e8552b0f6135dabddf944a7110f929c08320 (spice: tls support) added options to the -spice command line. But there is an inconsistency between the declaration of the option 'x509-dh-key-file' to -spice command line and its parameter parsing 'x509-dh-file' in function qemu_spice_init. https://bugs.launchpad.net/qemu/+bug/1035042 Reported-by: Alon Bar-Lev <alon.barlev@gmail.com> Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-08spice: raise requirement to 0.12Gerd Hoffmann
With the next qemu version (1.3) we are going to bump the qxl device revision to 4. The new features available require a recent spice-server version, so raise up the bar. Otherwise we would end up with different qxl revisions depending on the spice-server version installed, which would be a major PITA when it comes to compat properties. Clear out a big bunch of #ifdefs which are not needed any more. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-05spice: adding seamless-migration option to the command lineYonit Halperin
The seamless-migration flag is required in order to identify whether libvirt supports the new QEVENT_SPICE_MIGRATE_COMPLETED or not (by default the flag is off). New libvirt versions that wait for QEVENT_SPICE_MIGRATE_COMPLETED should turn on this flag. When this flag is off, spice fallbacks to its old migration method, which can result in data loss. Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-05spice: add 'migrated' flag to spice infoYonit Halperin
The flag is 'true' when spice migration has completed on the src side. It is needed for a case where libvirt dies before migration completes and it misses the event QEVENT_SPICE_MIGRATE_COMPLETED. When libvirt is restored and queries the migration status, it also needs to query spice and check if its migration has completed. Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-05spice migration: add QEVENT_SPICE_MIGRATE_COMPLETEDYonit Halperin
When migrating, libvirt queries the migration status, and upon migration completions, it closes the migration src. On the other hand, when migration is completed, spice transfers data from the src to destination via the client. This data is required for keeping the spice session after migration, without suffering from data loss and inconsistencies. In order to allow this data transfer, we add QEVENT for signaling libvirt that spice migration has completed, and libvirt needs to wait for this event before quitting the src process. Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-05spice: notify on vm state change only via spice_server_vm_start/stopYonit Halperin
QXLWorker->start/stop are deprecated since spice-server 0.11.2 Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-05spice: notify spice server on vm start/stopYonit Halperin
Spice server needs to know about the vm state in order to prevent attempts to write to devices when they are stopped, mainly during the non-live stage of migration. Instead, spice will take care of restoring this writes, on the migration target side, after migration completes. Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-05spice: abort on invalid streaming cmdline paramsChristophe Fergeau
When parsing its command line parameters, spice aborts when it finds unexpected values, except for the 'streaming-video' option. This happens because the parsing of the parameters for this option is done using the 'name2enum' helper, which does not error out on unknown values. Using the 'parse_name' helper makes sure we error out in this case. Looking at git history, the use of 'name2enum' instead of 'parse_name' seems to have been an oversight, so let's change to that now. Fixes rhbz#831708 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-05-03spice_info: add mouse_modeAlon Levy
Add mouse_mode, either server or mouse, to qmp and hmp commands, based on spice_server_is_server_mouse added in spice-server 0.10.3. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-19spice: fix broken initializationAlon Levy
Commit 1b71f7c14fab6f00c2680d4489fbee7baf796e4f moved MODULE_INIT_QOM to way before MODULE_INIT_MACHINE, thereby breaking assumptions made in spice-core.c which registered both a type initializer and a machine intializer. This fix removes the type registration, and replaces it with calling qemu_spice_init in vl.c after command line parsing (second pass) is done, and after timers are armed, required by spice server. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-19spice: set spice uuid and nameMarc-André Lureau
This allows a Spice client to identify a VM Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-28Error out when tls-channel option is used without TLSChristophe Fergeau
It's currently possible to setup spice channels using TLS when no TLS port has been specified (ie TLS is disabled). This cannot work, so better to error out in such a situation. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-28spice: use error_report to report errorsChristophe Fergeau
Error message reporting during spice startup wasn't consistent, it was done with fprintf(stderr, "") but sometimes the message didn't have a trailing \n. Using error_report make the intent of the message clearer and deal with the final \n for us. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-27qxl: require spice >= 0.8.2Alon Levy
drop all ifdefs on SPICE_INTERFACE_QXL_MINOR >= 1 as a result, any check for SPICE_SERVER_VERSION that is now always satisfied, and SPICE_INTERFACE_CORE_MINOR >= 3 tests, because 0.8.2 has SPICE_INTERFACE_QXL_MINOR == 1 and SPICE_INTERFACE_CORE_MINOR == 3. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-21spice: support ipv6 channel address in monitor events and in spice infoYonit Halperin
RHBZ #788444 CC: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-21Add SPICE support to add_client monitor commandDaniel P. Berrange
With the acceptance of some new APIs to libspice-server.so it is possible to add support for SPICE to the 'add_client' monitor command, bringing parity with VNC. Since SPICE can use TLS or plain connections, the command also gains a new 'tls' parameter to specify whether TLS should be attempted on the injected client sockets. This new feature is only enabled if building against a libspice-server >= 0.10.1 * qmp-commands.hx: Add 'tls' parameter & missing doc for 'skipauth' parameter * monitor.c: Wire up SPICE for 'add_client' command * ui/qemu-spice.h, ui/spice-core.c: Add qemu_spice_display_add_client API to wire up from monitor [1] http://cgit.freedesktop.org/spice/spice/commit/server/spice.h?id=d55b68b6b44f2499278fa860fb47ff22f5011faa http://cgit.freedesktop.org/spice/spice/commit/server/spice.h?id=bd07dde530d9504e1cfe7ed5837fc00c26f36716 Changes in v3: - Added 'optional' flag to new parameters documented - Added no-op impl of qemu_spice_display_add_client when SPICE is disabled during build Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-15qom: Unify type registrationAndreas Färber
Replace device_init() with generalized type_init(). While at it, unify naming convention: type_init([$prefix_]register_types) Also, type_init() is a function, so add preceding blank line where necessary and don't put a semicolon after the closing brace. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws> Cc: malc <av1474@comtv.ru> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-10-31Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori
Conflicts: ui/spice-core.c
2011-10-27qapi: Convert query-spiceLuiz Capitulino
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2011-10-25spice: fix file handle cleanupGerd Hoffmann
Setting both read and write handlers to NULL in qemu_set_fd_handler is not enougth to make qemu purge the file handle from the list. We must set opaque to NULL too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-10-25ui/spice-core: fix segfault in monitorAlon Levy
Fix segfault if a qxl device is present but no spice command line argument is given. RHBZ 743251. Signed-off-by: Alon Levy <alevy@redhat.com>
2011-10-25spice: Convert core to QEMU thread APIJan Kiszka
No need to use pthread directly, we have proper abstractions for identity checking. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-10-25spice: support the new migration interface (spice 0.8.3)Yonit Halperin
- call spice_server_migrate_(start|end|connect). - register spice_migrate_connect completion callback Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-10-25spice: turn client_migrate_info to asyncYonit Halperin
RHBZ 737921 Spice client is required to connect to the migration target before/as migration starts. Since after migration starts, the target qemu is blocked and cannot accept new spice client we trigger the connection to the target upon client_migrate_info command. client_migrate_info completion cb will be called after spice client has been connected to the target (or a timeout). See following patches and spice patches. Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-10-20migration: Export a function that tells if the migration has finished correctlyJuan Quintela
This will allow us to hide the state values. Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-09-07spice: workaround a spice server bug.Gerd Hoffmann
spice server might call the channel_event callback from spice server thread context. Detect that and aquire iothread lock if needed,
2011-08-20Use glib memory allocation and free functionsAnthony Liguori
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-10ui/spice-core: report compiled-version in info spice/query-spiceAlon Levy
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-23notifier: Pass data argument to callbackJan Kiszka
This allows to pass additional information to the notifier callback which is useful if sender and receiver do not share any other distinct data structure. Will be used first for the clock reset notifier. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-20spice: add sanity check for spice portsGerd Hoffmann
Make sure at least one port (port=.. or tls-port=...) is specified. Also apply range checks to the port numbers. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-04spice: catch spice server initialization failures.Gerd Hoffmann
When the spice server initialization fails report this and exit instead of ignoring the error. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-06spice: require spice 0.6.0 or newer.Gerd Hoffmann
This patch raises the minimum required spice version to 0.6.0 and drops a few ifdefs. 0.6.0 is the first stable release with the current libspice-server API, there shouldn't be any 0.5.x development versions deployed any more. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-06spice: add SASL supportMarc-André Lureau
Turn on SASL support by appending "sasl" to the spice arguments, which requires that the client use SASL to authenticate with the spice. The exact choice of authentication method used is controlled from the system / user's SASL configuration file for the 'qemu' service. This is typically found in /etc/sasl2/qemu.conf. If running QEMU as an unprivileged user, an environment variable SASL_CONF_PATH can be used to make it search alternate locations for the service config. While some SASL auth methods can also provide data encryption (eg GSSAPI), it is recommended that SASL always be combined with the 'tls' and 'x509' settings to enable use of SSL and server certificates. This ensures a data encryption preventing compromise of authentication credentials. It requires support from spice 0.8.1. [ kraxel: moved spell fix to separate commit ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-06spice: add option for disabling copy paste supportHans de Goede
Some people want to be able disable spice's guest <-> client copy paste support because of security considerations. [ kraxel: drop old-version error message ]
2011-03-21change all rt_clock references to use millisecond resolution accessorsPaolo Bonzini
This was done with: sed -i '/get_clock\>.*rt_clock/s/get_clock\>/get_clock_ms/' \ $(git grep -l 'get_clock\>.*rt_clock' ) sed -i '/new_timer\>.*rt_clock/s/new_timer\>/new_timer_ms/' \ $(git grep -l 'new_timer\>.*rt_clock' ) after checking that get_clock and new_timer never occur twice on the same line. There were no missed occurrences; however, even if there had been, they would have been caught by the compiler. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2011-01-24spice/vnc: client migration.Gerd Hoffmann
Handle spice client migration, i.e. inform a spice client connected about the new host and connection parameters, so it can move over the connection automatically. The monitor command has a not-yet used protocol argument simliar to set_password and expire_password commands. This allows to add a simliar feature to vnc in the future. Daniel Berrange plans to work on this. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-12-09vnc/spice: add set_passwd monitor command.Gerd Hoffmann
This patch adds new set_password and expire_password monitor commands which allows to change and expire the password for spice and vnc connections. See the doc update patch chunk for details. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-12-09spice: add qmp 'query-spice' and hmp 'info spice' commands.Gerd Hoffmann
The patch adds a 'query-spice' monitor command which returns informations about the spice server configuration and also a list of channel connections. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>