All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] qxl: disallow unknown revisions
@ 2012-07-23 13:08 Alon Levy
  2012-07-23 13:08 ` [Qemu-devel] [PATCH 2/2] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC Alon Levy
  0 siblings, 1 reply; 19+ messages in thread
From: Alon Levy @ 2012-07-23 13:08 UTC (permalink / raw)
  To: qemu-devel, kraxel

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

diff --git a/hw/qxl.c b/hw/qxl.c
index c2dd3b4..3a883ce 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1785,10 +1785,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.10.1

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

* [Qemu-devel] [PATCH 2/2] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-07-23 13:08 [Qemu-devel] [PATCH 1/2] qxl: disallow unknown revisions Alon Levy
@ 2012-07-23 13:08 ` Alon Levy
  2012-07-23 16:33   ` [Qemu-devel] [PATCH v2] " Alon Levy
  0 siblings, 1 reply; 19+ messages in thread
From: Alon Levy @ 2012-07-23 13:08 UTC (permalink / raw)
  To: qemu-devel, kraxel

bumps spice-protocol to 0.12.0 for new IO.
revision bumped to 4 for new IO support, enabled for spice-server >= 0.11.1

RHBZ: 770842

Signed-off-by: Alon Levy <alevy@redhat.com>
---
 configure    |    2 +-
 hw/qxl.c     |   29 ++++++++++++++++++++++++++++-
 hw/qxl.h     |    4 ++++
 trace-events |    1 +
 4 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index cef0a71..5fcd315 100755
--- a/configure
+++ b/configure
@@ -2630,7 +2630,7 @@ EOF
   spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null)
   spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null)
   if $pkg_config --atleast-version=0.8.2 spice-server >/dev/null 2>&1 && \
-     $pkg_config --atleast-version=0.8.1 spice-protocol > /dev/null 2>&1 && \
+     $pkg_config --atleast-version=0.12.0 spice-protocol > /dev/null 2>&1 && \
      compile_prog "$spice_cflags" "$spice_libs" ; then
     spice="yes"
     libs_softmmu="$libs_softmmu $spice_libs"
diff --git a/hw/qxl.c b/hw/qxl.c
index 3a883ce..5b5d380 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -249,6 +249,18 @@ static void qxl_spice_destroy_surfaces(PCIQXLDevice *qxl, qxl_async_io async)
     }
 }
 
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl)
+{
+    trace_qxl_spice_monitors_config(qxl->id);
+    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));
+}
+#endif
+
 void qxl_spice_reset_image_cache(PCIQXLDevice *qxl)
 {
     trace_qxl_spice_reset_image_cache(qxl->id);
@@ -538,6 +550,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];
 }
@@ -1333,7 +1346,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_MONITORS_CONFIG_ASYNC) {
             qxl_send_events(d, QXL_INTERRUPT_IO_CMD);
         }
         return;
@@ -1361,6 +1374,9 @@ 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:
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+    case QXL_IO_MONITORS_CONFIG_ASYNC:
+#endif
 async_common:
         async = QXL_ASYNC;
         qemu_mutex_lock(&d->async_lock);
@@ -1490,6 +1506,11 @@ async_common:
         d->mode = QXL_MODE_UNDEFINED;
         qxl_spice_destroy_surfaces(d, async);
         break;
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+    case QXL_IO_MONITORS_CONFIG_ASYNC:
+        qxl_spice_monitors_config_async(d);
+        break;
+#endif
     default:
         qxl_set_guest_bug(d, "%s: unexpected ioport=0x%x\n", __func__, io_port);
     }
@@ -1785,9 +1806,15 @@ static int qxl_init_common(PCIQXLDevice *qxl)
         io_size = 16;
         break;
     case 3: /* qxl-3 */
+        pci_device_rev = QXL_REVISION_STABLE_V10;
+        io_size = 32; /* PCI region size must be pow2 */
+        break;
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+    case 4: /* qxl-4 */
         pci_device_rev = QXL_DEFAULT_REVISION;
         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);
diff --git a/hw/qxl.h b/hw/qxl.h
index 172baf6..c1aadaa 100644
--- a/hw/qxl.h
+++ b/hw/qxl.h
@@ -128,7 +128,11 @@ typedef struct PCIQXLDevice {
         }                                                               \
     } while (0)
 
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+#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 2a5f074..3db04ad 100644
--- a/trace-events
+++ b/trace-events
@@ -954,6 +954,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"
-- 
1.7.10.1

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

* [Qemu-devel] [PATCH v2] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-07-23 13:08 ` [Qemu-devel] [PATCH 2/2] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC Alon Levy
@ 2012-07-23 16:33   ` Alon Levy
  2012-07-25  9:00     ` Yonit Halperin
  0 siblings, 1 reply; 19+ messages in thread
From: Alon Levy @ 2012-07-23 16:33 UTC (permalink / raw)
  To: qemu-devel, kraxel

bumps spice-protocol to 0.12.0 for new IO.
revision bumped to 4 for new IO support, enabled for spice-server >= 0.11.1

RHBZ: 770842

Signed-off-by: Alon Levy <alevy@redhat.com>
---
v2: fixed interface_async_complete_io to not complain about unexpected async io.

 configure    |    2 +-
 hw/qxl.c     |   30 +++++++++++++++++++++++++++++-
 hw/qxl.h     |    4 ++++
 trace-events |    1 +
 4 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index cef0a71..5fcd315 100755
--- a/configure
+++ b/configure
@@ -2630,7 +2630,7 @@ EOF
   spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null)
   spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null)
   if $pkg_config --atleast-version=0.8.2 spice-server >/dev/null 2>&1 && \
-     $pkg_config --atleast-version=0.8.1 spice-protocol > /dev/null 2>&1 && \
+     $pkg_config --atleast-version=0.12.0 spice-protocol > /dev/null 2>&1 && \
      compile_prog "$spice_cflags" "$spice_libs" ; then
     spice="yes"
     libs_softmmu="$libs_softmmu $spice_libs"
diff --git a/hw/qxl.c b/hw/qxl.c
index 3a883ce..0440440 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -249,6 +249,18 @@ static void qxl_spice_destroy_surfaces(PCIQXLDevice *qxl, qxl_async_io async)
     }
 }
 
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl)
+{
+    trace_qxl_spice_monitors_config(qxl->id);
+    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));
+}
+#endif
+
 void qxl_spice_reset_image_cache(PCIQXLDevice *qxl)
 {
     trace_qxl_spice_reset_image_cache(qxl->id);
@@ -538,6 +550,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 +832,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);
@@ -1333,7 +1347,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_MONITORS_CONFIG_ASYNC) {
             qxl_send_events(d, QXL_INTERRUPT_IO_CMD);
         }
         return;
@@ -1361,6 +1375,9 @@ 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:
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+    case QXL_IO_MONITORS_CONFIG_ASYNC:
+#endif
 async_common:
         async = QXL_ASYNC;
         qemu_mutex_lock(&d->async_lock);
@@ -1490,6 +1507,11 @@ async_common:
         d->mode = QXL_MODE_UNDEFINED;
         qxl_spice_destroy_surfaces(d, async);
         break;
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+    case QXL_IO_MONITORS_CONFIG_ASYNC:
+        qxl_spice_monitors_config_async(d);
+        break;
+#endif
     default:
         qxl_set_guest_bug(d, "%s: unexpected ioport=0x%x\n", __func__, io_port);
     }
@@ -1785,9 +1807,15 @@ static int qxl_init_common(PCIQXLDevice *qxl)
         io_size = 16;
         break;
     case 3: /* qxl-3 */
+        pci_device_rev = QXL_REVISION_STABLE_V10;
+        io_size = 32; /* PCI region size must be pow2 */
+        break;
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+    case 4: /* qxl-4 */
         pci_device_rev = QXL_DEFAULT_REVISION;
         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);
diff --git a/hw/qxl.h b/hw/qxl.h
index 172baf6..c1aadaa 100644
--- a/hw/qxl.h
+++ b/hw/qxl.h
@@ -128,7 +128,11 @@ typedef struct PCIQXLDevice {
         }                                                               \
     } while (0)
 
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+#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 2a5f074..3db04ad 100644
--- a/trace-events
+++ b/trace-events
@@ -954,6 +954,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"
-- 
1.7.10.1

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

* Re: [Qemu-devel] [PATCH v2] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-07-23 16:33   ` [Qemu-devel] [PATCH v2] " Alon Levy
@ 2012-07-25  9:00     ` Yonit Halperin
  2012-07-25 17:29       ` Alon Levy
  0 siblings, 1 reply; 19+ messages in thread
From: Yonit Halperin @ 2012-07-25  9:00 UTC (permalink / raw)
  To: Alon Levy; +Cc: qemu-devel, kraxel

Hi,
I think you should save the monitor configuration as part of the 
vmstate, and recall spice_qxl_monitors_config_async in qxl_post_load.

Regards,
Yonit.

On 07/23/2012 07:33 PM, Alon Levy wrote:
> bumps spice-protocol to 0.12.0 for new IO.
> revision bumped to 4 for new IO support, enabled for spice-server>= 0.11.1
>
> RHBZ: 770842
>
> Signed-off-by: Alon Levy<alevy@redhat.com>
> ---
> v2: fixed interface_async_complete_io to not complain about unexpected async io.
>
>   configure    |    2 +-
>   hw/qxl.c     |   30 +++++++++++++++++++++++++++++-
>   hw/qxl.h     |    4 ++++
>   trace-events |    1 +
>   4 files changed, 35 insertions(+), 2 deletions(-)
>
> diff --git a/configure b/configure
> index cef0a71..5fcd315 100755
> --- a/configure
> +++ b/configure
> @@ -2630,7 +2630,7 @@ EOF
>     spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null)
>     spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null)
>     if $pkg_config --atleast-version=0.8.2 spice-server>/dev/null 2>&1&&  \
> -     $pkg_config --atleast-version=0.8.1 spice-protocol>  /dev/null 2>&1&&  \
> +     $pkg_config --atleast-version=0.12.0 spice-protocol>  /dev/null 2>&1&&  \
>        compile_prog "$spice_cflags" "$spice_libs" ; then
>       spice="yes"
>       libs_softmmu="$libs_softmmu $spice_libs"
> diff --git a/hw/qxl.c b/hw/qxl.c
> index 3a883ce..0440440 100644
> --- a/hw/qxl.c
> +++ b/hw/qxl.c
> @@ -249,6 +249,18 @@ static void qxl_spice_destroy_surfaces(PCIQXLDevice *qxl, qxl_async_io async)
>       }
>   }
>
> +#if SPICE_SERVER_VERSION>= 0x000b01 /* 0.11.1 */
> +static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl)
> +{
> +    trace_qxl_spice_monitors_config(qxl->id);
> +    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));
> +}
> +#endif
> +
>   void qxl_spice_reset_image_cache(PCIQXLDevice *qxl)
>   {
>       trace_qxl_spice_reset_image_cache(qxl->id);
> @@ -538,6 +550,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 +832,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);
> @@ -1333,7 +1347,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_MONITORS_CONFIG_ASYNC) {
>               qxl_send_events(d, QXL_INTERRUPT_IO_CMD);
>           }
>           return;
> @@ -1361,6 +1375,9 @@ 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:
> +#if SPICE_SERVER_VERSION>= 0x000b01 /* 0.11.1 */
> +    case QXL_IO_MONITORS_CONFIG_ASYNC:
> +#endif
>   async_common:
>           async = QXL_ASYNC;
>           qemu_mutex_lock(&d->async_lock);
> @@ -1490,6 +1507,11 @@ async_common:
>           d->mode = QXL_MODE_UNDEFINED;
>           qxl_spice_destroy_surfaces(d, async);
>           break;
> +#if SPICE_SERVER_VERSION>= 0x000b01 /* 0.11.1 */
> +    case QXL_IO_MONITORS_CONFIG_ASYNC:
> +        qxl_spice_monitors_config_async(d);
> +        break;
> +#endif
>       default:
>           qxl_set_guest_bug(d, "%s: unexpected ioport=0x%x\n", __func__, io_port);
>       }
> @@ -1785,9 +1807,15 @@ static int qxl_init_common(PCIQXLDevice *qxl)
>           io_size = 16;
>           break;
>       case 3: /* qxl-3 */
> +        pci_device_rev = QXL_REVISION_STABLE_V10;
> +        io_size = 32; /* PCI region size must be pow2 */
> +        break;
> +#if SPICE_SERVER_VERSION>= 0x000b01 /* 0.11.1 */
> +    case 4: /* qxl-4 */
>           pci_device_rev = QXL_DEFAULT_REVISION;
>           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);
> diff --git a/hw/qxl.h b/hw/qxl.h
> index 172baf6..c1aadaa 100644
> --- a/hw/qxl.h
> +++ b/hw/qxl.h
> @@ -128,7 +128,11 @@ typedef struct PCIQXLDevice {
>           }                                                               \
>       } while (0)
>
> +#if SPICE_SERVER_VERSION>= 0x000b01 /* 0.11.1 */
> +#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 2a5f074..3db04ad 100644
> --- a/trace-events
> +++ b/trace-events
> @@ -954,6 +954,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"

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

* Re: [Qemu-devel] [PATCH v2] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-07-25  9:00     ` Yonit Halperin
@ 2012-07-25 17:29       ` Alon Levy
  2012-07-26  5:26         ` Yonit Halperin
  2012-07-28  8:56         ` Alon Levy
  0 siblings, 2 replies; 19+ messages in thread
From: Alon Levy @ 2012-07-25 17:29 UTC (permalink / raw)
  To: Yonit Halperin; +Cc: qemu-devel, kraxel

On Wed, Jul 25, 2012 at 12:00:21PM +0300, Yonit Halperin wrote:
> Hi,
> I think you should save the monitor configuration as part of the vmstate,
> and recall spice_qxl_monitors_config_async in qxl_post_load.

Good point, will do. Would be nice if I could differentiate same client
(that doesn't need the recalling) and new client.

> 
> Regards,
> Yonit.
> 
> On 07/23/2012 07:33 PM, Alon Levy wrote:
> >bumps spice-protocol to 0.12.0 for new IO.
> >revision bumped to 4 for new IO support, enabled for spice-server>= 0.11.1
> >
> >RHBZ: 770842
> >
> >Signed-off-by: Alon Levy<alevy@redhat.com>
> >---
> >v2: fixed interface_async_complete_io to not complain about unexpected async io.
> >
> >  configure    |    2 +-
> >  hw/qxl.c     |   30 +++++++++++++++++++++++++++++-
> >  hw/qxl.h     |    4 ++++
> >  trace-events |    1 +
> >  4 files changed, 35 insertions(+), 2 deletions(-)
> >
> >diff --git a/configure b/configure
> >index cef0a71..5fcd315 100755
> >--- a/configure
> >+++ b/configure
> >@@ -2630,7 +2630,7 @@ EOF
> >    spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null)
> >    spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null)
> >    if $pkg_config --atleast-version=0.8.2 spice-server>/dev/null 2>&1&&  \
> >-     $pkg_config --atleast-version=0.8.1 spice-protocol>  /dev/null 2>&1&&  \
> >+     $pkg_config --atleast-version=0.12.0 spice-protocol>  /dev/null 2>&1&&  \
> >       compile_prog "$spice_cflags" "$spice_libs" ; then
> >      spice="yes"
> >      libs_softmmu="$libs_softmmu $spice_libs"
> >diff --git a/hw/qxl.c b/hw/qxl.c
> >index 3a883ce..0440440 100644
> >--- a/hw/qxl.c
> >+++ b/hw/qxl.c
> >@@ -249,6 +249,18 @@ static void qxl_spice_destroy_surfaces(PCIQXLDevice *qxl, qxl_async_io async)
> >      }
> >  }
> >
> >+#if SPICE_SERVER_VERSION>= 0x000b01 /* 0.11.1 */
> >+static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl)
> >+{
> >+    trace_qxl_spice_monitors_config(qxl->id);
> >+    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));
> >+}
> >+#endif
> >+
> >  void qxl_spice_reset_image_cache(PCIQXLDevice *qxl)
> >  {
> >      trace_qxl_spice_reset_image_cache(qxl->id);
> >@@ -538,6 +550,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 +832,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);
> >@@ -1333,7 +1347,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_MONITORS_CONFIG_ASYNC) {
> >              qxl_send_events(d, QXL_INTERRUPT_IO_CMD);
> >          }
> >          return;
> >@@ -1361,6 +1375,9 @@ 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:
> >+#if SPICE_SERVER_VERSION>= 0x000b01 /* 0.11.1 */
> >+    case QXL_IO_MONITORS_CONFIG_ASYNC:
> >+#endif
> >  async_common:
> >          async = QXL_ASYNC;
> >          qemu_mutex_lock(&d->async_lock);
> >@@ -1490,6 +1507,11 @@ async_common:
> >          d->mode = QXL_MODE_UNDEFINED;
> >          qxl_spice_destroy_surfaces(d, async);
> >          break;
> >+#if SPICE_SERVER_VERSION>= 0x000b01 /* 0.11.1 */
> >+    case QXL_IO_MONITORS_CONFIG_ASYNC:
> >+        qxl_spice_monitors_config_async(d);
> >+        break;
> >+#endif
> >      default:
> >          qxl_set_guest_bug(d, "%s: unexpected ioport=0x%x\n", __func__, io_port);
> >      }
> >@@ -1785,9 +1807,15 @@ static int qxl_init_common(PCIQXLDevice *qxl)
> >          io_size = 16;
> >          break;
> >      case 3: /* qxl-3 */
> >+        pci_device_rev = QXL_REVISION_STABLE_V10;
> >+        io_size = 32; /* PCI region size must be pow2 */
> >+        break;
> >+#if SPICE_SERVER_VERSION>= 0x000b01 /* 0.11.1 */
> >+    case 4: /* qxl-4 */
> >          pci_device_rev = QXL_DEFAULT_REVISION;
> >          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);
> >diff --git a/hw/qxl.h b/hw/qxl.h
> >index 172baf6..c1aadaa 100644
> >--- a/hw/qxl.h
> >+++ b/hw/qxl.h
> >@@ -128,7 +128,11 @@ typedef struct PCIQXLDevice {
> >          }                                                               \
> >      } while (0)
> >
> >+#if SPICE_SERVER_VERSION>= 0x000b01 /* 0.11.1 */
> >+#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 2a5f074..3db04ad 100644
> >--- a/trace-events
> >+++ b/trace-events
> >@@ -954,6 +954,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"
> 

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

* Re: [Qemu-devel] [PATCH v2] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-07-25 17:29       ` Alon Levy
@ 2012-07-26  5:26         ` Yonit Halperin
  2012-07-28  8:56         ` Alon Levy
  1 sibling, 0 replies; 19+ messages in thread
From: Yonit Halperin @ 2012-07-26  5:26 UTC (permalink / raw)
  To: Alon Levy; +Cc: qemu-devel, kraxel

Hi,
On 07/25/2012 08:29 PM, Alon Levy wrote:
> On Wed, Jul 25, 2012 at 12:00:21PM +0300, Yonit Halperin wrote:
>> Hi,
>> I think you should save the monitor configuration as part of the vmstate,
>> and recall spice_qxl_monitors_config_async in qxl_post_load.
>
> Good point, will do. Would be nice if I could differentiate same client
> (that doesn't need the recalling) and new client.
>
The client doesn't need the recalling (if it the same client that was 
connected to the src); It is the destination server which needs the 
recalling, for the future clients that will get connected.

Cheers,
Yonit.
>>
>> Regards,
>> Yonit.
>>
>> On 07/23/2012 07:33 PM, Alon Levy wrote:
>>> bumps spice-protocol to 0.12.0 for new IO.
>>> revision bumped to 4 for new IO support, enabled for spice-server>= 0.11.1
>>>
>>> RHBZ: 770842
>>>
>>> Signed-off-by: Alon Levy<alevy@redhat.com>
>>> ---
>>> v2: fixed interface_async_complete_io to not complain about unexpected async io.
>>>
>>>   configure    |    2 +-
>>>   hw/qxl.c     |   30 +++++++++++++++++++++++++++++-
>>>   hw/qxl.h     |    4 ++++
>>>   trace-events |    1 +
>>>   4 files changed, 35 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/configure b/configure
>>> index cef0a71..5fcd315 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -2630,7 +2630,7 @@ EOF
>>>     spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null)
>>>     spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null)
>>>     if $pkg_config --atleast-version=0.8.2 spice-server>/dev/null 2>&1&&   \
>>> -     $pkg_config --atleast-version=0.8.1 spice-protocol>   /dev/null 2>&1&&   \
>>> +     $pkg_config --atleast-version=0.12.0 spice-protocol>   /dev/null 2>&1&&   \
>>>        compile_prog "$spice_cflags" "$spice_libs" ; then
>>>       spice="yes"
>>>       libs_softmmu="$libs_softmmu $spice_libs"
>>> diff --git a/hw/qxl.c b/hw/qxl.c
>>> index 3a883ce..0440440 100644
>>> --- a/hw/qxl.c
>>> +++ b/hw/qxl.c
>>> @@ -249,6 +249,18 @@ static void qxl_spice_destroy_surfaces(PCIQXLDevice *qxl, qxl_async_io async)
>>>       }
>>>   }
>>>
>>> +#if SPICE_SERVER_VERSION>= 0x000b01 /* 0.11.1 */
>>> +static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl)
>>> +{
>>> +    trace_qxl_spice_monitors_config(qxl->id);
>>> +    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));
>>> +}
>>> +#endif
>>> +
>>>   void qxl_spice_reset_image_cache(PCIQXLDevice *qxl)
>>>   {
>>>       trace_qxl_spice_reset_image_cache(qxl->id);
>>> @@ -538,6 +550,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 +832,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);
>>> @@ -1333,7 +1347,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_MONITORS_CONFIG_ASYNC) {
>>>               qxl_send_events(d, QXL_INTERRUPT_IO_CMD);
>>>           }
>>>           return;
>>> @@ -1361,6 +1375,9 @@ 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:
>>> +#if SPICE_SERVER_VERSION>= 0x000b01 /* 0.11.1 */
>>> +    case QXL_IO_MONITORS_CONFIG_ASYNC:
>>> +#endif
>>>   async_common:
>>>           async = QXL_ASYNC;
>>>           qemu_mutex_lock(&d->async_lock);
>>> @@ -1490,6 +1507,11 @@ async_common:
>>>           d->mode = QXL_MODE_UNDEFINED;
>>>           qxl_spice_destroy_surfaces(d, async);
>>>           break;
>>> +#if SPICE_SERVER_VERSION>= 0x000b01 /* 0.11.1 */
>>> +    case QXL_IO_MONITORS_CONFIG_ASYNC:
>>> +        qxl_spice_monitors_config_async(d);
>>> +        break;
>>> +#endif
>>>       default:
>>>           qxl_set_guest_bug(d, "%s: unexpected ioport=0x%x\n", __func__, io_port);
>>>       }
>>> @@ -1785,9 +1807,15 @@ static int qxl_init_common(PCIQXLDevice *qxl)
>>>           io_size = 16;
>>>           break;
>>>       case 3: /* qxl-3 */
>>> +        pci_device_rev = QXL_REVISION_STABLE_V10;
>>> +        io_size = 32; /* PCI region size must be pow2 */
>>> +        break;
>>> +#if SPICE_SERVER_VERSION>= 0x000b01 /* 0.11.1 */
>>> +    case 4: /* qxl-4 */
>>>           pci_device_rev = QXL_DEFAULT_REVISION;
>>>           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);
>>> diff --git a/hw/qxl.h b/hw/qxl.h
>>> index 172baf6..c1aadaa 100644
>>> --- a/hw/qxl.h
>>> +++ b/hw/qxl.h
>>> @@ -128,7 +128,11 @@ typedef struct PCIQXLDevice {
>>>           }                                                               \
>>>       } while (0)
>>>
>>> +#if SPICE_SERVER_VERSION>= 0x000b01 /* 0.11.1 */
>>> +#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 2a5f074..3db04ad 100644
>>> --- a/trace-events
>>> +++ b/trace-events
>>> @@ -954,6 +954,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"
>>

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

* [Qemu-devel] [PATCH v2] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-07-25 17:29       ` Alon Levy
  2012-07-26  5:26         ` Yonit Halperin
@ 2012-07-28  8:56         ` Alon Levy
  2012-07-28  9:01           ` Blue Swirl
  1 sibling, 1 reply; 19+ messages in thread
From: Alon Levy @ 2012-07-28  8:56 UTC (permalink / raw)
  To: qemu-devel, yhalperi, kraxel

bumps spice-protocol to 0.12.0 for new IO.
revision bumped to 4 for new IO support, enabled for spice-server >= 0.11.1
on migration reissue spice_qxl_monitors_config_async.

RHBZ: 770842

Signed-off-by: Alon Levy <alevy@redhat.com>
---
 configure          |    2 +-
 hw/qxl.c           |   47 +++++++++++++++++++++++++++++++++++++++++++++--
 hw/qxl.h           |    6 ++++++
 trace-events       |    1 +
 ui/spice-display.h |    1 +
 5 files changed, 54 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index cef0a71..5fcd315 100755
--- a/configure
+++ b/configure
@@ -2630,7 +2630,7 @@ EOF
   spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null)
   spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null)
   if $pkg_config --atleast-version=0.8.2 spice-server >/dev/null 2>&1 && \
-     $pkg_config --atleast-version=0.8.1 spice-protocol > /dev/null 2>&1 && \
+     $pkg_config --atleast-version=0.12.0 spice-protocol > /dev/null 2>&1 && \
      compile_prog "$spice_cflags" "$spice_libs" ; then
     spice="yes"
     libs_softmmu="$libs_softmmu $spice_libs"
diff --git a/hw/qxl.c b/hw/qxl.c
index 3a883ce..607e612 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -249,6 +249,19 @@ static void qxl_spice_destroy_surfaces(PCIQXLDevice *qxl, qxl_async_io async)
     }
 }
 
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl)
+{
+    trace_qxl_spice_monitors_config(qxl->id);
+    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));
+}
+#endif
+
 void qxl_spice_reset_image_cache(PCIQXLDevice *qxl)
 {
     trace_qxl_spice_reset_image_cache(qxl->id);
@@ -538,6 +551,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 +833,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 +909,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);
@@ -1333,7 +1350,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_MONITORS_CONFIG_ASYNC) {
             qxl_send_events(d, QXL_INTERRUPT_IO_CMD);
         }
         return;
@@ -1361,6 +1378,9 @@ 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:
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+    case QXL_IO_MONITORS_CONFIG_ASYNC:
+#endif
 async_common:
         async = QXL_ASYNC;
         qemu_mutex_lock(&d->async_lock);
@@ -1490,6 +1510,11 @@ async_common:
         d->mode = QXL_MODE_UNDEFINED;
         qxl_spice_destroy_surfaces(d, async);
         break;
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+    case QXL_IO_MONITORS_CONFIG_ASYNC:
+        qxl_spice_monitors_config_async(d);
+        break;
+#endif
     default:
         qxl_set_guest_bug(d, "%s: unexpected ioport=0x%x\n", __func__, io_port);
     }
@@ -1785,9 +1810,15 @@ static int qxl_init_common(PCIQXLDevice *qxl)
         io_size = 16;
         break;
     case 3: /* qxl-3 */
+        pci_device_rev = QXL_REVISION_STABLE_V10;
+        io_size = 32; /* PCI region size must be pow2 */
+        break;
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+    case 4: /* qxl-4 */
         pci_device_rev = QXL_DEFAULT_REVISION;
         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);
@@ -1986,7 +2017,18 @@ static int qxl_post_load(void *opaque, int version)
         }
         qxl_spice_loadvm_commands(d, cmds, out);
         g_free(cmds);
-
+        if (d->guest_monitors_config) {
+            // 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(&d->ssd.qxl,
+                    d->guest_monitors_config,
+                    MEMSLOT_GROUP_GUEST,
+                    (uintptr_t)qxl_cookie_new(
+                        QXL_COOKIE_TYPE_POST_LOAD_MONITORS_CONFIG,
+                        0));
+        }
         break;
     case QXL_MODE_COMPAT:
         /* note: no need to call qxl_create_memslots, qxl_set_mode
@@ -2053,6 +2095,7 @@ static VMStateDescription qxl_vmstate = {
         VMSTATE_ARRAY(guest_surfaces.cmds, PCIQXLDevice, NUM_SURFACES, 0,
                       vmstate_info_uint64, uint64_t),
         VMSTATE_UINT64(guest_cursor, PCIQXLDevice),
+        VMSTATE_UINT64(guest_monitors_config, PCIQXLDevice),
         VMSTATE_END_OF_LIST()
     },
 };
diff --git a/hw/qxl.h b/hw/qxl.h
index 172baf6..d6649bc 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,11 @@ typedef struct PCIQXLDevice {
         }                                                               \
     } while (0)
 
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+#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 2a5f074..3db04ad 100644
--- a/trace-events
+++ b/trace-events
@@ -954,6 +954,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 12e50b6..7fa095f 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.10.1

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

* Re: [Qemu-devel] [PATCH v2] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-07-28  8:56         ` Alon Levy
@ 2012-07-28  9:01           ` Blue Swirl
  2012-07-28 10:20             ` Alon Levy
  2012-07-28 10:23             ` [Qemu-devel] [PATCH v3] " Alon Levy
  0 siblings, 2 replies; 19+ messages in thread
From: Blue Swirl @ 2012-07-28  9:01 UTC (permalink / raw)
  To: Alon Levy; +Cc: yhalperi, qemu-devel, kraxel

On Sat, Jul 28, 2012 at 8:56 AM, Alon Levy <alevy@redhat.com> wrote:
> bumps spice-protocol to 0.12.0 for new IO.
> revision bumped to 4 for new IO support, enabled for spice-server >= 0.11.1
> on migration reissue spice_qxl_monitors_config_async.
>
> RHBZ: 770842
>
> Signed-off-by: Alon Levy <alevy@redhat.com>
> ---
>  configure          |    2 +-
>  hw/qxl.c           |   47 +++++++++++++++++++++++++++++++++++++++++++++--
>  hw/qxl.h           |    6 ++++++
>  trace-events       |    1 +
>  ui/spice-display.h |    1 +
>  5 files changed, 54 insertions(+), 3 deletions(-)
>
> diff --git a/configure b/configure
> index cef0a71..5fcd315 100755
> --- a/configure
> +++ b/configure
> @@ -2630,7 +2630,7 @@ EOF
>    spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null)
>    spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null)
>    if $pkg_config --atleast-version=0.8.2 spice-server >/dev/null 2>&1 && \
> -     $pkg_config --atleast-version=0.8.1 spice-protocol > /dev/null 2>&1 && \
> +     $pkg_config --atleast-version=0.12.0 spice-protocol > /dev/null 2>&1 && \
>       compile_prog "$spice_cflags" "$spice_libs" ; then
>      spice="yes"
>      libs_softmmu="$libs_softmmu $spice_libs"
> diff --git a/hw/qxl.c b/hw/qxl.c
> index 3a883ce..607e612 100644
> --- a/hw/qxl.c
> +++ b/hw/qxl.c
> @@ -249,6 +249,19 @@ static void qxl_spice_destroy_surfaces(PCIQXLDevice *qxl, qxl_async_io async)
>      }
>  }
>
> +#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
> +static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl)
> +{
> +    trace_qxl_spice_monitors_config(qxl->id);
> +    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));
> +}
> +#endif
> +
>  void qxl_spice_reset_image_cache(PCIQXLDevice *qxl)
>  {
>      trace_qxl_spice_reset_image_cache(qxl->id);
> @@ -538,6 +551,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 +833,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 +909,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);
> @@ -1333,7 +1350,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_MONITORS_CONFIG_ASYNC) {
>              qxl_send_events(d, QXL_INTERRUPT_IO_CMD);
>          }
>          return;
> @@ -1361,6 +1378,9 @@ 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:
> +#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
> +    case QXL_IO_MONITORS_CONFIG_ASYNC:
> +#endif
>  async_common:
>          async = QXL_ASYNC;
>          qemu_mutex_lock(&d->async_lock);
> @@ -1490,6 +1510,11 @@ async_common:
>          d->mode = QXL_MODE_UNDEFINED;
>          qxl_spice_destroy_surfaces(d, async);
>          break;
> +#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
> +    case QXL_IO_MONITORS_CONFIG_ASYNC:
> +        qxl_spice_monitors_config_async(d);
> +        break;
> +#endif
>      default:
>          qxl_set_guest_bug(d, "%s: unexpected ioport=0x%x\n", __func__, io_port);
>      }
> @@ -1785,9 +1810,15 @@ static int qxl_init_common(PCIQXLDevice *qxl)
>          io_size = 16;
>          break;
>      case 3: /* qxl-3 */
> +        pci_device_rev = QXL_REVISION_STABLE_V10;
> +        io_size = 32; /* PCI region size must be pow2 */
> +        break;
> +#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
> +    case 4: /* qxl-4 */
>          pci_device_rev = QXL_DEFAULT_REVISION;
>          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);
> @@ -1986,7 +2017,18 @@ static int qxl_post_load(void *opaque, int version)
>          }
>          qxl_spice_loadvm_commands(d, cmds, out);
>          g_free(cmds);
> -
> +        if (d->guest_monitors_config) {
> +            // 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.

Please use checkpatch.pl to avoid C99 comments.

> +            spice_qxl_monitors_config_async(&d->ssd.qxl,
> +                    d->guest_monitors_config,
> +                    MEMSLOT_GROUP_GUEST,
> +                    (uintptr_t)qxl_cookie_new(
> +                        QXL_COOKIE_TYPE_POST_LOAD_MONITORS_CONFIG,
> +                        0));
> +        }
>          break;
>      case QXL_MODE_COMPAT:
>          /* note: no need to call qxl_create_memslots, qxl_set_mode
> @@ -2053,6 +2095,7 @@ static VMStateDescription qxl_vmstate = {
>          VMSTATE_ARRAY(guest_surfaces.cmds, PCIQXLDevice, NUM_SURFACES, 0,
>                        vmstate_info_uint64, uint64_t),
>          VMSTATE_UINT64(guest_cursor, PCIQXLDevice),
> +        VMSTATE_UINT64(guest_monitors_config, PCIQXLDevice),
>          VMSTATE_END_OF_LIST()
>      },
>  };
> diff --git a/hw/qxl.h b/hw/qxl.h
> index 172baf6..d6649bc 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,11 @@ typedef struct PCIQXLDevice {
>          }                                                               \
>      } while (0)
>
> +#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
> +#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 2a5f074..3db04ad 100644
> --- a/trace-events
> +++ b/trace-events
> @@ -954,6 +954,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 12e50b6..7fa095f 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.10.1
>
>

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

* Re: [Qemu-devel] [PATCH v2] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-07-28  9:01           ` Blue Swirl
@ 2012-07-28 10:20             ` Alon Levy
  2012-07-28 10:23             ` [Qemu-devel] [PATCH v3] " Alon Levy
  1 sibling, 0 replies; 19+ messages in thread
From: Alon Levy @ 2012-07-28 10:20 UTC (permalink / raw)
  To: Blue Swirl; +Cc: yhalperi, qemu-devel, kraxel

On Sat, Jul 28, 2012 at 09:01:11AM +0000, Blue Swirl wrote:
> > +            //  - this is not a guest io, but a reply, so async_io isn't set.
> 
> Please use checkpatch.pl to avoid C99 comments.
> 

Doh, I must have missed it (I do), will fix, thanks.

Alon

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

* [Qemu-devel] [PATCH v3] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-07-28  9:01           ` Blue Swirl
  2012-07-28 10:20             ` Alon Levy
@ 2012-07-28 10:23             ` Alon Levy
  2012-08-06  7:31               ` Gerd Hoffmann
  1 sibling, 1 reply; 19+ messages in thread
From: Alon Levy @ 2012-07-28 10:23 UTC (permalink / raw)
  To: qemu-devel, kraxel, yhalperi

bumps spice-protocol to 0.12.0 for new IO.
revision bumped to 4 for new IO support, enabled for spice-server >= 0.11.1
on migration reissue spice_qxl_monitors_config_async.

RHBZ: 770842

Signed-off-by: Alon Levy <alevy@redhat.com>
---
 configure          |  2 +-
 hw/qxl.c           | 49 +++++++++++++++++++++++++++++++++++++++++++++++--
 hw/qxl.h           |  6 ++++++
 trace-events       |  1 +
 ui/spice-display.h |  1 +
 5 files changed, 56 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index cef0a71..5fcd315 100755
--- a/configure
+++ b/configure
@@ -2630,7 +2630,7 @@ EOF
   spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null)
   spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null)
   if $pkg_config --atleast-version=0.8.2 spice-server >/dev/null 2>&1 && \
-     $pkg_config --atleast-version=0.8.1 spice-protocol > /dev/null 2>&1 && \
+     $pkg_config --atleast-version=0.12.0 spice-protocol > /dev/null 2>&1 && \
      compile_prog "$spice_cflags" "$spice_libs" ; then
     spice="yes"
     libs_softmmu="$libs_softmmu $spice_libs"
diff --git a/hw/qxl.c b/hw/qxl.c
index 3a883ce..2131f20 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -249,6 +249,19 @@ static void qxl_spice_destroy_surfaces(PCIQXLDevice *qxl, qxl_async_io async)
     }
 }
 
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl)
+{
+    trace_qxl_spice_monitors_config(qxl->id);
+    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));
+}
+#endif
+
 void qxl_spice_reset_image_cache(PCIQXLDevice *qxl)
 {
     trace_qxl_spice_reset_image_cache(qxl->id);
@@ -538,6 +551,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 +833,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 +909,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);
@@ -1333,7 +1350,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_MONITORS_CONFIG_ASYNC) {
             qxl_send_events(d, QXL_INTERRUPT_IO_CMD);
         }
         return;
@@ -1361,6 +1378,9 @@ 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:
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+    case QXL_IO_MONITORS_CONFIG_ASYNC:
+#endif
 async_common:
         async = QXL_ASYNC;
         qemu_mutex_lock(&d->async_lock);
@@ -1490,6 +1510,11 @@ async_common:
         d->mode = QXL_MODE_UNDEFINED;
         qxl_spice_destroy_surfaces(d, async);
         break;
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+    case QXL_IO_MONITORS_CONFIG_ASYNC:
+        qxl_spice_monitors_config_async(d);
+        break;
+#endif
     default:
         qxl_set_guest_bug(d, "%s: unexpected ioport=0x%x\n", __func__, io_port);
     }
@@ -1785,9 +1810,15 @@ static int qxl_init_common(PCIQXLDevice *qxl)
         io_size = 16;
         break;
     case 3: /* qxl-3 */
+        pci_device_rev = QXL_REVISION_STABLE_V10;
+        io_size = 32; /* PCI region size must be pow2 */
+        break;
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+    case 4: /* qxl-4 */
         pci_device_rev = QXL_DEFAULT_REVISION;
         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);
@@ -1986,7 +2017,20 @@ static int qxl_post_load(void *opaque, int version)
         }
         qxl_spice_loadvm_commands(d, cmds, out);
         g_free(cmds);
-
+        if (d->guest_monitors_config) {
+            /*
+             * 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(&d->ssd.qxl,
+                    d->guest_monitors_config,
+                    MEMSLOT_GROUP_GUEST,
+                    (uintptr_t)qxl_cookie_new(
+                        QXL_COOKIE_TYPE_POST_LOAD_MONITORS_CONFIG,
+                        0));
+        }
         break;
     case QXL_MODE_COMPAT:
         /* note: no need to call qxl_create_memslots, qxl_set_mode
@@ -2053,6 +2097,7 @@ static VMStateDescription qxl_vmstate = {
         VMSTATE_ARRAY(guest_surfaces.cmds, PCIQXLDevice, NUM_SURFACES, 0,
                       vmstate_info_uint64, uint64_t),
         VMSTATE_UINT64(guest_cursor, PCIQXLDevice),
+        VMSTATE_UINT64(guest_monitors_config, PCIQXLDevice),
         VMSTATE_END_OF_LIST()
     },
 };
diff --git a/hw/qxl.h b/hw/qxl.h
index 172baf6..d6649bc 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,11 @@ typedef struct PCIQXLDevice {
         }                                                               \
     } while (0)
 
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+#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 2a5f074..3db04ad 100644
--- a/trace-events
+++ b/trace-events
@@ -954,6 +954,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 12e50b6..7fa095f 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.11.2

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

* Re: [Qemu-devel] [PATCH v3] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-07-28 10:23             ` [Qemu-devel] [PATCH v3] " Alon Levy
@ 2012-08-06  7:31               ` Gerd Hoffmann
  2012-08-09 13:41                 ` Alon Levy
  0 siblings, 1 reply; 19+ messages in thread
From: Gerd Hoffmann @ 2012-08-06  7:31 UTC (permalink / raw)
  To: Alon Levy; +Cc: yhalperi, qemu-devel

> diff --git a/configure b/configure
> index cef0a71..5fcd315 100755
> --- a/configure
> +++ b/configure
> @@ -2630,7 +2630,7 @@ EOF
>    spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null)
>    spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null)
>    if $pkg_config --atleast-version=0.8.2 spice-server >/dev/null 2>&1 && \
> -     $pkg_config --atleast-version=0.8.1 spice-protocol > /dev/null 2>&1 && \
> +     $pkg_config --atleast-version=0.12.0 spice-protocol > /dev/null 2>&1 && \

I'd prefer to not require cutting-edge spice bits to build ...

>      case QXL_IO_FLUSH_SURFACES_ASYNC:
> +#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
> +    case QXL_IO_MONITORS_CONFIG_ASYNC:
> +#endif

... and given you #ifdef the new stuff anyway it should not be needed.

cheers,
  Gerd

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

* Re: [Qemu-devel] [PATCH v3] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-08-06  7:31               ` Gerd Hoffmann
@ 2012-08-09 13:41                 ` Alon Levy
  2012-08-09 13:50                   ` Gerd Hoffmann
  0 siblings, 1 reply; 19+ messages in thread
From: Alon Levy @ 2012-08-09 13:41 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: yhalperi, qemu-devel

On Mon, Aug 06, 2012 at 09:31:19AM +0200, Gerd Hoffmann wrote:
> > diff --git a/configure b/configure
> > index cef0a71..5fcd315 100755
> > --- a/configure
> > +++ b/configure
> > @@ -2630,7 +2630,7 @@ EOF
> >    spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null)
> >    spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null)
> >    if $pkg_config --atleast-version=0.8.2 spice-server >/dev/null 2>&1 && \
> > -     $pkg_config --atleast-version=0.8.1 spice-protocol > /dev/null 2>&1 && \
> > +     $pkg_config --atleast-version=0.12.0 spice-protocol > /dev/null 2>&1 && \
> 
> I'd prefer to not require cutting-edge spice bits to build ...

I only increased the protocol requirement, not the server.

This is actually not related to the SERVER_VERSION below, it's needed
for the new io code QXL_IO_MONITORS_CONFIG_ASYNC. I would like to
propose we add spice-protocol as a submodule to fix this dependency,
since it's a small module containing headers, so even if it isn't used
it shouldn't place a large burden on qemu developers.

Meanwhile I'll add a define based on the pkg-config spice-protocol
version, which I can test from hw/qxl.c, since the commit adding
QXL_IO_MONITORS_CONFIG_ASYNC didn't introduce any new define I can
check.

> 
> >      case QXL_IO_FLUSH_SURFACES_ASYNC:
> > +#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
> > +    case QXL_IO_MONITORS_CONFIG_ASYNC:
> > +#endif
> 
> ... and given you #ifdef the new stuff anyway it should not be needed.
> 
> cheers,
>   Gerd
> 

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

* Re: [Qemu-devel] [PATCH v3] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-08-09 13:41                 ` Alon Levy
@ 2012-08-09 13:50                   ` Gerd Hoffmann
  2012-08-09 14:18                     ` Alon Levy
  2012-08-09 14:21                     ` [Qemu-devel] [PATCH v4 1/2] " Alon Levy
  0 siblings, 2 replies; 19+ messages in thread
From: Gerd Hoffmann @ 2012-08-09 13:50 UTC (permalink / raw)
  To: Alon Levy; +Cc: yhalperi, qemu-devel

On 08/09/12 15:41, Alon Levy wrote:
> On Mon, Aug 06, 2012 at 09:31:19AM +0200, Gerd Hoffmann wrote:
>>> diff --git a/configure b/configure
>>> index cef0a71..5fcd315 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -2630,7 +2630,7 @@ EOF
>>>    spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null)
>>>    spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null)
>>>    if $pkg_config --atleast-version=0.8.2 spice-server >/dev/null 2>&1 && \
>>> -     $pkg_config --atleast-version=0.8.1 spice-protocol > /dev/null 2>&1 && \
>>> +     $pkg_config --atleast-version=0.12.0 spice-protocol > /dev/null 2>&1 && \
>>
>> I'd prefer to not require cutting-edge spice bits to build ...
> 
> I only increased the protocol requirement, not the server.

Distros tend to update those in sync, so this doesn't help much for the
average user, this change would likely cause spice detection fail on
almost every released distro ...

> Meanwhile I'll add a define based on the pkg-config spice-protocol
> version, which I can test from hw/qxl.c, since the commit adding
> QXL_IO_MONITORS_CONFIG_ASYNC didn't introduce any new define I can
> check.

Just checking "SPICE_SERVER_VERSION >= 0x000b01" doesn't work?  I'd
expect spice-server 0.11.1+ having a dependency on a recent enougth
spice-protocol so you can expect QXL_IO_MONITORS_CONFIG_ASYNC being
present then, no?

thanks,
  Gerd

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

* Re: [Qemu-devel] [PATCH v3] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-08-09 13:50                   ` Gerd Hoffmann
@ 2012-08-09 14:18                     ` Alon Levy
  2012-08-09 14:21                     ` [Qemu-devel] [PATCH v4 1/2] " Alon Levy
  1 sibling, 0 replies; 19+ messages in thread
From: Alon Levy @ 2012-08-09 14:18 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: yhalperi, qemu-devel

On Thu, Aug 09, 2012 at 03:50:12PM +0200, Gerd Hoffmann wrote:
> On 08/09/12 15:41, Alon Levy wrote:
> > On Mon, Aug 06, 2012 at 09:31:19AM +0200, Gerd Hoffmann wrote:
> >>> diff --git a/configure b/configure
> >>> index cef0a71..5fcd315 100755
> >>> --- a/configure
> >>> +++ b/configure
> >>> @@ -2630,7 +2630,7 @@ EOF
> >>>    spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null)
> >>>    spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null)
> >>>    if $pkg_config --atleast-version=0.8.2 spice-server >/dev/null 2>&1 && \
> >>> -     $pkg_config --atleast-version=0.8.1 spice-protocol > /dev/null 2>&1 && \
> >>> +     $pkg_config --atleast-version=0.12.0 spice-protocol > /dev/null 2>&1 && \
> >>
> >> I'd prefer to not require cutting-edge spice bits to build ...
> > 
> > I only increased the protocol requirement, not the server.
> 
> Distros tend to update those in sync, so this doesn't help much for the
> average user, this change would likely cause spice detection fail on
> almost every released distro ...

You're right. This would be solved with a submodule.

> 
> > Meanwhile I'll add a define based on the pkg-config spice-protocol
> > version, which I can test from hw/qxl.c, since the commit adding
> > QXL_IO_MONITORS_CONFIG_ASYNC didn't introduce any new define I can
> > check.
> 
> Just checking "SPICE_SERVER_VERSION >= 0x000b01" doesn't work?  I'd
> expect spice-server 0.11.1+ having a dependency on a recent enougth
> spice-protocol so you can expect QXL_IO_MONITORS_CONFIG_ASYNC being
> present then, no?

Since spice-server now uses submodules, it doesn't check for an external
spice-protocol, so no.

> 
> thanks,
>   Gerd
> 

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

* [Qemu-devel] [PATCH v4 1/2] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-08-09 13:50                   ` Gerd Hoffmann
  2012-08-09 14:18                     ` Alon Levy
@ 2012-08-09 14:21                     ` Alon Levy
  2012-08-09 14:21                       ` [Qemu-devel] [PATCH v4 2/2] configure: print spice-protocol and spice-server versions Alon Levy
  2012-08-15  8:23                       ` [Qemu-devel] [PATCH v4 1/2] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC Gerd Hoffmann
  1 sibling, 2 replies; 19+ messages in thread
From: Alon Levy @ 2012-08-09 14:21 UTC (permalink / raw)
  To: qemu-devel, kraxel

Revision bumped to 4 for new IO support, enabled for spice-server >=
0.11.1. New io enabled iff spice-server >= 0.11.1 && spice-protocol >=
0.12.0.

On migration reissue spice_qxl_monitors_config_async.

RHBZ: 770842

Signed-off-by: Alon Levy <alevy@redhat.com>
---
 configure          |  3 +++
 hw/qxl.c           | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
 hw/qxl.h           |  7 +++++++
 trace-events       |  1 +
 ui/spice-display.h |  1 +
 5 files changed, 69 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 280726c..913077f 100755
--- a/configure
+++ b/configure
@@ -2638,6 +2638,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
+        QEMU_CFLAGS="$QEMU_CFLAGS -DQXL_HAS_IO_MONITORS_CONFIG_ASYNC"
+    fi
   else
     if test "$spice" = "yes" ; then
       feature_not_found "spice"
diff --git a/hw/qxl.c b/hw/qxl.c
index 3a883ce..84d1101 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -249,6 +249,21 @@ static void qxl_spice_destroy_surfaces(PCIQXLDevice *qxl, qxl_async_io async)
     }
 }
 
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+#ifdef QXL_HAS_IO_MONITORS_CONFIG_ASYNC
+static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl)
+{
+    trace_qxl_spice_monitors_config(qxl->id);
+    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));
+}
+#endif
+#endif
+
 void qxl_spice_reset_image_cache(PCIQXLDevice *qxl)
 {
     trace_qxl_spice_reset_image_cache(qxl->id);
@@ -538,6 +553,9 @@ 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",
+#ifdef QXL_HAS_IO_MONITORS_CONFIG_ASYNC
+        [QXL_IO_MONITORS_CONFIG_ASYNC]  = "QXL_IO_MONITORS_CONFIG_ASYNC",
+#endif
     };
     return io_port_to_string[io_port];
 }
@@ -819,7 +837,10 @@ 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:
+#ifdef QXL_HAS_IO_MONITORS_CONFIG_ASYNC
+    case QXL_IO_MONITORS_CONFIG_ASYNC:
         break;
+#endif
     case QXL_IO_CREATE_PRIMARY_ASYNC:
         qxl_create_guest_primary_complete(qxl);
         break;
@@ -894,6 +915,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);
@@ -1333,7 +1356,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;
@@ -1361,6 +1384,11 @@ 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:
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+#ifdef QXL_HAS_IO_MONITORS_CONFIG_ASYNC
+    case QXL_IO_MONITORS_CONFIG_ASYNC:
+#endif
+#endif
 async_common:
         async = QXL_ASYNC;
         qemu_mutex_lock(&d->async_lock);
@@ -1490,6 +1518,13 @@ async_common:
         d->mode = QXL_MODE_UNDEFINED;
         qxl_spice_destroy_surfaces(d, async);
         break;
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+#ifdef QXL_HAS_IO_MONITORS_CONFIG_ASYNC
+    case QXL_IO_MONITORS_CONFIG_ASYNC:
+        qxl_spice_monitors_config_async(d);
+        break;
+#endif
+#endif
     default:
         qxl_set_guest_bug(d, "%s: unexpected ioport=0x%x\n", __func__, io_port);
     }
@@ -1785,9 +1820,15 @@ static int qxl_init_common(PCIQXLDevice *qxl)
         io_size = 16;
         break;
     case 3: /* qxl-3 */
+        pci_device_rev = QXL_REVISION_STABLE_V10;
+        io_size = 32; /* PCI region size must be pow2 */
+        break;
+#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
+    case 4: /* qxl-4 */
         pci_device_rev = QXL_DEFAULT_REVISION;
         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);
@@ -1986,7 +2027,20 @@ static int qxl_post_load(void *opaque, int version)
         }
         qxl_spice_loadvm_commands(d, cmds, out);
         g_free(cmds);
-
+        if (d->guest_monitors_config) {
+            /*
+             * 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(&d->ssd.qxl,
+                    d->guest_monitors_config,
+                    MEMSLOT_GROUP_GUEST,
+                    (uintptr_t)qxl_cookie_new(
+                        QXL_COOKIE_TYPE_POST_LOAD_MONITORS_CONFIG,
+                        0));
+        }
         break;
     case QXL_MODE_COMPAT:
         /* note: no need to call qxl_create_memslots, qxl_set_mode
@@ -2053,6 +2107,7 @@ static VMStateDescription qxl_vmstate = {
         VMSTATE_ARRAY(guest_surfaces.cmds, PCIQXLDevice, NUM_SURFACES, 0,
                       vmstate_info_uint64, uint64_t),
         VMSTATE_UINT64(guest_cursor, PCIQXLDevice),
+        VMSTATE_UINT64(guest_monitors_config, PCIQXLDevice),
         VMSTATE_END_OF_LIST()
     },
 };
diff --git a/hw/qxl.h b/hw/qxl.h
index 172baf6..8139e28 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 SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */ \
+    && defined(QXL_HAS_IO_MONITORS_CONFIG_ASYNC)
+#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 6b12f83..fa1141c 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 12e50b6..7fa095f 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.11.2

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

* [Qemu-devel] [PATCH v4 2/2] configure: print spice-protocol and spice-server versions
  2012-08-09 14:21                     ` [Qemu-devel] [PATCH v4 1/2] " Alon Levy
@ 2012-08-09 14:21                       ` Alon Levy
  2012-08-15  8:23                       ` [Qemu-devel] [PATCH v4 1/2] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC Gerd Hoffmann
  1 sibling, 0 replies; 19+ messages in thread
From: Alon Levy @ 2012-08-09 14:21 UTC (permalink / raw)
  To: qemu-devel, kraxel

Signed-off-by: Alon Levy <alevy@redhat.com>
---
 configure | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 913077f..2c8399a 100755
--- a/configure
+++ b/configure
@@ -2638,6 +2638,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
         QEMU_CFLAGS="$QEMU_CFLAGS -DQXL_HAS_IO_MONITORS_CONFIG_ASYNC"
     fi
@@ -3096,7 +3098,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.11.2

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

* Re: [Qemu-devel] [PATCH v4 1/2] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-08-09 14:21                     ` [Qemu-devel] [PATCH v4 1/2] " Alon Levy
  2012-08-09 14:21                       ` [Qemu-devel] [PATCH v4 2/2] configure: print spice-protocol and spice-server versions Alon Levy
@ 2012-08-15  8:23                       ` Gerd Hoffmann
  2012-08-15 10:32                         ` Alon Levy
  1 sibling, 1 reply; 19+ messages in thread
From: Gerd Hoffmann @ 2012-08-15  8:23 UTC (permalink / raw)
  To: Alon Levy; +Cc: qemu-devel

On 08/09/12 16:21, Alon Levy wrote:
> Revision bumped to 4 for new IO support, enabled for spice-server >=
> 0.11.1. New io enabled iff spice-server >= 0.11.1 && spice-protocol >=
> 0.12.0.

Patch doesn't apply cleanly to master.

> +    if $pkg_config --atleast-version=0.12.0 spice-protocol >/dev/null 2>&1; then
> +        QEMU_CFLAGS="$QEMU_CFLAGS -DQXL_HAS_IO_MONITORS_CONFIG_ASYNC"
> +    fi

/me thinks now with spice-server having no dependency any more on
spice-protocol we should add a #define SPICE_PROTOCOL_VERSION to
spice-protocol so we don't need constructs like this.

Or maybe just use

#ifndef QXL_HAS_IO_MONITORS_CONFIG_ASYNC
#define QXL_HAS_IO_MONITORS_CONFIG_ASYNC $whatever
#endif

?

> +#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
> +#ifdef QXL_HAS_IO_MONITORS_CONFIG_ASYNC

Can be on a single line:

#if (SPICE_SERVER_VERSION >= 0x000b01) &&
defined(QXL_HAS_IO_MONITORS_CONFIG_ASYNC)

Or:

#if (SPICE_SERVER_VERSION >= 0x000b01) && (SPICE_PROTOCOL_VERSION >= ...)

cheers,
  Gerd

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

* Re: [Qemu-devel] [PATCH v4 1/2] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-08-15  8:23                       ` [Qemu-devel] [PATCH v4 1/2] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC Gerd Hoffmann
@ 2012-08-15 10:32                         ` Alon Levy
  2012-08-15 10:43                           ` Gerd Hoffmann
  0 siblings, 1 reply; 19+ messages in thread
From: Alon Levy @ 2012-08-15 10:32 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

On Wed, Aug 15, 2012 at 10:23:23AM +0200, Gerd Hoffmann wrote:
> On 08/09/12 16:21, Alon Levy wrote:
> > Revision bumped to 4 for new IO support, enabled for spice-server >=
> > 0.11.1. New io enabled iff spice-server >= 0.11.1 && spice-protocol >=
> > 0.12.0.
> 
> Patch doesn't apply cleanly to master.

Strange, will resend.

> 
> > +    if $pkg_config --atleast-version=0.12.0 spice-protocol >/dev/null 2>&1; then
> > +        QEMU_CFLAGS="$QEMU_CFLAGS -DQXL_HAS_IO_MONITORS_CONFIG_ASYNC"
> > +    fi
> 
> /me thinks now with spice-server having no dependency any more on
> spice-protocol we should add a #define SPICE_PROTOCOL_VERSION to
> spice-protocol so we don't need constructs like this.

So yet another place to remember to update the version number. But I
agree it's cleaner.

> 
> Or maybe just use
> 
> #ifndef QXL_HAS_IO_MONITORS_CONFIG_ASYNC
> #define QXL_HAS_IO_MONITORS_CONFIG_ASYNC $whatever
> #endif

I don't get this. You mean to have add
#define QXL_HAS_IO_MONITORS_CONFIG_ASYNC bla
to spice-protocol?

> 
> ?
> 
> > +#if SPICE_SERVER_VERSION >= 0x000b01 /* 0.11.1 */
> > +#ifdef QXL_HAS_IO_MONITORS_CONFIG_ASYNC
> 
> Can be on a single line:
> 
> #if (SPICE_SERVER_VERSION >= 0x000b01) &&
> defined(QXL_HAS_IO_MONITORS_CONFIG_ASYNC)
> 
> Or:
> 
> #if (SPICE_SERVER_VERSION >= 0x000b01) && (SPICE_PROTOCOL_VERSION >= ...)
> 

Correct, the point was to make sure when I later removed only a part of
it it would show up as a single line removal. But sure, if you prefer it
this way.

> cheers,
>   Gerd
> 

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

* Re: [Qemu-devel] [PATCH v4 1/2] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC
  2012-08-15 10:32                         ` Alon Levy
@ 2012-08-15 10:43                           ` Gerd Hoffmann
  0 siblings, 0 replies; 19+ messages in thread
From: Gerd Hoffmann @ 2012-08-15 10:43 UTC (permalink / raw)
  To: Alon Levy; +Cc: qemu-devel

  Hi,

>> Or maybe just use
>>
>> #ifndef QXL_HAS_IO_MONITORS_CONFIG_ASYNC
>> #define QXL_HAS_IO_MONITORS_CONFIG_ASYNC $whatever
>> #endif
> 
> I don't get this. You mean to have add
> #define QXL_HAS_IO_MONITORS_CONFIG_ASYNC bla
> to spice-protocol?

No, to qemu, so QXL_HAS_IO_MONITORS_CONFIG_ASYNC is available no matter
what version spice-protocol is.

cheers,
  Gerd

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

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

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-23 13:08 [Qemu-devel] [PATCH 1/2] qxl: disallow unknown revisions Alon Levy
2012-07-23 13:08 ` [Qemu-devel] [PATCH 2/2] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC Alon Levy
2012-07-23 16:33   ` [Qemu-devel] [PATCH v2] " Alon Levy
2012-07-25  9:00     ` Yonit Halperin
2012-07-25 17:29       ` Alon Levy
2012-07-26  5:26         ` Yonit Halperin
2012-07-28  8:56         ` Alon Levy
2012-07-28  9:01           ` Blue Swirl
2012-07-28 10:20             ` Alon Levy
2012-07-28 10:23             ` [Qemu-devel] [PATCH v3] " Alon Levy
2012-08-06  7:31               ` Gerd Hoffmann
2012-08-09 13:41                 ` Alon Levy
2012-08-09 13:50                   ` Gerd Hoffmann
2012-08-09 14:18                     ` Alon Levy
2012-08-09 14:21                     ` [Qemu-devel] [PATCH v4 1/2] " Alon Levy
2012-08-09 14:21                       ` [Qemu-devel] [PATCH v4 2/2] configure: print spice-protocol and spice-server versions Alon Levy
2012-08-15  8:23                       ` [Qemu-devel] [PATCH v4 1/2] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC Gerd Hoffmann
2012-08-15 10:32                         ` Alon Levy
2012-08-15 10:43                           ` Gerd Hoffmann

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.