[libvirt] [PATCH 0/2] Support for Block Device IO Limits

Depending on the hypervisor (e.g. QEMU) it is possible to override certain properties of a block device. In Linux these are called IO limits and can be observed in the guest's sysfs under /sys/block/<dev>/queue. This patch set enables libvirt to override the logical and physical block size for QEMU guests. I wasn't expecting the 0.10.1 release *that* early, so I have added the since 0.10.1 in formatdomain.html.in :-) calling for a v2 patch. Still I wanted to collect review feedback. Viktor Mihajlovski (2): conf: Support for Block Device IO Limits qemu: Support for Block Device IO Limits. docs/formatdomain.html.in | 18 +++++++ docs/schemas/domaincommon.rng | 17 +++++++ src/conf/domain_conf.c | 49 ++++++++++++++++++++ src/conf/domain_conf.h | 5 ++ src/qemu/qemu_capabilities.c | 11 ++++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 8 +++ tests/qemuhelptest.c | 12 +++-- .../qemuxml2argv-disk-iolimits.args | 9 ++++ .../qemuxml2argv-disk-iolimits.xml | 33 +++++++++++++ tests/qemuxml2argvtest.c | 3 + 11 files changed, 162 insertions(+), 4 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.xml

Introducing a new iolimits element allowing to override certain properties of a guest block device like the physical and logical block size. This can be useful for platforms with 'non-standard' disk formats like S390 DASD with its 4K block size. Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> --- docs/formatdomain.html.in | 18 +++++++++++++++ docs/schemas/domaincommon.rng | 17 ++++++++++++++ src/conf/domain_conf.c | 49 +++++++++++++++++++++++++++++++++++++++++ src/conf/domain_conf.h | 5 ++++ 4 files changed, 89 insertions(+), 0 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index be8489a..db77cc4 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1264,6 +1264,7 @@ <driver name='qemu' type='raw'/> <source dev='/dev/sda'/> <geometry cyls='16383' heads='16' secs='63' trans='lba'/> + <iolimits logical_block_size='512' physical_block_size='4096'/> <target dev='hda' bus='ide'/> </disk> </devices> @@ -1632,6 +1633,23 @@ BIOS-Translation-Modus (none, lba or auto)</dd> </dl> </dd> + <dt><code>iolimits</code></dt> + <dd>If present, the <code>iolimits</code> element allows + to override any of the block device properties listed below. + <span class="since">Since 0.10.1 (QEMU and KVM)</span> + <dl> + <dt><code>logical_block_size</code></dt> + <dd>The logical block size the disk will report to the guest + OS. For Linux this would be the value returned by the + BLKSSZGET ioctl and describes the smallest units for disk + I/O. + <dt><code>physical_block_size</code></dt> + <dd>The physical block size the disk will report to the guest + OS. For Linux this would be the value returned by the + BLKPBSZGET ioctl and describes the disk's hardware sector + size which can be relevant for the alignment of disk data. + </dl> + </dd> </dl> <h4><a name="elementsFilesystems">Filesystems</a></h4> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 145caf7..60cf33e 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -886,6 +886,9 @@ <optional> <ref name="geometry"/> </optional> + <optional> + <ref name="diskIoLimits"/> + </optional> </interleave> </define> <define name="snapshot"> @@ -1110,6 +1113,20 @@ </optional> </element> </define> + <define name="diskIoLimits"> + <element name="iolimits"> + <optional> + <attribute name="logical_block_size"> + <data type="integer"/> + </attribute> + </optional> + <optional> + <attribute name="physical_block_size"> + <data type="integer"/> + </attribute> + </optional> + </element> + </define> <!-- Disk may use a special driver for access. --> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 224aec5..0fb0bc4 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3398,6 +3398,8 @@ virDomainDiskDefParseXML(virCapsPtr caps, char *authUUID = NULL; char *usageType = NULL; char *tray = NULL; + char *logical_block_size = NULL; + char *physical_block_size = NULL; if (VIR_ALLOC(def) < 0) { virReportOOMError(); @@ -3409,6 +3411,9 @@ virDomainDiskDefParseXML(virCapsPtr caps, def->geometry.sectors = 0; def->geometry.trans = VIR_DOMAIN_DISK_TRANS_DEFAULT; + def->iolimits.logical_block_size = 0; + def->iolimits.physical_block_size = 0; + ctxt->node = node; type = virXMLPropString(node, "type"); @@ -3547,6 +3552,27 @@ virDomainDiskDefParseXML(virCapsPtr caps, goto error; } } + } else if (xmlStrEqual(cur->name, BAD_CAST "iolimits")) { + logical_block_size = + virXMLPropString(cur, "logical_block_size"); + if (logical_block_size && + virStrToLong_ui(logical_block_size, NULL, 0, + &def->iolimits.logical_block_size) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("invalid logical block size '%s'"), + logical_block_size); + goto error; + } + physical_block_size = + virXMLPropString(cur, "physical_block_size"); + if (physical_block_size && + virStrToLong_ui(physical_block_size, NULL, 0, + &def->iolimits.physical_block_size) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("invalid physical block size '%s'"), + physical_block_size); + goto error; + } } else if (!driverName && xmlStrEqual(cur->name, BAD_CAST "driver")) { driverName = virXMLPropString(cur, "name"); @@ -4052,6 +4078,8 @@ cleanup: VIR_FREE(serial); virStorageEncryptionFree(encryption); VIR_FREE(startupPolicy); + VIR_FREE(logical_block_size); + VIR_FREE(physical_block_size); ctxt->node = save_ctxt; return def; @@ -11312,6 +11340,26 @@ static void virDomainDiskGeometryDefFormat(virBufferPtr buf, virBufferAddLit(buf, "/>\n"); } } +static void virDomainDiskIolimitsDefFormat(virBufferPtr buf, + virDomainDiskDefPtr def) +{ + if (def->iolimits.logical_block_size > 0 || + def->iolimits.physical_block_size > 0) { + virBufferAddLit(buf," <iolimits"); + if (def->iolimits.logical_block_size > 0) { + virBufferAsprintf(buf, + " logical_block_size='%u'", + def->iolimits.logical_block_size); + } + if (def->iolimits.physical_block_size > 0) { + virBufferAsprintf(buf, + " physical_block_size='%u'", + def->iolimits.physical_block_size); + } + virBufferAddLit(buf, "/>\n"); + } +} + static int virDomainDiskDefFormat(virBufferPtr buf, @@ -11485,6 +11533,7 @@ virDomainDiskDefFormat(virBufferPtr buf, } virDomainDiskGeometryDefFormat(buf, def); + virDomainDiskIolimitsDefFormat(buf, def); /* For now, mirroring is currently output-only: we only output it * for live domains, therefore we ignore it on input except for diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 9ee57e1..35608bd 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -568,6 +568,11 @@ struct _virDomainDiskDef { int trans; } geometry; + struct { + unsigned int logical_block_size; + unsigned int physical_block_size; + } iolimits; + virDomainBlockIoTuneInfo blkdeviotune; char *serial; -- 1.7.0.4

On Wed, Aug 29, 2012 at 05:48:30PM +0200, Viktor Mihajlovski wrote:
Introducing a new iolimits element allowing to override certain properties of a guest block device like the physical and logical block size. This can be useful for platforms with 'non-standard' disk formats like S390 DASD with its 4K block size.
Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> --- docs/formatdomain.html.in | 18 +++++++++++++++ docs/schemas/domaincommon.rng | 17 ++++++++++++++ src/conf/domain_conf.c | 49 +++++++++++++++++++++++++++++++++++++++++ src/conf/domain_conf.h | 5 ++++ 4 files changed, 89 insertions(+), 0 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index be8489a..db77cc4 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1264,6 +1264,7 @@ <driver name='qemu' type='raw'/> <source dev='/dev/sda'/> <geometry cyls='16383' heads='16' secs='63' trans='lba'/> + <iolimits logical_block_size='512' physical_block_size='4096'/>
I don't think 'iolimits' is a very good name for this - it suggested to me that it was doing I/o rate thottling/tuning. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 08/29/2012 07:08 PM, Daniel P. Berrange wrote:
<geometry cyls='16383' heads='16' secs='63' trans='lba'/>
+ <iolimits logical_block_size='512' physical_block_size='4096'/>
I don't think 'iolimits' is a very good name for this - it suggested to me that it was doing I/o rate thottling/tuning.
Daniel
what about s/iolimits/blockparams/ which was my initial thought (before I found some docs where I/O limits was used for those)? -- Mit freundlichen Grüßen/Kind Regards Viktor Mihajlovski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

On Thu, Aug 30, 2012 at 10:16:45AM +0200, Viktor Mihajlovski wrote:
On 08/29/2012 07:08 PM, Daniel P. Berrange wrote:
<geometry cyls='16383' heads='16' secs='63' trans='lba'/>
+ <iolimits logical_block_size='512' physical_block_size='4096'/>
I don't think 'iolimits' is a very good name for this - it suggested to me that it was doing I/o rate thottling/tuning.
Daniel
what about
s/iolimits/blockparams/
which was my initial thought (before I found some docs where I/O limits was used for those)?
How about using this: <blockio logical_size='512' physical_size='4096'/> Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 08/30/2012 07:37 PM, Daniel P. Berrange wrote:
How about using this:
<blockio logical_size='512' physical_size='4096'/>
Regards, Daniel
That is perfectly fine with me. Any other suggestions for a v2 patch? -- Mit freundlichen Grüßen/Kind Regards Viktor Mihajlovski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

On 08/31/2012 03:33 PM, Viktor Mihajlovski wrote:
On 08/30/2012 07:37 PM, Daniel P. Berrange wrote:
How about using this:
<blockio logical_size='512' physical_size='4096'/>
Regards, Daniel
That is perfectly fine with me. Any other suggestions for a v2 patch?
Hi Daniel, since the original patch went upstream with <iolimits ...>: do you want me to change the element name in a follow up patch (in time for 0.10.2), or would you consent to leave as is. BTW: Mike Snitzer has initially used the term i/o limits in the RHEL and Fedora Storage Admin guides but eventually switched to use "i/o parameters". -- Mit freundlichen Grüßen/Kind Regards Viktor Mihajlovski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

On Tue, Sep 04, 2012 at 01:57:00PM +0200, Viktor Mihajlovski wrote:
On 08/31/2012 03:33 PM, Viktor Mihajlovski wrote:
On 08/30/2012 07:37 PM, Daniel P. Berrange wrote:
How about using this:
<blockio logical_size='512' physical_size='4096'/>
Regards, Daniel
That is perfectly fine with me. Any other suggestions for a v2 patch?
Hi Daniel,
since the original patch went upstream with <iolimits ...>: do you want me to change the element name in a follow up patch (in time for 0.10.2), or would you consent to leave as is.
Yes, please do a followup to rename this. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 08/29/2012 08:48 AM, Viktor Mihajlovski wrote:
Introducing a new iolimits element allowing to override certain properties of a guest block device like the physical and logical block size. This can be useful for platforms with 'non-standard' disk formats like S390 DASD with its 4K block size.
Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> --- docs/formatdomain.html.in | 18 +++++++++++++++ docs/schemas/domaincommon.rng | 17 ++++++++++++++ src/conf/domain_conf.c | 49 +++++++++++++++++++++++++++++++++++++++++ src/conf/domain_conf.h | 5 ++++ 4 files changed, 89 insertions(+), 0 deletions(-)
+++ b/src/conf/domain_conf.c @@ -3398,6 +3398,8 @@ virDomainDiskDefParseXML(virCapsPtr caps, char *authUUID = NULL; char *usageType = NULL; char *tray = NULL; + char *logical_block_size = NULL; + char *physical_block_size = NULL;
if (VIR_ALLOC(def) < 0) { virReportOOMError(); @@ -3409,6 +3411,9 @@ virDomainDiskDefParseXML(virCapsPtr caps, def->geometry.sectors = 0; def->geometry.trans = VIR_DOMAIN_DISK_TRANS_DEFAULT;
+ def->iolimits.logical_block_size = 0; + def->iolimits.physical_block_size = 0;
zero-initialization should be the default, but you are following existing practice of explicit setting, so it doesn't hurt that much.
+ physical_block_size = + virXMLPropString(cur, "physical_block_size"); + if (physical_block_size && + virStrToLong_ui(physical_block_size, NULL, 0, + &def->iolimits.physical_block_size) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("invalid physical block size '%s'"), + physical_block_size);
Should we be validating that the result is a power of 2, and at least 512? But that's just icing to prevent stupidity; it's not a corner case that I think any sane person would ever try to violate. ACK once the 0.10.2 tweak is made in the docs. If patch 2 is fine, I will make the tweak and push, without needing a v2 from you. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Implementation of iolimits for the qemu driver with capability probing for block size attribute and command line generation for block sizes. Including testcase for qemuxml2argvtest. Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> --- src/qemu/qemu_capabilities.c | 11 ++++++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 8 +++++ tests/qemuhelptest.c | 12 +++++-- .../qemuxml2argv-disk-iolimits.args | 9 +++++ .../qemuxml2argv-disk-iolimits.xml | 33 ++++++++++++++++++++ tests/qemuxml2argvtest.c | 3 ++ 7 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.xml diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 5472267..7b29a81 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -172,6 +172,7 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST, "bridge", /* 100 */ "lsi", "virtio-scsi-pci", + "iolimits", ); @@ -1499,6 +1500,16 @@ qemuCapsParseDeviceStr(const char *str, virBitmapPtr flags) qemuCapsSet(flags, QEMU_CAPS_SCSI_CD); if (strstr(str, "ide-cd")) qemuCapsSet(flags, QEMU_CAPS_IDE_CD); + /* + * the iolimit detection is not really straight forward: + * in qemu this is a capability of the block layer, if + * present any of -device scsi-disk, virtio-blk-*, ... + * will offer to specify logical and physical block size + * and other properties... + */ + if (strstr(str, ".logical_block_size") && + strstr(str, ".physical_block_size")) + qemuCapsSet(flags, QEMU_CAPS_IOLIMITS); return 0; } diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index d606890..b0e41ba 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -138,6 +138,7 @@ enum qemuCapsFlags { QEMU_CAPS_NETDEV_BRIDGE = 100, /* bridge helper support */ QEMU_CAPS_SCSI_LSI = 101, /* -device lsi */ QEMU_CAPS_VIRTIO_SCSI_PCI = 102, /* -device virtio-scsi-pci */ + QEMU_CAPS_IOLIMITS = 103, /* -device ...logical_block_size & co */ QEMU_CAPS_LAST, /* this must always be the last item */ }; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 8c32a4d..f2dab2f 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2637,6 +2637,14 @@ qemuBuildDriveDevStr(virDomainDefPtr def, virBufferAsprintf(&opt, ",id=%s", disk->info.alias); if (bootindex && qemuCapsGet(qemuCaps, QEMU_CAPS_BOOTINDEX)) virBufferAsprintf(&opt, ",bootindex=%d", bootindex); + if (qemuCapsGet(qemuCaps, QEMU_CAPS_IOLIMITS)) { + if (disk->iolimits.logical_block_size > 0) + virBufferAsprintf(&opt, ",logical_block_size=%u", + disk->iolimits.logical_block_size); + if (disk->iolimits.physical_block_size > 0) + virBufferAsprintf(&opt, ",physical_block_size=%u", + disk->iolimits.physical_block_size); + } if (virBufferError(&opt)) { virReportOOMError(); diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c index 2d15c94..a391edd 100644 --- a/tests/qemuhelptest.c +++ b/tests/qemuhelptest.c @@ -540,7 +540,8 @@ mymain(void) QEMU_CAPS_NO_ACPI, QEMU_CAPS_VIRTIO_BLK_SCSI, QEMU_CAPS_VIRTIO_BLK_SG_IO, - QEMU_CAPS_CPU_HOST); + QEMU_CAPS_CPU_HOST, + QEMU_CAPS_IOLIMITS); DO_TEST("qemu-kvm-0.12.1.2-rhel62-beta", 12001, 1, 0, QEMU_CAPS_VNC_COLON, QEMU_CAPS_NO_REBOOT, @@ -607,7 +608,8 @@ mymain(void) QEMU_CAPS_VIRTIO_BLK_SG_IO, QEMU_CAPS_DRIVE_COPY_ON_READ, QEMU_CAPS_CPU_HOST, - QEMU_CAPS_SCSI_CD); + QEMU_CAPS_SCSI_CD, + QEMU_CAPS_IOLIMITS); DO_TEST("qemu-1.0", 1000000, 0, 0, QEMU_CAPS_VNC_COLON, QEMU_CAPS_NO_REBOOT, @@ -679,7 +681,8 @@ mymain(void) QEMU_CAPS_SCSI_BLOCK, QEMU_CAPS_SCSI_CD, QEMU_CAPS_IDE_CD, - QEMU_CAPS_SCSI_LSI); + QEMU_CAPS_SCSI_LSI, + QEMU_CAPS_IOLIMITS); DO_TEST("qemu-1.1.0", 1001000, 0, 0, QEMU_CAPS_VNC_COLON, QEMU_CAPS_NO_REBOOT, @@ -759,7 +762,8 @@ mymain(void) QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_NETDEV_BRIDGE, QEMU_CAPS_SCSI_LSI, - QEMU_CAPS_VIRTIO_SCSI_PCI); + QEMU_CAPS_VIRTIO_SCSI_PCI, + QEMU_CAPS_IOLIMITS); return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.args new file mode 100644 index 0000000..5fb1367 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.args @@ -0,0 +1,9 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \ +/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults \ +-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c \ +-drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-ide0-0-1 \ +-device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 \ +-drive file=/tmp/idedisk.img,if=none,id=drive-ide0-0-2 \ +-device ide-hd,bus=ide.0,unit=2,drive=drive-ide0-0-2,id=ide0-0-2,\ +logical_block_size=512,physical_block_size=512 \ +-usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.xml new file mode 100644 index 0000000..440984b --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.xml @@ -0,0 +1,33 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='block' device='cdrom'> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='1'/> + </disk> + <disk type='file' device='disk'> + <source file='/tmp/idedisk.img'/> + <target dev='hdc' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='2'/> + <iolimits logical_block_size='512' physical_block_size='512'/> + </disk> + <controller type='usb' index='0'/> + <controller type='ide' index='0'/> + <controller type='ide' index='1'/> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 71513fb..cc5b2c1 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -789,6 +789,9 @@ mymain(void) QEMU_CAPS_IDE_CD); DO_TEST("disk-geometry", QEMU_CAPS_DRIVE); + DO_TEST("disk-iolimits", + QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_IDE_CD, QEMU_CAPS_IOLIMITS); VIR_FREE(driver.stateDir); virCapabilitiesFree(driver.caps); -- 1.7.0.4

On 08/29/2012 08:48 AM, Viktor Mihajlovski wrote:
Implementation of iolimits for the qemu driver with capability probing for block size attribute and command line generation for block sizes. Including testcase for qemuxml2argvtest.
Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> --- src/qemu/qemu_capabilities.c | 11 ++++++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 8 +++++ tests/qemuhelptest.c | 12 +++++-- .../qemuxml2argv-disk-iolimits.args | 9 +++++ .../qemuxml2argv-disk-iolimits.xml | 33 ++++++++++++++++++++ tests/qemuxml2argvtest.c | 3 ++ 7 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.xml
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 5472267..7b29a81 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -172,6 +172,7 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST, "bridge", /* 100 */ "lsi", "virtio-scsi-pci", + "iolimits",
Minor conflict area with Martin's s3/s4-disable patches, but I'm sure he can rebase. ACK and pushed. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Viktor Mihajlovski