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 <mkletzan@redhat.com>
This commit is contained in:
Martin Kletzander 2017-01-24 15:50:00 +01:00
parent bfc32e5895
commit e9d75343d4
2 changed files with 2 additions and 2 deletions

View 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;

View 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;