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

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



QEMU_CAPS_VNC_DISPLAY_POLICY (qemu >= v1.10)
---
 docs/formatdomain.html.in     | 13 +++++++++++--
 docs/schemas/domaincommon.rng |  9 +++++++++
 src/qemu/qemu_capabilities.c  | 12 ++++++++----
 src/qemu/qemu_capabilities.h  |  1 +
 tests/qemuhelptest.c          |  9 ++++++---
 5 files changed, 35 insertions(+), 9 deletions(-)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 572d7ee..50aa2db 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -3493,7 +3493,7 @@ qemu-kvm -net nic,model=? /dev/null
   ...
   <devices>
     <graphics type='sdl' display=':0.0'/>
-    <graphics type='vnc' port='5904'>
+    <graphics type='vnc' port='5904' policy='allow-exclusive'>
       <listen type='address' address='1.2.3.4'/>
     </graphics>
     <graphics type='rdp' autoport='yes' multiUser='yes' />
@@ -3536,7 +3536,16 @@ qemu-kvm -net nic,model=? /dev/null
             allows control of connected client during password changes.
             VNC accepts <code>keep</code> value only.
             <span class="since">since 0.9.3</span>
-            NB, this may not be supported by all hypervisors.<br/>  <br/>
+            NB, this may not be supported by all hypervisors.<br/>
+            The optional <code>policy</code> attribute specifies vnc server
+            display sharing policy. "allow-exclusive" allows clients to ask
+            for exclusive access by dropping other connections. Connecting
+            multiple clients in parallel requires all clients asking for a
+            shared session (vncviewer: -Shared switch). This is the default
+            value. "force-shared" disables exclusive client access, every
+            connection has to specify -Shared switch for vncviewer. "ignore"
+            welcomes every connection unconditionally
+            <span class="since">since 1.0.6</span>. <br/> <br/>
             Rather than using listen/port, QEMU supports a
             <code>socket</code> attribute for listening on a unix
             domain socket path.<span class="since">Since 0.8.8</span>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 10596dc..c3a7fbd 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2075,6 +2075,15 @@
                   <ref name="addrIPorName"/>
                 </attribute>
               </optional>
+              <optional>
+                <attribute name='policy'>
+                  <choice>
+                    <value>allow-exclusive</value>
+                    <value>force-shared</value>
+                    <value>ignore</value>
+                  </choice>
+                </attribute>
+              </optional>
             </group>
             <group>
               <optional>
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index a3a8d1f..d758691 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -221,9 +221,10 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
               "tpm-tis",
 
               "nvram",  /* 140 */
-              "pci-bridge", /* 141 */
-              "vfio-pci", /* 142 */
-              "vfio-pci.bootindex", /* 143 */
+              "pci-bridge",
+              "vfio-pci",
+              "vfio-pci.bootindex",
+              "vnc-display-policy",
     );
 
 struct _virQEMUCaps {
@@ -1181,8 +1182,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_DISPLAY_POLICY);
+    }
 
     if (version >= 1002000)
         virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
@@ -2383,6 +2386,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_DISPLAY_POLICY);
 }
 
 
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 213f63c..ec39325 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -182,6 +182,7 @@ enum virQEMUCapsFlags {
     QEMU_CAPS_DEVICE_PCI_BRIDGE  = 141, /* -device pci-bridge */
     QEMU_CAPS_DEVICE_VFIO_PCI    = 142, /* -device vfio-pci */
     QEMU_CAPS_VFIO_PCI_BOOTINDEX = 143, /* bootindex param for vfio-pci device */
+    QEMU_CAPS_VNC_DISPLAY_POLICY = 144, /* 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 fa56406..9894222 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -822,7 +822,8 @@ mymain(void)
             QEMU_CAPS_DEVICE_USB_NET,
             QEMU_CAPS_DTB,
             QEMU_CAPS_IPV6_MIGRATION,
-            QEMU_CAPS_DEVICE_PCI_BRIDGE);
+            QEMU_CAPS_DEVICE_PCI_BRIDGE,
+            QEMU_CAPS_VNC_DISPLAY_POLICY);
     DO_TEST("qemu-1.2.0", 1002000, 0, 0,
             QEMU_CAPS_VNC_COLON,
             QEMU_CAPS_NO_REBOOT,
@@ -926,7 +927,8 @@ mymain(void)
             QEMU_CAPS_DTB,
             QEMU_CAPS_SCSI_MEGASAS,
             QEMU_CAPS_IPV6_MIGRATION,
-            QEMU_CAPS_DEVICE_PCI_BRIDGE);
+            QEMU_CAPS_DEVICE_PCI_BRIDGE,
+            QEMU_CAPS_VNC_DISPLAY_POLICY);
     DO_TEST("qemu-kvm-1.2.0", 1002000, 1, 0,
             QEMU_CAPS_VNC_COLON,
             QEMU_CAPS_NO_REBOOT,
@@ -1035,7 +1037,8 @@ mymain(void)
             QEMU_CAPS_DTB,
             QEMU_CAPS_SCSI_MEGASAS,
             QEMU_CAPS_IPV6_MIGRATION,
-            QEMU_CAPS_DEVICE_PCI_BRIDGE);
+            QEMU_CAPS_DEVICE_PCI_BRIDGE,
+            QEMU_CAPS_VNC_DISPLAY_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]