mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
qemuDomainSetBlockIoTuneField: Move setting of 'group_name' out of the loop
The refactor will simplify further change which will introduce another source for the group name. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
1 parent
abcdc9511b
commit
fa06437566
1 file changed
+12
-8
+12
-8
@@ -15182,6 +15182,7 @@ qemuDomainSetBlockIoTuneFields(virDomainBlockIoTuneInfo *info,
|
||||
int *eventNparams,
|
||||
int *eventMaxparams)
|
||||
{
|
||||
const char *param_group_name = NULL;
|
||||
size_t i;
|
||||
|
||||
#define SET_IOTUNE_FIELD(FIELD, BOOL, CONST) \
|
||||
@@ -15227,15 +15228,8 @@ qemuDomainSetBlockIoTuneFields(virDomainBlockIoTuneInfo *info,
|
||||
WRITE_IOPS_SEC_MAX);
|
||||
SET_IOTUNE_FIELD(size_iops_sec, SIZE_IOPS, SIZE_IOPS_SEC);
|
||||
|
||||
/* NB: Cannot use macro since this is a value.s not a value.ul */
|
||||
if (STREQ(param->field, VIR_DOMAIN_BLOCK_IOTUNE_GROUP_NAME)) {
|
||||
info->group_name = g_strdup(param->value.s);
|
||||
*set_fields |= QEMU_BLOCK_IOTUNE_SET_GROUP_NAME;
|
||||
if (virTypedParamsAddString(eventParams, eventNparams,
|
||||
eventMaxparams,
|
||||
VIR_DOMAIN_TUNABLE_BLKDEV_GROUP_NAME,
|
||||
param->value.s) < 0)
|
||||
return -1;
|
||||
param_group_name = param->value.s;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -15253,6 +15247,16 @@ qemuDomainSetBlockIoTuneFields(virDomainBlockIoTuneInfo *info,
|
||||
WRITE_IOPS_SEC_MAX_LENGTH);
|
||||
}
|
||||
|
||||
if (param_group_name) {
|
||||
info->group_name = g_strdup(param_group_name);
|
||||
*set_fields |= QEMU_BLOCK_IOTUNE_SET_GROUP_NAME;
|
||||
if (virTypedParamsAddString(eventParams, eventNparams,
|
||||
eventMaxparams,
|
||||
VIR_DOMAIN_TUNABLE_BLKDEV_GROUP_NAME,
|
||||
param_group_name) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#undef SET_IOTUNE_FIELD
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user