]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Only set group_name when actually requested
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 24 Jan 2017 14:50:00 +0000 (15:50 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Sun, 29 Jan 2017 18:46:51 +0000 (19:46 +0100)
We were setting it based on whether it was supported and that lead to
setting it to NULL, which our JSON code caught.  However it ended up
producing the following results:

 $ virsh blkdeviotune fedora vda --total-bytes-sec-max 2000
 error: Unable to change block I/O throttle
 error: internal error: argument key 'group' must not have null value

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_driver.c
src/qemu/qemu_monitor_json.c

index 516a851d3d55b1a55769ac510bb44486a42290d2..f45972e3c82300af3d66f4f0e84b411f2ad634b8 100644 (file)
@@ -17506,7 +17506,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
         qemuDomainObjEnterMonitor(driver, vm);
         ret = qemuMonitorSetBlockIoThrottle(priv->mon, device,
                                             &info, supportMaxOptions,
-                                            supportGroupNameOption,
+                                            set_fields & QEMU_BLOCK_IOTUNE_SET_GROUP_NAME,
                                             supportMaxLengthOptions);
         if (qemuDomainObjExitMonitor(driver, vm) < 0)
             ret = -1;
index 6c38ad7e38ce1b4adae524113bca885b6f737d47..e30b72cd401c984011d7e7b5f6392e8c6ad68af0 100644 (file)
@@ -4607,7 +4607,7 @@ int qemuMonitorJSONSetBlockIoThrottle(qemuMonitorPtr mon,
 
     if (supportGroupNameOption &&
         virJSONValueObjectAdd(args,
-                              "s:group", info->group_name,
+                              "S:group", info->group_name,
                               NULL) < 0)
         goto cleanup;