All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 00/14] spice patch queue
@ 2012-09-06  7:21 Gerd Hoffmann
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 01/14] spice: abort on invalid streaming cmdline params Gerd Hoffmann
                   ` (14 more replies)
  0 siblings, 15 replies; 19+ messages in thread
From: Gerd Hoffmann @ 2012-09-06  7:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

  Hi,

Here comes the spice patch queue with a bunch of fresh patches for 1.3.
A new qmp event is there, to fix spice client migration races, and a
bunch of patches needed to make use of the new goodies the upcoming
spice-server version (0.12) brings.  The later is disabled by default,
we'll flip the switch once 0.12 is finally released and all patches
needed are merged.

cheers,
  Gerd

The following changes since commit 8db972cfa469b4e4afd9c65e54e796b83b5ce3a2:

  Update version for 1.2.0 (2012-09-05 07:50:01 -0500)

are available in the git repository at:
  git://anongit.freedesktop.org/spice/qemu spice.v59

Alon Levy (4):
      qxl/update_area_io: guest_bug on invalid parameters
      qxl: disallow unknown revisions
      qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
      configure: print spice-protocol and spice-server versions

Christophe Fergeau (1):
      spice: abort on invalid streaming cmdline params

Gerd Hoffmann (1):
      spice: make number of surfaces runtime-configurable.

Søren Sandmann Pedersen (2):
      qxl: Add set_client_capabilities() interface to QXLInterface
      Remove #ifdef QXL_COMMAND_FLAG_COMPAT_16BPP

Yonit Halperin (6):
      spice: notify spice server on vm start/stop
      spice: notify on vm state change only via spice_server_vm_start/stop
      spice migration: add QEVENT_SPICE_MIGRATE_COMPLETED
      spice: add 'migrated' flag to spice info
      spice: adding seamless-migration option to the command line
      spice: increase the verbosity of spice section in "qemu --help"

 configure          |   11 +++-
 hmp.c              |    2 +
 hw/qxl.c           |  175 +++++++++++++++++++++++++++++++++++++++++++++-------
 hw/qxl.h           |   10 +++-
 monitor.c          |    1 +
 monitor.h          |    1 +
 qapi-schema.json   |    5 +-
 qemu-config.c      |    3 +
 qemu-options.hx    |   21 ++++++-
 trace-events       |    1 +
 ui/spice-core.c    |   41 ++++++++++++-
 ui/spice-display.c |   37 ++++++++++-
 ui/spice-display.h |   13 +++-
 13 files changed, 284 insertions(+), 37 deletions(-)

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Qemu-devel] [PATCH 01/14] spice: abort on invalid streaming cmdline params
  2012-09-06  7:21 [Qemu-devel] [PULL 00/14] spice patch queue Gerd Hoffmann
@ 2012-09-06  7:21 ` Gerd Hoffmann
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 02/14] spice: notify spice server on vm start/stop Gerd Hoffmann
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Gerd Hoffmann @ 2012-09-06  7:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Christophe Fergeau

From: Christophe Fergeau <cfergeau@redhat.com>

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>
---
 ui/spice-core.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/ui/spice-core.c b/ui/spice-core.c
index 4fc48f8..bb4f585 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -344,7 +344,8 @@ static const char *stream_video_names[] = {
     [ SPICE_STREAM_VIDEO_FILTER ] = "filter",
 };
 #define parse_stream_video(_name) \
-    name2enum(_name, stream_video_names, ARRAY_SIZE(stream_video_names))
+    parse_name(_name, "stream video control", \
+               stream_video_names, ARRAY_SIZE(stream_video_names))
 
 static const char *compression_names[] = {
     [ SPICE_IMAGE_COMPRESS_OFF ]      = "off",
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Qemu-devel] [PATCH 02/14] spice: notify spice server on vm start/stop
  2012-09-06  7:21 [Qemu-devel] [PULL 00/14] spice patch queue Gerd Hoffmann
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 01/14] spice: abort on invalid streaming cmdline params Gerd Hoffmann
@ 2012-09-06  7:21 ` Gerd Hoffmann
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 03/14] spice: notify on vm state change only via spice_server_vm_start/stop Gerd Hoffmann
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Gerd Hoffmann @ 2012-09-06  7:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Yonit Halperin, Gerd Hoffmann

From: Yonit Halperin <yhalperi@redhat.com>

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>
---
 ui/spice-core.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/ui/spice-core.c b/ui/spice-core.c
index bb4f585..a515c94 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -546,6 +546,18 @@ static int add_channel(const char *name, const char *value, void *opaque)
     return 0;
 }
 
+static void vm_change_state_handler(void *opaque, int running,
+                                    RunState state)
+{
+#if SPICE_SERVER_VERSION >= 0x000b02 /* 0.11.2 */
+    if (running) {
+        spice_server_vm_start(spice_server);
+    } else {
+        spice_server_vm_stop(spice_server);
+    }
+#endif
+}
+
 void qemu_spice_init(void)
 {
     QemuOpts *opts = QTAILQ_FIRST(&qemu_spice_opts.head);
@@ -719,6 +731,8 @@ void qemu_spice_init(void)
     qemu_spice_input_init();
     qemu_spice_audio_init();
 
+    qemu_add_vm_change_state_handler(vm_change_state_handler, &spice_server);
+
     g_free(x509_key_file);
     g_free(x509_cert_file);
     g_free(x509_cacert_file);
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Qemu-devel] [PATCH 03/14] spice: notify on vm state change only via spice_server_vm_start/stop
  2012-09-06  7:21 [Qemu-devel] [PULL 00/14] spice patch queue Gerd Hoffmann
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 01/14] spice: abort on invalid streaming cmdline params Gerd Hoffmann
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 02/14] spice: notify spice server on vm start/stop Gerd Hoffmann
@ 2012-09-06  7:21 ` Gerd Hoffmann
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 04/14] spice migration: add QEVENT_SPICE_MIGRATE_COMPLETED Gerd Hoffmann
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Gerd Hoffmann @ 2012-09-06  7:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Yonit Halperin, Gerd Hoffmann

From: Yonit Halperin <yhalperi@redhat.com>

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>
---
 hw/qxl.c           |    7 ++++---
 ui/spice-core.c    |    4 ++++
 ui/spice-display.c |   32 ++++++++++++++++++++++++++++++--
 ui/spice-display.h |    9 +++++++--
 4 files changed, 45 insertions(+), 7 deletions(-)

diff --git a/hw/qxl.c b/hw/qxl.c
index c2dd3b4..95bbc03 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -958,9 +958,10 @@ static void qxl_update_irq(PCIQXLDevice *d)
 static void qxl_check_state(PCIQXLDevice *d)
 {
     QXLRam *ram = d->ram;
+    int spice_display_running = qemu_spice_display_is_running(&d->ssd);
 
-    assert(!d->ssd.running || SPICE_RING_IS_EMPTY(&ram->cmd_ring));
-    assert(!d->ssd.running || SPICE_RING_IS_EMPTY(&ram->cursor_ring));
+    assert(!spice_display_running || SPICE_RING_IS_EMPTY(&ram->cmd_ring));
+    assert(!spice_display_running || SPICE_RING_IS_EMPTY(&ram->cursor_ring));
 }
 
 static void qxl_reset_state(PCIQXLDevice *d)
@@ -1538,7 +1539,7 @@ static void qxl_send_events(PCIQXLDevice *d, uint32_t events)
     uint32_t old_pending;
     uint32_t le_events = cpu_to_le32(events);
 
-    assert(d->ssd.running);
+    assert(qemu_spice_display_is_running(&d->ssd));
     old_pending = __sync_fetch_and_or(&d->ram->int_pending, le_events);
     if ((old_pending & le_events) == le_events) {
         return;
diff --git a/ui/spice-core.c b/ui/spice-core.c
index a515c94..1a7a773 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -37,6 +37,7 @@
 #include "migration.h"
 #include "monitor.h"
 #include "hw/hw.h"
+#include "spice-display.h"
 
 /* core bits */
 
@@ -551,9 +552,11 @@ static void vm_change_state_handler(void *opaque, int running,
 {
 #if SPICE_SERVER_VERSION >= 0x000b02 /* 0.11.2 */
     if (running) {
+        qemu_spice_display_start();
         spice_server_vm_start(spice_server);
     } else {
         spice_server_vm_stop(spice_server);
+        qemu_spice_display_stop();
     }
 #endif
 }
@@ -755,6 +758,7 @@ int qemu_spice_add_interface(SpiceBaseInstance *sin)
         spice_server = spice_server_new();
         spice_server_init(spice_server, &core_interface);
     }
+
     return spice_server_add_interface(spice_server, sin);
 }
 
diff --git a/ui/spice-display.c b/ui/spice-display.c
index 3e8f0b3..1c31418 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -126,18 +126,44 @@ void qemu_spice_wakeup(SimpleSpiceDisplay *ssd)
     ssd->worker->wakeup(ssd->worker);
 }
 
-void qemu_spice_start(SimpleSpiceDisplay *ssd)
+#if SPICE_SERVER_VERSION < 0x000b02 /* before 0.11.2 */
+static void qemu_spice_start(SimpleSpiceDisplay *ssd)
 {
     trace_qemu_spice_start(ssd->qxl.id);
     ssd->worker->start(ssd->worker);
 }
 
-void qemu_spice_stop(SimpleSpiceDisplay *ssd)
+static void qemu_spice_stop(SimpleSpiceDisplay *ssd)
 {
     trace_qemu_spice_stop(ssd->qxl.id);
     ssd->worker->stop(ssd->worker);
 }
 
+#else
+
+static int spice_display_is_running;
+
+void qemu_spice_display_start(void)
+{
+    spice_display_is_running = true;
+}
+
+void qemu_spice_display_stop(void)
+{
+    spice_display_is_running = false;
+}
+
+#endif
+
+int qemu_spice_display_is_running(SimpleSpiceDisplay *ssd)
+{
+#if SPICE_SERVER_VERSION < 0x000b02 /* before 0.11.2 */
+    return ssd->running;
+#else
+    return spice_display_is_running;
+#endif
+}
+
 static SimpleSpiceUpdate *qemu_spice_create_update(SimpleSpiceDisplay *ssd)
 {
     SimpleSpiceUpdate *update;
@@ -272,6 +298,7 @@ void qemu_spice_destroy_host_primary(SimpleSpiceDisplay *ssd)
 void qemu_spice_vm_change_state_handler(void *opaque, int running,
                                         RunState state)
 {
+#if SPICE_SERVER_VERSION < 0x000b02 /* before 0.11.2 */
     SimpleSpiceDisplay *ssd = opaque;
 
     if (running) {
@@ -281,6 +308,7 @@ void qemu_spice_vm_change_state_handler(void *opaque, int running,
         qemu_spice_stop(ssd);
         ssd->running = false;
     }
+#endif
 }
 
 void qemu_spice_display_init_common(SimpleSpiceDisplay *ssd, DisplayState *ds)
diff --git a/ui/spice-display.h b/ui/spice-display.h
index 12e50b6..672d65e 100644
--- a/ui/spice-display.h
+++ b/ui/spice-display.h
@@ -82,7 +82,9 @@ struct SimpleSpiceDisplay {
 
     QXLRect dirty;
     int notify;
+#if SPICE_SERVER_VERSION < 0x000b02 /* before 0.11.2 */
     int running;
+#endif
 
     /*
      * All struct members below this comment can be accessed from
@@ -129,5 +131,8 @@ void qemu_spice_create_primary_surface(SimpleSpiceDisplay *ssd, uint32_t id,
 void qemu_spice_destroy_primary_surface(SimpleSpiceDisplay *ssd,
                                         uint32_t id, qxl_async_io async);
 void qemu_spice_wakeup(SimpleSpiceDisplay *ssd);
-void qemu_spice_start(SimpleSpiceDisplay *ssd);
-void qemu_spice_stop(SimpleSpiceDisplay *ssd);
+#if SPICE_SERVER_VERSION >= 0x000b02 /* before 0.11.2 */
+void qemu_spice_display_start(void);
+void qemu_spice_display_stop(void);
+#endif
+int qemu_spice_display_is_running(SimpleSpiceDisplay *ssd);
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Qemu-devel] [PATCH 04/14] spice migration: add QEVENT_SPICE_MIGRATE_COMPLETED
  2012-09-06  7:21 [Qemu-devel] [PULL 00/14] spice patch queue Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 03/14] spice: notify on vm state change only via spice_server_vm_start/stop Gerd Hoffmann
@ 2012-09-06  7:21 ` Gerd Hoffmann
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 05/14] spice: add 'migrated' flag to spice info Gerd Hoffmann
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Gerd Hoffmann @ 2012-09-06  7:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Yonit Halperin, Gerd Hoffmann

From: Yonit Halperin <yhalperi@redhat.com>

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>
---
 monitor.c       |    1 +
 monitor.h       |    1 +
 ui/spice-core.c |    9 ++++++++-
 3 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/monitor.c b/monitor.c
index b17b1bb..413edf4 100644
--- a/monitor.c
+++ b/monitor.c
@@ -455,6 +455,7 @@ static const char *monitor_event_names[] = {
     [QEVENT_SUSPEND_DISK] = "SUSPEND_DISK",
     [QEVENT_WAKEUP] = "WAKEUP",
     [QEVENT_BALLOON_CHANGE] = "BALLOON_CHANGE",
+    [QEVENT_SPICE_MIGRATE_COMPLETED] = "SPICE_MIGRATE_COMPLETED",
 };
 QEMU_BUILD_BUG_ON(ARRAY_SIZE(monitor_event_names) != QEVENT_MAX)
 
diff --git a/monitor.h b/monitor.h
index 47d556b..5fc2983 100644
--- a/monitor.h
+++ b/monitor.h
@@ -43,6 +43,7 @@ typedef enum MonitorEvent {
     QEVENT_SUSPEND_DISK,
     QEVENT_WAKEUP,
     QEVENT_BALLOON_CHANGE,
+    QEVENT_SPICE_MIGRATE_COMPLETED,
 
     /* Add to 'monitor_event_names' array in monitor.c when
      * defining new events here */
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 1a7a773..851e869 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -285,6 +285,7 @@ typedef struct SpiceMigration {
 } SpiceMigration;
 
 static void migrate_connect_complete_cb(SpiceMigrateInstance *sin);
+static void migrate_end_complete_cb(SpiceMigrateInstance *sin);
 
 static const SpiceMigrateInterface migrate_interface = {
     .base.type = SPICE_INTERFACE_MIGRATION,
@@ -292,7 +293,7 @@ static const SpiceMigrateInterface migrate_interface = {
     .base.major_version = SPICE_INTERFACE_MIGRATION_MAJOR,
     .base.minor_version = SPICE_INTERFACE_MIGRATION_MINOR,
     .migrate_connect_complete = migrate_connect_complete_cb,
-    .migrate_end_complete = NULL,
+    .migrate_end_complete = migrate_end_complete_cb,
 };
 
 static SpiceMigration spice_migrate;
@@ -305,6 +306,11 @@ static void migrate_connect_complete_cb(SpiceMigrateInstance *sin)
     }
     sm->connect_complete.cb = NULL;
 }
+
+static void migrate_end_complete_cb(SpiceMigrateInstance *sin)
+{
+    monitor_protocol_event(QEVENT_SPICE_MIGRATE_COMPLETED, NULL);
+}
 #endif
 
 /* config string parsing */
@@ -489,6 +495,7 @@ static void migration_state_notifier(Notifier *notifier, void *data)
     } else if (migration_has_finished(s)) {
 #ifndef SPICE_INTERFACE_MIGRATION
         spice_server_migrate_switch(spice_server);
+        monitor_protocol_event(QEVENT_SPICE_MIGRATE_COMPLETED, NULL);
 #else
         spice_server_migrate_end(spice_server, true);
     } else if (migration_has_failed(s)) {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Qemu-devel] [PATCH 05/14] spice: add 'migrated' flag to spice info
  2012-09-06  7:21 [Qemu-devel] [PULL 00/14] spice patch queue Gerd Hoffmann
                   ` (3 preceding siblings ...)
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 04/14] spice migration: add QEVENT_SPICE_MIGRATE_COMPLETED Gerd Hoffmann
@ 2012-09-06  7:21 ` Gerd Hoffmann
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 06/14] spice: adding seamless-migration option to the command line Gerd Hoffmann
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Gerd Hoffmann @ 2012-09-06  7:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Yonit Halperin, Gerd Hoffmann

From: Yonit Halperin <yhalperi@redhat.com>

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>
---
 hmp.c            |    2 ++
 qapi-schema.json |    5 ++++-
 ui/spice-core.c  |    4 ++++
 3 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/hmp.c b/hmp.c
index 81c8acb..ec4274b 100644
--- a/hmp.c
+++ b/hmp.c
@@ -413,6 +413,8 @@ void hmp_info_spice(Monitor *mon)
         monitor_printf(mon, "     address: %s:%" PRId64 " [tls]\n",
                        info->host, info->tls_port);
     }
+    monitor_printf(mon, "    migrated: %s\n",
+                   info->migrated ? "true" : "false");
     monitor_printf(mon, "        auth: %s\n", info->auth);
     monitor_printf(mon, "    compiled: %s\n", info->compiled_version);
     monitor_printf(mon, "  mouse-mode: %s\n",
diff --git a/qapi-schema.json b/qapi-schema.json
index bd8ad74..8ddde12 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -808,6 +808,9 @@
 #
 # @enabled: true if the SPICE server is enabled, false otherwise
 #
+# @migrated: true if the last guest migration completed and spice
+#            migration had completed as well. false otherwise.
+#
 # @host: #optional The hostname the SPICE server is bound to.  This depends on
 #        the name resolution on the host and may be an IP address.
 #
@@ -833,7 +836,7 @@
 # Since: 0.14.0
 ##
 { 'type': 'SpiceInfo',
-  'data': {'enabled': 'bool', '*host': 'str', '*port': 'int',
+  'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
 
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 851e869..ab069c5 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -46,6 +46,7 @@ static Notifier migration_state;
 static const char *auth = "spice";
 static char *auth_passwd;
 static time_t auth_expires = TIME_MAX;
+static int spice_migration_completed;
 int using_spice = 0;
 
 static QemuThread me;
@@ -310,6 +311,7 @@ static void migrate_connect_complete_cb(SpiceMigrateInstance *sin)
 static void migrate_end_complete_cb(SpiceMigrateInstance *sin)
 {
     monitor_protocol_event(QEVENT_SPICE_MIGRATE_COMPLETED, NULL);
+    spice_migration_completed = true;
 }
 #endif
 
@@ -443,6 +445,7 @@ SpiceInfo *qmp_query_spice(Error **errp)
     }
 
     info->enabled = true;
+    info->migrated = spice_migration_completed;
 
     addr = qemu_opt_get(opts, "addr");
     port = qemu_opt_get_number(opts, "port", 0);
@@ -496,6 +499,7 @@ static void migration_state_notifier(Notifier *notifier, void *data)
 #ifndef SPICE_INTERFACE_MIGRATION
         spice_server_migrate_switch(spice_server);
         monitor_protocol_event(QEVENT_SPICE_MIGRATE_COMPLETED, NULL);
+        spice_migration_completed = true;
 #else
         spice_server_migrate_end(spice_server, true);
     } else if (migration_has_failed(s)) {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Qemu-devel] [PATCH 06/14] spice: adding seamless-migration option to the command line
  2012-09-06  7:21 [Qemu-devel] [PULL 00/14] spice patch queue Gerd Hoffmann
                   ` (4 preceding siblings ...)
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 05/14] spice: add 'migrated' flag to spice info Gerd Hoffmann
@ 2012-09-06  7:21 ` Gerd Hoffmann
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 07/14] spice: increase the verbosity of spice section in "qemu --help" Gerd Hoffmann
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Gerd Hoffmann @ 2012-09-06  7:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Yonit Halperin, Gerd Hoffmann

From: Yonit Halperin <yhalperi@redhat.com>

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>
---
 qemu-config.c   |    3 +++
 qemu-options.hx |    3 +++
 ui/spice-core.c |    7 +++++++
 3 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/qemu-config.c b/qemu-config.c
index c05ffbc..eba977e 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -537,6 +537,9 @@ QemuOptsList qemu_spice_opts = {
         },{
             .name = "playback-compression",
             .type = QEMU_OPT_BOOL,
+        }, {
+            .name = "seamless-migration",
+            .type = QEMU_OPT_BOOL,
         },
         { /* end of list */ }
     },
diff --git a/qemu-options.hx b/qemu-options.hx
index 3c411c4..96a7bb1 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -920,6 +920,9 @@ Enable/disable passing mouse events via vdagent.  Default is on.
 @item playback-compression=[on|off]
 Enable/disable audio stream compression (using celt 0.5.1).  Default is on.
 
+@item seamless-migration=[on|off]
+Enable/disable spice seamless migration. Default is off.
+
 @end table
 ETEXI
 
diff --git a/ui/spice-core.c b/ui/spice-core.c
index ab069c5..ba0d0bd 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -585,6 +585,9 @@ void qemu_spice_init(void)
     int port, tls_port, len, addr_flags;
     spice_image_compression_t compression;
     spice_wan_compression_t wan_compr;
+#if SPICE_SERVER_VERSION >= 0x000b02 /* 0.11.2 */
+    bool seamless_migration;
+#endif
 
     qemu_thread_get_self(&me);
 
@@ -728,6 +731,10 @@ void qemu_spice_init(void)
     spice_server_set_uuid(spice_server, qemu_uuid);
 #endif
 
+#if SPICE_SERVER_VERSION >= 0x000b02 /* 0.11.2 */
+    seamless_migration = qemu_opt_get_bool(opts, "seamless-migration", 0);
+    spice_server_set_seamless_migration(spice_server, seamless_migration);
+#endif
     if (0 != spice_server_init(spice_server, &core_interface)) {
         error_report("failed to initialize spice server");
         exit(1);
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Qemu-devel] [PATCH 07/14] spice: increase the verbosity of spice section in "qemu --help"
  2012-09-06  7:21 [Qemu-devel] [PULL 00/14] spice patch queue Gerd Hoffmann
                   ` (5 preceding siblings ...)
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 06/14] spice: adding seamless-migration option to the command line Gerd Hoffmann
@ 2012-09-06  7:21 ` Gerd Hoffmann
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 08/14] qxl/update_area_io: guest_bug on invalid parameters Gerd Hoffmann
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Gerd Hoffmann @ 2012-09-06  7:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Yonit Halperin, Gerd Hoffmann

From: Yonit Halperin <yhalperi@redhat.com>

Added all spice options to the help string. This can be used by libvirt
to determine which spice related features are supported by qemu.

Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 qemu-options.hx |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index 96a7bb1..804a2d1 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -838,7 +838,23 @@ Enable SDL.
 ETEXI
 
 DEF("spice", HAS_ARG, QEMU_OPTION_spice,
-    "-spice <args>   enable spice\n", QEMU_ARCH_ALL)
+    "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n"
+    "       [,x509-key-file=<file>][,x509-key-password=<file>]\n"
+    "       [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n"
+    "       [,x509-dh-key-file=<file>][,addr=addr][,ipv4|ipv6]\n"
+    "       [,tls-ciphers=<list>]\n"
+    "       [,tls-channel=[main|display|cursor|inputs|record|playback]]\n"
+    "       [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n"
+    "       [,sasl][,password=<secret>][,disable-ticketing]\n"
+    "       [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n"
+    "       [,jpeg-wan-compression=[auto|never|always]]\n"
+    "       [,zlib-glz-wan-compression=[auto|never|always]]\n"
+    "       [,streaming-video=[off|all|filter]][,disable-copy-paste]\n"
+    "       [,agent-mouse=[on|off]][,playback-compression=[on|off]]\n"
+    "       [,seamless-migration=[on|off]]\n"
+    "   enable spice\n"
+    "   at least one of {port, tls-port} is mandatory\n",
+    QEMU_ARCH_ALL)
 STEXI
 @item -spice @var{option}[,@var{option}[,...]]
 @findex -spice
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Qemu-devel] [PATCH 08/14] qxl/update_area_io: guest_bug on invalid parameters
  2012-09-06  7:21 [Qemu-devel] [PULL 00/14] spice patch queue Gerd Hoffmann
                   ` (6 preceding siblings ...)
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 07/14] spice: increase the verbosity of spice section in "qemu --help" Gerd Hoffmann
@ 2012-09-06  7:21 ` Gerd Hoffmann
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 09/14] qxl: disallow unknown revisions Gerd Hoffmann
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Gerd Hoffmann @ 2012-09-06  7:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alon Levy, Gerd Hoffmann

From: Alon Levy <alevy@redhat.com>

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/qxl.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/hw/qxl.c b/hw/qxl.c
index 95bbc03..baf9bb4 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1386,6 +1386,18 @@ async_common:
         QXLCookie *cookie = NULL;
         QXLRect update = d->ram->update_area;
 
+        if (d->ram->update_surface > NUM_SURFACES) {
+            qxl_set_guest_bug(d, "QXL_IO_UPDATE_AREA: invalid surface id %d\n",
+                              d->ram->update_surface);
+            return;
+        }
+        if (update.left >= update.right || update.top >= update.bottom) {
+            qxl_set_guest_bug(d,
+                    "QXL_IO_UPDATE_AREA: invalid area (%ux%u)x(%ux%u)\n",
+                    update.left, update.top, update.right, update.bottom);
+            return;
+        }
+
         if (async == QXL_ASYNC) {
             cookie = qxl_cookie_new(QXL_COOKIE_TYPE_IO,
                                     QXL_IO_UPDATE_AREA_ASYNC);
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Qemu-devel] [PATCH 09/14] qxl: disallow unknown revisions
  2012-09-06  7:21 [Qemu-devel] [PULL 00/14] spice patch queue Gerd Hoffmann
                   ` (7 preceding siblings ...)
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 08/14] qxl/update_area_io: guest_bug on invalid parameters Gerd Hoffmann
@ 2012-09-06  7:21 ` Gerd Hoffmann
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 10/14] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC Gerd Hoffmann
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Gerd Hoffmann @ 2012-09-06  7:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alon Levy, Gerd Hoffmann

From: Alon Levy <alevy@redhat.com>

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/qxl.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/hw/qxl.c b/hw/qxl.c
index baf9bb4..d134a70 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1798,10 +1798,13 @@ static int qxl_init_common(PCIQXLDevice *qxl)
         io_size = 16;
         break;
     case 3: /* qxl-3 */
-    default:
         pci_device_rev = QXL_DEFAULT_REVISION;
         io_size = msb_mask(QXL_IO_RANGE_SIZE * 2 - 1);
         break;
+    default:
+        error_report("Invalid revision %d for qxl device (max %d)",
+                     qxl->revision, QXL_DEFAULT_REVISION);
+        return -1;
     }
 
     pci_set_byte(&config[PCI_REVISION_ID], pci_device_rev);
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Qemu-devel] [PATCH 10/14] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-09-06  7:21 [Qemu-devel] [PULL 00/14] spice patch queue Gerd Hoffmann
                   ` (8 preceding siblings ...)
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 09/14] qxl: disallow unknown revisions Gerd Hoffmann
@ 2012-09-06  7:21 ` Gerd Hoffmann
  2012-09-28  9:51   ` Paolo Bonzini
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 11/14] configure: print spice-protocol and spice-server versions Gerd Hoffmann
                   ` (4 subsequent siblings)
  14 siblings, 1 reply; 19+ messages in thread
From: Gerd Hoffmann @ 2012-09-06  7:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alon Levy, Gerd Hoffmann

From: Alon Levy <alevy@redhat.com>

Revision bumped to 4 for new IO support, enabled for spice-server >=
0.11.1. New io enabled if revision is 4. Revision can be set to 4.

[ kraxel: 3 continues to be the default revision.  Once we have a new
          stable spice-server release and the qemu patches to enable
          the new bits merged we'll go flip the switch and make rev4
          the default ]

This io calls the corresponding new spice api
spice_qxl_monitors_config_async to let spice-server read a new guest set
monitors config and notify the client.

On migration reissue spice_qxl_monitors_config_async.

RHBZ: 770842

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

fixup

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 configure          |    7 ++++
 hw/qxl.c           |   97 +++++++++++++++++++++++++++++++++++++++++++++++++--
 hw/qxl.h           |    7 ++++
 trace-events       |    1 +
 ui/spice-display.h |    1 +
 5 files changed, 109 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index d97fd81..59521ea 100755
--- a/configure
+++ b/configure
@@ -2701,6 +2701,9 @@ EOF
     spice="yes"
     libs_softmmu="$libs_softmmu $spice_libs"
     QEMU_CFLAGS="$QEMU_CFLAGS $spice_cflags"
+    if $pkg_config --atleast-version=0.12.0 spice-protocol >/dev/null 2>&1; then
+        spice_qxl_io_monitors_config_async="yes"
+    fi
   else
     if test "$spice" = "yes" ; then
       feature_not_found "spice"
@@ -3438,6 +3441,10 @@ if test "$spice" = "yes" ; then
   echo "CONFIG_SPICE=y" >> $config_host_mak
 fi
 
+if test "$spice_qxl_io_monitors_config_async" = "yes" ; then
+  echo "CONFIG_QXL_IO_MONITORS_CONFIG_ASYNC=y" >> $config_host_mak
+fi
+
 if test "$smartcard" = "yes" ; then
   echo "CONFIG_SMARTCARD=y" >> $config_host_mak
 fi
diff --git a/hw/qxl.c b/hw/qxl.c
index d134a70..adf17fd 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -27,6 +27,11 @@
 
 #include "qxl.h"
 
+#ifndef CONFIG_QXL_IO_MONITORS_CONFIG_ASYNC
+/* spice-protocol is too old, add missing definitions */
+#define QXL_IO_MONITORS_CONFIG_ASYNC (QXL_IO_FLUSH_RELEASE + 1)
+#endif
+
 /*
  * NOTE: SPICE_RING_PROD_ITEM accesses memory on the pci bar and as
  * such can be changed by the guest, so to avoid a guest trigerrable
@@ -249,6 +254,39 @@ static void qxl_spice_destroy_surfaces(PCIQXLDevice *qxl, qxl_async_io async)
     }
 }
 
+static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl, int replay)
+{
+    trace_qxl_spice_monitors_config(qxl->id);
+/* 0x000b01 == 0.11.1 */
+#if SPICE_SERVER_VERSION >= 0x000b01 && \
+    defined(CONFIG_QXL_IO_MONITORS_CONFIG_ASYNC)
+    if (replay) {
+        /*
+         * don't use QXL_COOKIE_TYPE_IO:
+         *  - we are not running yet (post_load), we will assert
+         *    in send_events
+         *  - this is not a guest io, but a reply, so async_io isn't set.
+         */
+        spice_qxl_monitors_config_async(&qxl->ssd.qxl,
+                qxl->guest_monitors_config,
+                MEMSLOT_GROUP_GUEST,
+                (uintptr_t)qxl_cookie_new(
+                    QXL_COOKIE_TYPE_POST_LOAD_MONITORS_CONFIG,
+                    0));
+    } else {
+        qxl->guest_monitors_config = qxl->ram->monitors_config;
+        spice_qxl_monitors_config_async(&qxl->ssd.qxl,
+                qxl->ram->monitors_config,
+                MEMSLOT_GROUP_GUEST,
+                (uintptr_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO,
+                                          QXL_IO_MONITORS_CONFIG_ASYNC));
+    }
+#else
+    fprintf(stderr, "qxl: too old spice-protocol/spice-server for "
+            "QXL_IO_MONITORS_CONFIG_ASYNC\n");
+#endif
+}
+
 void qxl_spice_reset_image_cache(PCIQXLDevice *qxl)
 {
     trace_qxl_spice_reset_image_cache(qxl->id);
@@ -538,6 +576,7 @@ static const char *io_port_to_string(uint32_t io_port)
                                         = "QXL_IO_DESTROY_ALL_SURFACES_ASYNC",
         [QXL_IO_FLUSH_SURFACES_ASYNC]   = "QXL_IO_FLUSH_SURFACES_ASYNC",
         [QXL_IO_FLUSH_RELEASE]          = "QXL_IO_FLUSH_RELEASE",
+        [QXL_IO_MONITORS_CONFIG_ASYNC]  = "QXL_IO_MONITORS_CONFIG_ASYNC",
     };
     return io_port_to_string[io_port];
 }
@@ -819,6 +858,7 @@ static void interface_async_complete_io(PCIQXLDevice *qxl, QXLCookie *cookie)
     case QXL_IO_DESTROY_PRIMARY_ASYNC:
     case QXL_IO_UPDATE_AREA_ASYNC:
     case QXL_IO_FLUSH_SURFACES_ASYNC:
+    case QXL_IO_MONITORS_CONFIG_ASYNC:
         break;
     case QXL_IO_CREATE_PRIMARY_ASYNC:
         qxl_create_guest_primary_complete(qxl);
@@ -894,6 +934,8 @@ static void interface_async_complete(QXLInstance *sin, uint64_t cookie_token)
     case QXL_COOKIE_TYPE_RENDER_UPDATE_AREA:
         qxl_render_update_area_done(qxl, cookie);
         break;
+    case QXL_COOKIE_TYPE_POST_LOAD_MONITORS_CONFIG:
+        break;
     default:
         fprintf(stderr, "qxl: %s: unexpected cookie type %d\n",
                 __func__, cookie->type);
@@ -1315,6 +1357,13 @@ static void ioport_write(void *opaque, target_phys_addr_t addr,
         return;
     }
 
+    if (d->revision <= QXL_REVISION_STABLE_V10 &&
+        io_port >= QXL_IO_FLUSH_SURFACES_ASYNC) {
+        qxl_set_guest_bug(d, "unsupported io %d for revision %d\n",
+            io_port, d->revision);
+        return;
+    }
+
     switch (io_port) {
     case QXL_IO_RESET:
     case QXL_IO_SET_MODE:
@@ -1334,7 +1383,7 @@ static void ioport_write(void *opaque, target_phys_addr_t addr,
             io_port, io_port_to_string(io_port));
         /* be nice to buggy guest drivers */
         if (io_port >= QXL_IO_UPDATE_AREA_ASYNC &&
-            io_port <= QXL_IO_DESTROY_ALL_SURFACES_ASYNC) {
+            io_port < QXL_IO_RANGE_SIZE) {
             qxl_send_events(d, QXL_INTERRUPT_IO_CMD);
         }
         return;
@@ -1362,6 +1411,7 @@ static void ioport_write(void *opaque, target_phys_addr_t addr,
         io_port = QXL_IO_DESTROY_ALL_SURFACES;
         goto async_common;
     case QXL_IO_FLUSH_SURFACES_ASYNC:
+    case QXL_IO_MONITORS_CONFIG_ASYNC:
 async_common:
         async = QXL_ASYNC;
         qemu_mutex_lock(&d->async_lock);
@@ -1503,6 +1553,9 @@ async_common:
         d->mode = QXL_MODE_UNDEFINED;
         qxl_spice_destroy_surfaces(d, async);
         break;
+    case QXL_IO_MONITORS_CONFIG_ASYNC:
+        qxl_spice_monitors_config_async(d, 0);
+        break;
     default:
         qxl_set_guest_bug(d, "%s: unexpected ioport=0x%x\n", __func__, io_port);
     }
@@ -1798,9 +1851,17 @@ static int qxl_init_common(PCIQXLDevice *qxl)
         io_size = 16;
         break;
     case 3: /* qxl-3 */
-        pci_device_rev = QXL_DEFAULT_REVISION;
+        pci_device_rev = QXL_REVISION_STABLE_V10;
+        io_size = 32; /* PCI region size must be pow2 */
+        break;
+/* 0x000b01 == 0.11.1 */
+#if SPICE_SERVER_VERSION >= 0x000b01 && \
+        defined(CONFIG_QXL_IO_MONITORS_CONFIG_ASYNC)
+    case 4: /* qxl-4 */
+        pci_device_rev = QXL_REVISION_STABLE_V12;
         io_size = msb_mask(QXL_IO_RANGE_SIZE * 2 - 1);
         break;
+#endif
     default:
         error_report("Invalid revision %d for qxl device (max %d)",
                      qxl->revision, QXL_DEFAULT_REVISION);
@@ -1999,7 +2060,9 @@ static int qxl_post_load(void *opaque, int version)
         }
         qxl_spice_loadvm_commands(d, cmds, out);
         g_free(cmds);
-
+        if (d->guest_monitors_config) {
+            qxl_spice_monitors_config_async(d, 1);
+        }
         break;
     case QXL_MODE_COMPAT:
         /* note: no need to call qxl_create_memslots, qxl_set_mode
@@ -2012,6 +2075,14 @@ static int qxl_post_load(void *opaque, int version)
 
 #define QXL_SAVE_VERSION 21
 
+static bool qxl_monitors_config_needed(void *opaque)
+{
+    PCIQXLDevice *qxl = opaque;
+
+    return qxl->guest_monitors_config != 0;
+}
+
+
 static VMStateDescription qxl_memslot = {
     .name               = "qxl-memslot",
     .version_id         = QXL_SAVE_VERSION,
@@ -2042,6 +2113,16 @@ static VMStateDescription qxl_surface = {
     }
 };
 
+static VMStateDescription qxl_vmstate_monitors_config = {
+    .name               = "qxl/monitors-config",
+    .version_id         = 1,
+    .minimum_version_id = 1,
+    .fields = (VMStateField[]) {
+        VMSTATE_UINT64(guest_monitors_config, PCIQXLDevice),
+        VMSTATE_END_OF_LIST()
+    },
+};
+
 static VMStateDescription qxl_vmstate = {
     .name               = "qxl",
     .version_id         = QXL_SAVE_VERSION,
@@ -2049,7 +2130,7 @@ static VMStateDescription qxl_vmstate = {
     .pre_save           = qxl_pre_save,
     .pre_load           = qxl_pre_load,
     .post_load          = qxl_post_load,
-    .fields = (VMStateField []) {
+    .fields = (VMStateField[]) {
         VMSTATE_PCI_DEVICE(pci, PCIQXLDevice),
         VMSTATE_STRUCT(vga, PCIQXLDevice, 0, vmstate_vga_common, VGACommonState),
         VMSTATE_UINT32(shadow_rom.mode, PCIQXLDevice),
@@ -2068,6 +2149,14 @@ static VMStateDescription qxl_vmstate = {
         VMSTATE_UINT64(guest_cursor, PCIQXLDevice),
         VMSTATE_END_OF_LIST()
     },
+    .subsections = (VMStateSubsection[]) {
+        {
+            .vmsd = &qxl_vmstate_monitors_config,
+            .needed = qxl_monitors_config_needed,
+        }, {
+            /* empty */
+        }
+    }
 };
 
 static Property qxl_properties[] = {
diff --git a/hw/qxl.h b/hw/qxl.h
index 172baf6..9cfedb7 100644
--- a/hw/qxl.h
+++ b/hw/qxl.h
@@ -71,6 +71,8 @@ typedef struct PCIQXLDevice {
     } guest_surfaces;
     QXLPHYSICAL        guest_cursor;
 
+    QXLPHYSICAL        guest_monitors_config;
+
     QemuMutex          track_lock;
 
     /* thread signaling */
@@ -128,7 +130,12 @@ typedef struct PCIQXLDevice {
         }                                                               \
     } while (0)
 
+#if 0
+/* spice-server 0.12 is still in development */
+#define QXL_DEFAULT_REVISION QXL_REVISION_STABLE_V12
+#else
 #define QXL_DEFAULT_REVISION QXL_REVISION_STABLE_V10
+#endif
 
 /* qxl.c */
 void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL phys, int group_id);
diff --git a/trace-events b/trace-events
index 04b0723..8fcbc50 100644
--- a/trace-events
+++ b/trace-events
@@ -956,6 +956,7 @@ qxl_spice_destroy_surfaces(int qid, int async) "%d async=%d"
 qxl_spice_destroy_surface_wait_complete(int qid, uint32_t id) "%d sid=%d"
 qxl_spice_destroy_surface_wait(int qid, uint32_t id, int async) "%d sid=%d async=%d"
 qxl_spice_flush_surfaces_async(int qid, uint32_t surface_count, uint32_t num_free_res) "%d s#=%d, res#=%d"
+qxl_spice_monitors_config(int id) "%d"
 qxl_spice_loadvm_commands(int qid, void *ext, uint32_t count) "%d ext=%p count=%d"
 qxl_spice_oom(int qid) "%d"
 qxl_spice_reset_cursor(int qid) "%d"
diff --git a/ui/spice-display.h b/ui/spice-display.h
index 672d65e..bcff114 100644
--- a/ui/spice-display.h
+++ b/ui/spice-display.h
@@ -51,6 +51,7 @@ typedef enum qxl_async_io {
 enum {
     QXL_COOKIE_TYPE_IO,
     QXL_COOKIE_TYPE_RENDER_UPDATE_AREA,
+    QXL_COOKIE_TYPE_POST_LOAD_MONITORS_CONFIG,
 };
 
 typedef struct QXLCookie {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Qemu-devel] [PATCH 11/14] configure: print spice-protocol and spice-server versions
  2012-09-06  7:21 [Qemu-devel] [PULL 00/14] spice patch queue Gerd Hoffmann
                   ` (9 preceding siblings ...)
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 10/14] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC Gerd Hoffmann
@ 2012-09-06  7:21 ` Gerd Hoffmann
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 12/14] spice: make number of surfaces runtime-configurable Gerd Hoffmann
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Gerd Hoffmann @ 2012-09-06  7:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alon Levy, Gerd Hoffmann

From: Alon Levy <alevy@redhat.com>

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 configure |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index 59521ea..9592095 100755
--- a/configure
+++ b/configure
@@ -2701,6 +2701,8 @@ EOF
     spice="yes"
     libs_softmmu="$libs_softmmu $spice_libs"
     QEMU_CFLAGS="$QEMU_CFLAGS $spice_cflags"
+    spice_protocol_version=$($pkg_config --modversion spice-protocol)
+    spice_server_version=$($pkg_config --modversion spice-server)
     if $pkg_config --atleast-version=0.12.0 spice-protocol >/dev/null 2>&1; then
         spice_qxl_io_monitors_config_async="yes"
     fi
@@ -3159,7 +3161,7 @@ echo "libcap-ng support $cap_ng"
 echo "vhost-net support $vhost_net"
 echo "Trace backend     $trace_backend"
 echo "Trace output file $trace_file-<pid>"
-echo "spice support     $spice"
+echo "spice support     $spice ($spice_protocol_version/$spice_server_version)"
 echo "rbd support       $rbd"
 echo "xfsctl support    $xfs"
 echo "nss used          $smartcard_nss"
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Qemu-devel] [PATCH 12/14] spice: make number of surfaces runtime-configurable.
  2012-09-06  7:21 [Qemu-devel] [PULL 00/14] spice patch queue Gerd Hoffmann
                   ` (10 preceding siblings ...)
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 11/14] configure: print spice-protocol and spice-server versions Gerd Hoffmann
@ 2012-09-06  7:21 ` Gerd Hoffmann
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 13/14] qxl: Add set_client_capabilities() interface to QXLInterface Gerd Hoffmann
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Gerd Hoffmann @ 2012-09-06  7:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/qxl.c           |   31 +++++++++++++++++--------------
 hw/qxl.h           |    3 +--
 ui/spice-display.c |    5 ++++-
 ui/spice-display.h |    3 +--
 4 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/hw/qxl.c b/hw/qxl.c
index adf17fd..8725f67 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -236,7 +236,8 @@ static void qxl_spice_destroy_surfaces_complete(PCIQXLDevice *qxl)
 {
     trace_qxl_spice_destroy_surfaces_complete(qxl->id);
     qemu_mutex_lock(&qxl->track_lock);
-    memset(&qxl->guest_surfaces.cmds, 0, sizeof(qxl->guest_surfaces.cmds));
+    memset(qxl->guest_surfaces.cmds, 0,
+           sizeof(qxl->guest_surfaces.cmds) * qxl->ssd.num_surfaces);
     qxl->guest_surfaces.count = 0;
     qemu_mutex_unlock(&qxl->track_lock);
 }
@@ -345,7 +346,7 @@ static void init_qxl_rom(PCIQXLDevice *d)
     rom->slot_id_bits  = MEMSLOT_SLOT_BITS;
     rom->slots_start   = 1;
     rom->slots_end     = NUM_MEMSLOTS - 1;
-    rom->n_surfaces    = cpu_to_le32(NUM_SURFACES);
+    rom->n_surfaces    = cpu_to_le32(d->ssd.num_surfaces);
 
     for (i = 0, n = 0; i < ARRAY_SIZE(qxl_modes); i++) {
         fb = qxl_modes[i].y_res * qxl_modes[i].stride;
@@ -449,9 +450,9 @@ static int qxl_track_command(PCIQXLDevice *qxl, struct QXLCommandExt *ext)
         }
         uint32_t id = le32_to_cpu(cmd->surface_id);
 
-        if (id >= NUM_SURFACES) {
+        if (id >= qxl->ssd.num_surfaces) {
             qxl_set_guest_bug(qxl, "QXL_CMD_SURFACE id %d >= %d", id,
-                              NUM_SURFACES);
+                              qxl->ssd.num_surfaces);
             return 1;
         }
         qemu_mutex_lock(&qxl->track_lock);
@@ -527,7 +528,7 @@ static void interface_get_init_info(QXLInstance *sin, QXLDevInitInfo *info)
     info->num_memslots_groups = NUM_MEMSLOTS_GROUPS;
     info->internal_groupslot_id = 0;
     info->qxl_ram_size = le32_to_cpu(qxl->shadow_rom.num_pages) << TARGET_PAGE_BITS;
-    info->n_surfaces = NUM_SURFACES;
+    info->n_surfaces = qxl->ssd.num_surfaces;
 }
 
 static const char *qxl_mode_to_string(int mode)
@@ -1436,7 +1437,7 @@ async_common:
         QXLCookie *cookie = NULL;
         QXLRect update = d->ram->update_area;
 
-        if (d->ram->update_surface > NUM_SURFACES) {
+        if (d->ram->update_surface > d->ssd.num_surfaces) {
             qxl_set_guest_bug(d, "QXL_IO_UPDATE_AREA: invalid surface id %d\n",
                               d->ram->update_surface);
             return;
@@ -1529,7 +1530,7 @@ async_common:
         }
         break;
     case QXL_IO_DESTROY_SURFACE_WAIT:
-        if (val >= NUM_SURFACES) {
+        if (val >= d->ssd.num_surfaces) {
             qxl_set_guest_bug(d, "QXL_IO_DESTROY_SURFACE (async=%d):"
                              "%" PRIu64 " >= NUM_SURFACES", async, val);
             goto cancel_async;
@@ -1707,7 +1708,7 @@ static void qxl_dirty_surfaces(PCIQXLDevice *qxl)
     vram_start =  (intptr_t)memory_region_get_ram_ptr(&qxl->vram_bar);
 
     /* dirty the off-screen surfaces */
-    for (i = 0; i < NUM_SURFACES; i++) {
+    for (i = 0; i < qxl->ssd.num_surfaces; i++) {
         QXLSurfaceCmd *cmd;
         intptr_t surface_offset;
         int surface_size;
@@ -1835,7 +1836,6 @@ static int qxl_init_common(PCIQXLDevice *qxl)
     qxl->mode = QXL_MODE_UNDEFINED;
     qxl->generation = 1;
     qxl->num_memslots = NUM_MEMSLOTS;
-    qxl->num_surfaces = NUM_SURFACES;
     qemu_mutex_init(&qxl->track_lock);
     qemu_mutex_init(&qxl->async_lock);
     qxl->current_async = QXL_UNDEFINED_IO;
@@ -1877,6 +1877,7 @@ static int qxl_init_common(PCIQXLDevice *qxl)
     init_qxl_rom(qxl);
     init_qxl_ram(qxl);
 
+    qxl->guest_surfaces.cmds = g_new0(QXLPHYSICAL, qxl->ssd.num_surfaces);
     memory_region_init_ram(&qxl->vram_bar, "qxl.vram", qxl->vram_size);
     vmstate_register_ram(&qxl->vram_bar, &qxl->pci.qdev);
     memory_region_init_alias(&qxl->vram32_bar, "qxl.vram32", &qxl->vram_bar,
@@ -2042,8 +2043,8 @@ static int qxl_post_load(void *opaque, int version)
         qxl_create_guest_primary(d, 1, QXL_SYNC);
 
         /* replay surface-create and cursor-set commands */
-        cmds = g_malloc0(sizeof(QXLCommandExt) * (NUM_SURFACES + 1));
-        for (in = 0, out = 0; in < NUM_SURFACES; in++) {
+        cmds = g_malloc0(sizeof(QXLCommandExt) * (d->ssd.num_surfaces + 1));
+        for (in = 0, out = 0; in < d->ssd.num_surfaces; in++) {
             if (d->guest_surfaces.cmds[in] == 0) {
                 continue;
             }
@@ -2143,9 +2144,10 @@ static VMStateDescription qxl_vmstate = {
                              qxl_memslot, struct guest_slots),
         VMSTATE_STRUCT(guest_primary.surface, PCIQXLDevice, 0,
                        qxl_surface, QXLSurfaceCreate),
-        VMSTATE_INT32_EQUAL(num_surfaces, PCIQXLDevice),
-        VMSTATE_ARRAY(guest_surfaces.cmds, PCIQXLDevice, NUM_SURFACES, 0,
-                      vmstate_info_uint64, uint64_t),
+        VMSTATE_INT32_EQUAL(ssd.num_surfaces, PCIQXLDevice),
+        VMSTATE_VARRAY_INT32(guest_surfaces.cmds, PCIQXLDevice,
+                             ssd.num_surfaces, 0,
+                             vmstate_info_uint64, uint64_t),
         VMSTATE_UINT64(guest_cursor, PCIQXLDevice),
         VMSTATE_END_OF_LIST()
     },
@@ -2173,6 +2175,7 @@ static Property qxl_properties[] = {
         DEFINE_PROP_UINT32("vram_size_mb", PCIQXLDevice, vram32_size_mb, -1),
         DEFINE_PROP_UINT32("vram64_size_mb", PCIQXLDevice, vram_size_mb, -1),
         DEFINE_PROP_UINT32("vgamem_mb", PCIQXLDevice, vgamem_size_mb, 16),
+        DEFINE_PROP_INT32("surfaces", PCIQXLDevice, ssd.num_surfaces, 1024),
         DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/hw/qxl.h b/hw/qxl.h
index 9cfedb7..5553824 100644
--- a/hw/qxl.h
+++ b/hw/qxl.h
@@ -40,7 +40,6 @@ typedef struct PCIQXLDevice {
     uint32_t           revision;
 
     int32_t            num_memslots;
-    int32_t            num_surfaces;
 
     uint32_t           current_async;
     QemuMutex          async_lock;
@@ -65,7 +64,7 @@ typedef struct PCIQXLDevice {
     } guest_primary;
 
     struct surfaces {
-        QXLPHYSICAL    cmds[NUM_SURFACES];
+        QXLPHYSICAL    *cmds;
         uint32_t       count;
         uint32_t       max;
     } guest_surfaces;
diff --git a/ui/spice-display.c b/ui/spice-display.c
index 1c31418..99bc665 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -317,6 +317,9 @@ void qemu_spice_display_init_common(SimpleSpiceDisplay *ssd, DisplayState *ds)
     qemu_mutex_init(&ssd->lock);
     ssd->mouse_x = -1;
     ssd->mouse_y = -1;
+    if (ssd->num_surfaces == 0) {
+        ssd->num_surfaces = 1024;
+    }
     ssd->bufsize = (16 * 1024 * 1024);
     ssd->buf = g_malloc(ssd->bufsize);
 }
@@ -427,7 +430,7 @@ static void interface_get_init_info(QXLInstance *sin, QXLDevInitInfo *info)
     info->num_memslots_groups = NUM_MEMSLOTS_GROUPS;
     info->internal_groupslot_id = 0;
     info->qxl_ram_size = ssd->bufsize;
-    info->n_surfaces = NUM_SURFACES;
+    info->n_surfaces = ssd->num_surfaces;
 }
 
 static int interface_get_command(QXLInstance *sin, struct QXLCommandExt *ext)
diff --git a/ui/spice-display.h b/ui/spice-display.h
index bcff114..512ab78 100644
--- a/ui/spice-display.h
+++ b/ui/spice-display.h
@@ -32,8 +32,6 @@
 #define MEMSLOT_GROUP_GUEST 1
 #define NUM_MEMSLOTS_GROUPS 2
 
-#define NUM_SURFACES 1024
-
 /*
  * Internal enum to differenciate between options for
  * io calls that have a sync (old) version and an _async (new)
@@ -80,6 +78,7 @@ struct SimpleSpiceDisplay {
     QXLInstance qxl;
     uint32_t unique;
     QemuPfConv *conv;
+    int32_t num_surfaces;
 
     QXLRect dirty;
     int notify;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Qemu-devel] [PATCH 13/14] qxl: Add set_client_capabilities() interface to QXLInterface
  2012-09-06  7:21 [Qemu-devel] [PULL 00/14] spice patch queue Gerd Hoffmann
                   ` (11 preceding siblings ...)
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 12/14] spice: make number of surfaces runtime-configurable Gerd Hoffmann
@ 2012-09-06  7:21 ` Gerd Hoffmann
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 14/14] Remove #ifdef QXL_COMMAND_FLAG_COMPAT_16BPP Gerd Hoffmann
  2012-09-10 13:33 ` [Qemu-devel] [PULL 00/14] spice patch queue Aurelien Jarno
  14 siblings, 0 replies; 19+ messages in thread
From: Gerd Hoffmann @ 2012-09-06  7:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Søren Sandmann Pedersen, Gerd Hoffmann

From: Søren Sandmann Pedersen <ssp@redhat.com>

This new interface lets spice server inform the guest whether

(a) a client is connected
(b) what capabilities the client has

There is a fixed number (464) of bits reserved for capabilities, and
when the capabilities bits change, the QXL_INTERRUPT_CLIENT interrupt
is generated.

Signed-off-by: Soren Sandmann <ssp@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/qxl.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/hw/qxl.c b/hw/qxl.c
index 8725f67..2aa5848 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -944,6 +944,26 @@ static void interface_async_complete(QXLInstance *sin, uint64_t cookie_token)
     }
 }
 
+#if SPICE_SERVER_VERSION >= 0x000b04
+
+/* called from spice server thread context only */
+static void interface_set_client_capabilities(QXLInstance *sin,
+                                              uint8_t client_present,
+                                              uint8_t caps[58])
+{
+    PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
+
+    qxl->shadow_rom.client_present = client_present;
+    memcpy(qxl->shadow_rom.client_capabilities, caps, sizeof(caps));
+    qxl->rom->client_present = client_present;
+    memcpy(qxl->rom->client_capabilities, caps, sizeof(caps));
+    qxl_rom_set_dirty(qxl);
+
+    qxl_send_events(qxl, QXL_INTERRUPT_CLIENT);
+}
+
+#endif
+
 static const QXLInterface qxl_interface = {
     .base.type               = SPICE_INTERFACE_QXL,
     .base.description        = "qxl gpu",
@@ -965,6 +985,9 @@ static const QXLInterface qxl_interface = {
     .flush_resources         = interface_flush_resources,
     .async_complete          = interface_async_complete,
     .update_area_complete    = interface_update_area_complete,
+#if SPICE_SERVER_VERSION >= 0x000b04
+    .set_client_capabilities = interface_set_client_capabilities,
+#endif
 };
 
 static void qxl_enter_vga_mode(PCIQXLDevice *d)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Qemu-devel] [PATCH 14/14] Remove #ifdef QXL_COMMAND_FLAG_COMPAT_16BPP
  2012-09-06  7:21 [Qemu-devel] [PULL 00/14] spice patch queue Gerd Hoffmann
                   ` (12 preceding siblings ...)
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 13/14] qxl: Add set_client_capabilities() interface to QXLInterface Gerd Hoffmann
@ 2012-09-06  7:21 ` Gerd Hoffmann
  2012-09-10 13:33 ` [Qemu-devel] [PULL 00/14] spice patch queue Aurelien Jarno
  14 siblings, 0 replies; 19+ messages in thread
From: Gerd Hoffmann @ 2012-09-06  7:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Søren Sandmann Pedersen, Gerd Hoffmann

From: Søren Sandmann Pedersen <ssp@redhat.com>

We require spice >= 0.8 now, so this flag is always present.

Signed-off-by: Soren Sandmann <ssp@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/qxl.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/hw/qxl.c b/hw/qxl.c
index 2aa5848..b726c19 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1359,11 +1359,9 @@ static void qxl_set_mode(PCIQXLDevice *d, int modenr, int loadvm)
 
     d->mode = QXL_MODE_COMPAT;
     d->cmdflags = QXL_COMMAND_FLAG_COMPAT;
-#ifdef QXL_COMMAND_FLAG_COMPAT_16BPP /* new in spice 0.6.1 */
     if (mode->bits == 16) {
         d->cmdflags |= QXL_COMMAND_FLAG_COMPAT_16BPP;
     }
-#endif
     d->shadow_rom.mode = cpu_to_le32(modenr);
     d->rom->mode = cpu_to_le32(modenr);
     qxl_rom_set_dirty(d);
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] [PULL 00/14] spice patch queue
  2012-09-06  7:21 [Qemu-devel] [PULL 00/14] spice patch queue Gerd Hoffmann
                   ` (13 preceding siblings ...)
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 14/14] Remove #ifdef QXL_COMMAND_FLAG_COMPAT_16BPP Gerd Hoffmann
@ 2012-09-10 13:33 ` Aurelien Jarno
  14 siblings, 0 replies; 19+ messages in thread
From: Aurelien Jarno @ 2012-09-10 13:33 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

On Thu, Sep 06, 2012 at 09:21:26AM +0200, Gerd Hoffmann wrote:
>   Hi,
> 
> Here comes the spice patch queue with a bunch of fresh patches for 1.3.
> A new qmp event is there, to fix spice client migration races, and a
> bunch of patches needed to make use of the new goodies the upcoming
> spice-server version (0.12) brings.  The later is disabled by default,
> we'll flip the switch once 0.12 is finally released and all patches
> needed are merged.
> 
> cheers,
>   Gerd
> 
> The following changes since commit 8db972cfa469b4e4afd9c65e54e796b83b5ce3a2:
> 
>   Update version for 1.2.0 (2012-09-05 07:50:01 -0500)
> 
> are available in the git repository at:
>   git://anongit.freedesktop.org/spice/qemu spice.v59
> 
> Alon Levy (4):
>       qxl/update_area_io: guest_bug on invalid parameters
>       qxl: disallow unknown revisions
>       qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
>       configure: print spice-protocol and spice-server versions
> 
> Christophe Fergeau (1):
>       spice: abort on invalid streaming cmdline params
> 
> Gerd Hoffmann (1):
>       spice: make number of surfaces runtime-configurable.
> 
> Søren Sandmann Pedersen (2):
>       qxl: Add set_client_capabilities() interface to QXLInterface
>       Remove #ifdef QXL_COMMAND_FLAG_COMPAT_16BPP
> 
> Yonit Halperin (6):
>       spice: notify spice server on vm start/stop
>       spice: notify on vm state change only via spice_server_vm_start/stop
>       spice migration: add QEVENT_SPICE_MIGRATE_COMPLETED
>       spice: add 'migrated' flag to spice info
>       spice: adding seamless-migration option to the command line
>       spice: increase the verbosity of spice section in "qemu --help"
> 
>  configure          |   11 +++-
>  hmp.c              |    2 +
>  hw/qxl.c           |  175 +++++++++++++++++++++++++++++++++++++++++++++-------
>  hw/qxl.h           |   10 +++-
>  monitor.c          |    1 +
>  monitor.h          |    1 +
>  qapi-schema.json   |    5 +-
>  qemu-config.c      |    3 +
>  qemu-options.hx    |   21 ++++++-
>  trace-events       |    1 +
>  ui/spice-core.c    |   41 ++++++++++++-
>  ui/spice-display.c |   37 ++++++++++-
>  ui/spice-display.h |   13 +++-
>  13 files changed, 284 insertions(+), 37 deletions(-)
> 
> 

Thaknks, pulled.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] [PATCH 10/14] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-09-06  7:21 ` [Qemu-devel] [PATCH 10/14] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC Gerd Hoffmann
@ 2012-09-28  9:51   ` Paolo Bonzini
  2012-10-07  9:35     ` Alon Levy
  0 siblings, 1 reply; 19+ messages in thread
From: Paolo Bonzini @ 2012-09-28  9:51 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Alon Levy, qemu-devel

Il 06/09/2012 09:21, Gerd Hoffmann ha scritto:
> +#ifndef CONFIG_QXL_IO_MONITORS_CONFIG_ASYNC
> +/* spice-protocol is too old, add missing definitions */
> +#define QXL_IO_MONITORS_CONFIG_ASYNC (QXL_IO_FLUSH_RELEASE + 1)
> +#endif
> +

I don't see the need for this, why can't you just bump the minimum
required version of spice-protocol?  Or import the headers (and only the
headers) in QEMU?

Also, please consider adding the library version in the spice-protocol
header files, so that you do not need
CONFIG_QXL_IO_MONITORS_CONFIG_ASYNC at all.

Paolo

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] [PATCH 10/14] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-09-28  9:51   ` Paolo Bonzini
@ 2012-10-07  9:35     ` Alon Levy
  2012-10-08 13:16       ` Paolo Bonzini
  0 siblings, 1 reply; 19+ messages in thread
From: Alon Levy @ 2012-10-07  9:35 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Gerd Hoffmann, qemu-devel

On Fri, Sep 28, 2012 at 11:51:29AM +0200, Paolo Bonzini wrote:
> Il 06/09/2012 09:21, Gerd Hoffmann ha scritto:
> > +#ifndef CONFIG_QXL_IO_MONITORS_CONFIG_ASYNC
> > +/* spice-protocol is too old, add missing definitions */
> > +#define QXL_IO_MONITORS_CONFIG_ASYNC (QXL_IO_FLUSH_RELEASE + 1)
> > +#endif
> > +
> 
> I don't see the need for this, why can't you just bump the minimum
> required version of spice-protocol?  Or import the headers (and only the
> headers) in QEMU?

Sorry for the late reply.

Gerd wanted to bump the protocol version once after we do a release of
spice-protocol and spice-server, which has happened now so this patch
should be only an intermediate state that will be removed when
spice-protocol is bumped like you suggest.

Importing spice-protocol headers is ugly, I would rather not maintain
them twice (I do plan on doing it in the linux kernel but there I see no
other choice).

> 
> Also, please consider adding the library version in the spice-protocol
> header files, so that you do not need
> CONFIG_QXL_IO_MONITORS_CONFIG_ASYNC at all.

spice-protocol is a separate repository from spice library.

Adding the spice-protocol dependency as a submodule would have been my
preferred solution but it has been shot down by Anthony.

> 
> Paolo
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] [PATCH 10/14] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-10-07  9:35     ` Alon Levy
@ 2012-10-08 13:16       ` Paolo Bonzini
  0 siblings, 0 replies; 19+ messages in thread
From: Paolo Bonzini @ 2012-10-08 13:16 UTC (permalink / raw)
  To: Alon Levy; +Cc: Gerd Hoffmann, qemu-devel

Il 07/10/2012 11:35, Alon Levy ha scritto:
>> > Also, please consider adding the library version in the spice-protocol
>> > header files, so that you do not need
>> > CONFIG_QXL_IO_MONITORS_CONFIG_ASYNC at all.
> spice-protocol is a separate repository from spice library.

Yes, I mean adding to the spice-protocol header files some #defines for
the version of spice-protocol itself.

Paolo

> Adding the spice-protocol dependency as a submodule would have been my
> preferred solution but it has been shot down by Anthony.
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2012-10-08 13:16 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-06  7:21 [Qemu-devel] [PULL 00/14] spice patch queue Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 01/14] spice: abort on invalid streaming cmdline params Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 02/14] spice: notify spice server on vm start/stop Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 03/14] spice: notify on vm state change only via spice_server_vm_start/stop Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 04/14] spice migration: add QEVENT_SPICE_MIGRATE_COMPLETED Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 05/14] spice: add 'migrated' flag to spice info Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 06/14] spice: adding seamless-migration option to the command line Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 07/14] spice: increase the verbosity of spice section in "qemu --help" Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 08/14] qxl/update_area_io: guest_bug on invalid parameters Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 09/14] qxl: disallow unknown revisions Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 10/14] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC Gerd Hoffmann
2012-09-28  9:51   ` Paolo Bonzini
2012-10-07  9:35     ` Alon Levy
2012-10-08 13:16       ` Paolo Bonzini
2012-09-06  7:21 ` [Qemu-devel] [PATCH 11/14] configure: print spice-protocol and spice-server versions Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 12/14] spice: make number of surfaces runtime-configurable Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 13/14] qxl: Add set_client_capabilities() interface to QXLInterface Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 14/14] Remove #ifdef QXL_COMMAND_FLAG_COMPAT_16BPP Gerd Hoffmann
2012-09-10 13:33 ` [Qemu-devel] [PULL 00/14] spice patch queue Aurelien Jarno

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.