[libvirt] [PATCH 5/6] qemu: Add the group name option to the iotune command line

Martin Kletzander mkletzan at redhat.com
Wed Nov 2 14:39:53 UTC 2016


On Mon, Oct 31, 2016 at 05:23:01PM -0400, John Ferlan wrote:
>Add in the block I/O throttling group parameter to the command line
>if supported. If not supported, fail command creation.
>
>Add the xml2argvtest for testing.
>
>Signed-off-by: John Ferlan <jferlan at redhat.com>
>---
> src/qemu/qemu_command.c                            | 13 +++++++++
> .../qemuxml2argv-blkdeviotune-group-num.args       | 32 ++++++++++++++++++++++
> tests/qemuxml2argvtest.c                           |  4 +++
> 3 files changed, 49 insertions(+)
> create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-group-num.args
>
>diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
>index b68da3d..cf1512a 100644
>--- a/src/qemu/qemu_command.c
>+++ b/src/qemu/qemu_command.c
>@@ -1827,6 +1836,10 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk,
>     IOTUNE_ADD(write_iops_sec_max, "iops-write-max");
>
>     IOTUNE_ADD(size_iops_sec, "iops-size");
>+    if (disk->blkdeviotune.group_name) {
>+        virBufferAsprintf(&opt, ",throttling.group=%s",
>+                          disk->blkdeviotune.group_name);

And you need to escape it for the command-line here just in case it has
a comma in it for example.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20161102/8a52a87d/attachment-0001.sig>


More information about the libvir-list mailing list