mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +00:00
conf: Add virDomainDiskSetBlockIOTune
That function sets disk->blkdeviotune sensibly. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
8336cbca21
commit
eae7cfd42d
@ -25845,3 +25845,30 @@ virDomainDefVcpuOrderClear(virDomainDefPtr def)
|
||||
for (i = 0; i < def->maxvcpus; i++)
|
||||
def->vcpus[i]->order = 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* virDomainDiskSetBlockIOTune:
|
||||
* @disk: The disk to set block I/O tuning on
|
||||
* @info: The BlockIoTuneInfo to be set on the @disk
|
||||
*
|
||||
* Set the block I/O tune settings from @info on the @disk, but error out early
|
||||
* in case of any error. That is to make sure nothing will fail half-way.
|
||||
*
|
||||
* Returns: 0 on success, -1 otherwise
|
||||
*/
|
||||
int
|
||||
virDomainDiskSetBlockIOTune(virDomainDiskDefPtr disk,
|
||||
virDomainBlockIoTuneInfo *info)
|
||||
{
|
||||
char *tmp_group = NULL;
|
||||
|
||||
if (VIR_STRDUP(tmp_group, info->group_name) < 0)
|
||||
return -1;
|
||||
|
||||
VIR_FREE(disk->blkdeviotune.group_name);
|
||||
disk->blkdeviotune = *info;
|
||||
VIR_STEAL_PTR(disk->blkdeviotune.group_name, tmp_group);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -3219,4 +3219,8 @@ bool
|
||||
virDomainDeviceInfoAddressIsEqual(const virDomainDeviceInfo *a,
|
||||
const virDomainDeviceInfo *b)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
|
||||
|
||||
int virDomainDiskSetBlockIOTune(virDomainDiskDefPtr disk,
|
||||
virDomainBlockIoTuneInfo *info);
|
||||
|
||||
#endif /* __DOMAIN_CONF_H */
|
||||
|
@ -314,6 +314,7 @@ virDomainDiskMirrorStateTypeToString;
|
||||
virDomainDiskPathByName;
|
||||
virDomainDiskRemove;
|
||||
virDomainDiskRemoveByName;
|
||||
virDomainDiskSetBlockIOTune;
|
||||
virDomainDiskSetDriver;
|
||||
virDomainDiskSetFormat;
|
||||
virDomainDiskSetSource;
|
||||
|
Loading…
Reference in New Issue
Block a user