]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Escape commas for qemuBuildDiskThrottling
authorAnya Harter <aharter@redhat.com>
Tue, 19 Jun 2018 16:20:18 +0000 (12:20 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 21 Jun 2018 21:49:15 +0000 (17:49 -0400)
Add comma escaping for disk->blkdeviotune.group_name.

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 1ffcb5b1ae770ee65a108f60ea176f44c2b7f651..446df3e1d89d88f32d6cb849e468ee5371fbf7bf 100644 (file)
@@ -1554,8 +1554,8 @@ qemuBuildDiskThrottling(virDomainDiskDefPtr disk,
 
     IOTUNE_ADD(size_iops_sec, "iops-size");
     if (disk->blkdeviotune.group_name) {
-        virBufferEscapeString(buf, ",throttling.group=%s",
-                              disk->blkdeviotune.group_name);
+        virBufferAddLit(buf, ",throttling.group=");
+        virQEMUBuildBufferEscapeComma(buf, disk->blkdeviotune.group_name);
     }
 
     IOTUNE_ADD(total_bytes_sec_max_length, "bps-total-max-length");
index 72ed2e841057d4a17b019d684a2cd007b4f9fd25..aef7c238ca6a35a929b6a3da7e26e217031606bb 100644 (file)
@@ -24,6 +24,11 @@ bar=2/monitor.sock,server,nowait \
 -boot c \
 -device usb-ccid,id=ccid0,bus=usb.0,port=1 \
 -usb \
+-drive file=/dev/HostVG/QEMUGuest1,format=qcow2,if=none,id=drive-ide0-0-0,\
+cache=none,throttling.bps-total=5000,throttling.iops-total=6000,\
+throttling.bps-total-max=10000,throttling.iops-total-max=11000,\
+throttling.group=libvirt_iotune_group1,,foo \
+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
 -device ccid-card-emulated,backend=certificates,cert1=cert1,,foo,cert2=cert2,\
 cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \
 -chardev tty,id=charserial0,path=/dev/ttyS2,,foo \
index 0580de18130a8a99ff5011d82f682da3e230e944..70a1ce09d301545bbcdf3f78f79b88b066bbbb83 100644 (file)
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-i686</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='qcow2' cache='none'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <iotune>
+        <total_bytes_sec>5000</total_bytes_sec>
+        <total_iops_sec>6000</total_iops_sec>
+        <total_bytes_sec_max>10000</total_bytes_sec_max>
+        <total_iops_sec_max>11000</total_iops_sec_max>
+        <group_name>libvirt_iotune_group1,foo</group_name>
+      </iotune>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
     <graphics type='vnc'>
       <listen type='socket'/>
     </graphics>
index a9a493e308dbebda5a1328ab5616941191720f83..582a9de7bb646c0edb5d361689b030cd5297d798 100644 (file)
@@ -2758,6 +2758,8 @@ mymain(void)
     DO_TEST("name-escape",
             QEMU_CAPS_NAME_DEBUG_THREADS,
             QEMU_CAPS_OBJECT_SECRET,
+            QEMU_CAPS_DRIVE_IOTUNE_MAX,
+            QEMU_CAPS_DRIVE_IOTUNE_GROUP,
             QEMU_CAPS_VNC,
             QEMU_CAPS_NAME_GUEST,
             QEMU_CAPS_DEVICE_CIRRUS_VGA,