From: Martin Kletzander Date: Tue, 24 Jan 2017 14:50:00 +0000 (+0100) Subject: qemu: Only set group_name when actually requested X-Git-Tag: CVE-2017-2635~224 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9d75343d4cf552575a3b305fa00a36ee71e9309;p=thirdparty%2Flibvirt.git qemu: Only set group_name when actually requested 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 --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 516a851d3d..f45972e3c8 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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; diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 6c38ad7e38..e30b72cd40 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -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;