[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 1/3 v3] qemu: new vnc display sharing policy caps flag



QEMU_CAPS_VNC_SHARE_POLICY (qemu >= 1.1)
---
 src/qemu/qemu_capabilities.c | 6 +++++-
 src/qemu/qemu_capabilities.h | 1 +
 tests/qemuhelptest.c         | 9 ++++++---
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 488cbfe..c6face3 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -230,6 +230,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
               "mem-merge",
               "vnc-websocket",
               "drive-discard",
+              "vnc-share-policy",
     );
 
 struct _virQEMUCaps {
@@ -1187,8 +1188,10 @@ virQEMUCapsComputeCmdFlags(const char *help,
     if (version >= 11000)
         virQEMUCapsSet(qemuCaps, QEMU_CAPS_CPU_HOST);
 
-    if (version >= 1001000)
+    if (version >= 1001000) {
         virQEMUCapsSet(qemuCaps, QEMU_CAPS_IPV6_MIGRATION);
+        virQEMUCapsSet(qemuCaps, QEMU_CAPS_VNC_SHARE_POLICY);
+    }
 
     if (version >= 1002000)
         virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
@@ -2431,6 +2434,7 @@ virQEMUCapsInitQMPBasic(virQEMUCapsPtr qemuCaps)
     virQEMUCapsSet(qemuCaps, QEMU_CAPS_IPV6_MIGRATION);
     virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_OPT);
     virQEMUCapsSet(qemuCaps, QEMU_CAPS_DUMP_GUEST_CORE);
+    virQEMUCapsSet(qemuCaps, QEMU_CAPS_VNC_SHARE_POLICY);
 }
 
 /* Capabilities that are architecture depending
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 173ca77..772d905 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -187,6 +187,7 @@ enum virQEMUCapsFlags {
     QEMU_CAPS_MEM_MERGE          = 146, /* -machine mem-merge */
     QEMU_CAPS_VNC_WEBSOCKET      = 147, /* -vnc x:y,websocket */
     QEMU_CAPS_DRIVE_DISCARD      = 148, /* -drive discard=off(ignore)|on(unmap) */
+    QEMU_CAPS_VNC_SHARE_POLICY   = 149, /* set display sharing policy */
 
     QEMU_CAPS_LAST,                   /* this must always be the last item */
 };
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index f7f88d0..f6bf7dd 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -827,7 +827,8 @@ mymain(void)
             QEMU_CAPS_IPV6_MIGRATION,
             QEMU_CAPS_DEVICE_PCI_BRIDGE,
             QEMU_CAPS_DEVICE_SCSI_GENERIC,
-            QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX);
+            QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX,
+            QEMU_CAPS_VNC_SHARE_POLICY);
     DO_TEST("qemu-1.2.0", 1002000, 0, 0,
             QEMU_CAPS_VNC_COLON,
             QEMU_CAPS_NO_REBOOT,
@@ -933,7 +934,8 @@ mymain(void)
             QEMU_CAPS_IPV6_MIGRATION,
             QEMU_CAPS_DEVICE_PCI_BRIDGE,
             QEMU_CAPS_DEVICE_SCSI_GENERIC,
-            QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX);
+            QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX,
+            QEMU_CAPS_VNC_SHARE_POLICY);
     DO_TEST("qemu-kvm-1.2.0", 1002000, 1, 0,
             QEMU_CAPS_VNC_COLON,
             QEMU_CAPS_NO_REBOOT,
@@ -1044,7 +1046,8 @@ mymain(void)
             QEMU_CAPS_IPV6_MIGRATION,
             QEMU_CAPS_DEVICE_PCI_BRIDGE,
             QEMU_CAPS_DEVICE_SCSI_GENERIC,
-            QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX);
+            QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX,
+            QEMU_CAPS_VNC_SHARE_POLICY);
 
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
 }
-- 
1.8.1.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]