]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Escape commas for qemuBuildGrapicsSPICECommandLine
authorAnya Harter <aharter@redhat.com>
Mon, 18 Jun 2018 17:57:26 +0000 (13:57 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 18 Jun 2018 23:39:13 +0000 (19:39 -0400)
Add comma escaping for cfg->spiceTLSx509certdir and
graphics->data.spice.rendernode.

Signed-off-by: Anya Harter <aharter@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/name-escape.args
tests/qemuxml2argvdata/name-escape.xml
tests/qemuxml2argvtest.c

index a9a5e200e98e0f6395ef98d2abcd09e896e1e879..20c6ac2a04db6485e67e3b4738d948ac28b579dd 100644 (file)
@@ -7974,8 +7974,11 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
         !cfg->spicePassword)
         virBufferAddLit(&opt, "disable-ticketing,");
 
-    if (hasSecure)
-        virBufferAsprintf(&opt, "x509-dir=%s,", cfg->spiceTLSx509certdir);
+    if (hasSecure) {
+        virBufferAddLit(&opt, "x509-dir=");
+        virQEMUBuildBufferEscapeComma(&opt, cfg->spiceTLSx509certdir);
+        virBufferAddLit(&opt, ",");
+    }
 
     switch (graphics->data.spice.defaultMode) {
     case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE:
@@ -8082,7 +8085,9 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
                 goto error;
             }
 
-            virBufferAsprintf(&opt, "rendernode=%s,", graphics->data.spice.rendernode);
+            virBufferAddLit(&opt, "rendernode=");
+            virQEMUBuildBufferEscapeComma(&opt, graphics->data.spice.rendernode);
+            virBufferAddLit(&opt, ",");
         }
     }
 
index d3b908a7e68484b9ae7af262c2aebfa2cc38d5dd..72ed2e841057d4a17b019d684a2cd007b4f9fd25 100644 (file)
@@ -33,6 +33,7 @@ cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \
 -chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \
 -netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=user-channel0 \
 -vnc unix:/tmp/lib/domain--1-foo=1,,bar=2/vnc.sock \
--spice unix,addr=/tmp/lib/domain--1-foo=1,,bar=2/spice.sock \
--vga cirrus \
+-spice unix,addr=/tmp/lib/domain--1-foo=1,,bar=2/spice.sock,gl=on,\
+rendernode=/dev/dri/foo,,bar \
+-device cirrus-vga,id=video0,bus=pci.0,addr=0x2 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
index 9ca7be596806a5a210d6a251fb76a25880151a89..0580de18130a8a99ff5011d82f682da3e230e944 100644 (file)
@@ -19,6 +19,7 @@
     </graphics>
     <graphics type='spice'>
       <listen type='socket'/>
+      <gl enable='yes' rendernode='/dev/dri/foo,bar'/>
     </graphics>
     <serial type='dev'>
       <source path='/dev/ttyS2,foo'/>
index b4b98152e66988a16c87354cbf626ca1fc247acd..a9a493e308dbebda5a1328ab5616941191720f83 100644 (file)
@@ -2763,6 +2763,11 @@ mymain(void)
             QEMU_CAPS_DEVICE_CIRRUS_VGA,
             QEMU_CAPS_SPICE,
             QEMU_CAPS_SPICE_UNIX,
+            QEMU_CAPS_DEVICE_VIRTIO_GPU,
+            QEMU_CAPS_VIRTIO_GPU_VIRGL,
+            QEMU_CAPS_SPICE_GL,
+            QEMU_CAPS_SPICE_RENDERNODE,
+            QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
             QEMU_CAPS_DEVICE_ISA_SERIAL,
             QEMU_CAPS_CHARDEV_FILE_APPEND,
             QEMU_CAPS_CCID_EMULATED);