From 72f1f2206e96a3f1621a6772a2b9d0a740d86da1 Mon Sep 17 00:00:00 2001 From: Viktor Mihajlovski Date: Tue, 4 Sep 2012 16:30:55 +0200 Subject: [PATCH] Rename iolimit to blockio. After discussion with DB we decided to rename the new iolimit element as it creates the impression it would be there to limit (i.e. throttle) I/O instead of specifying immutable characteristics of a block device. This is also backed by the fact that the term I/O Limits has vanished from newer storage admin documentation. Signed-off-by: Viktor Mihajlovski --- docs/formatdomain.html.in | 6 ++-- docs/schemas/domaincommon.rng | 6 ++-- src/conf/domain_conf.c | 30 +++++++++---------- src/conf/domain_conf.h | 2 +- src/qemu/qemu_capabilities.c | 4 +-- src/qemu/qemu_capabilities.h | 2 +- src/qemu/qemu_command.c | 10 +++---- tests/qemuhelptest.c | 8 ++--- ...ts.args => qemuxml2argv-disk-blockio.args} | 0 ...mits.xml => qemuxml2argv-disk-blockio.xml} | 2 +- tests/qemuxml2argvtest.c | 4 +-- 11 files changed, 37 insertions(+), 37 deletions(-) rename tests/qemuxml2argvdata/{qemuxml2argv-disk-iolimits.args => qemuxml2argv-disk-blockio.args} (100%) rename tests/qemuxml2argvdata/{qemuxml2argv-disk-iolimits.xml => qemuxml2argv-disk-blockio.xml} (93%) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 5cb5a56381..503685fe59 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1288,7 +1288,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'/> + <blockio logical_block_size='512' physical_block_size='4096'/> <target dev='hda' bus='ide'/> </disk> </devices> @@ -1657,8 +1657,8 @@ BIOS-Translation-Modus (none, lba or auto) -
iolimits
-
If present, the iolimits element allows +
blockio
+
If present, the blockio element allows to override any of the block device properties listed below. Since 0.10.2 (QEMU and KVM)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index abd0e8f8be..c2c61844b3 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -890,7 +890,7 @@ - + @@ -1116,8 +1116,8 @@ - - + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c34a0a8ff6..8952b69a35 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3439,8 +3439,8 @@ 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; + def->blockio.logical_block_size = 0; + def->blockio.physical_block_size = 0; ctxt->node = node; @@ -3580,12 +3580,12 @@ virDomainDiskDefParseXML(virCapsPtr caps, goto error; } } - } else if (xmlStrEqual(cur->name, BAD_CAST "iolimits")) { + } else if (xmlStrEqual(cur->name, BAD_CAST "blockio")) { 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) { + &def->blockio.logical_block_size) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("invalid logical block size '%s'"), logical_block_size); @@ -3595,7 +3595,7 @@ virDomainDiskDefParseXML(virCapsPtr caps, virXMLPropString(cur, "physical_block_size"); if (physical_block_size && virStrToLong_ui(physical_block_size, NULL, 0, - &def->iolimits.physical_block_size) < 0) { + &def->blockio.physical_block_size) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("invalid physical block size '%s'"), physical_block_size); @@ -11406,21 +11406,21 @@ static void virDomainDiskGeometryDefFormat(virBufferPtr buf, virBufferAddLit(buf, "/>\n"); } } -static void virDomainDiskIolimitsDefFormat(virBufferPtr buf, - virDomainDiskDefPtr def) +static void virDomainDiskBlockIoDefFormat(virBufferPtr buf, + virDomainDiskDefPtr def) { - if (def->iolimits.logical_block_size > 0 || - def->iolimits.physical_block_size > 0) { - virBufferAddLit(buf," iolimits.logical_block_size > 0) { + if (def->blockio.logical_block_size > 0 || + def->blockio.physical_block_size > 0) { + virBufferAddLit(buf," blockio.logical_block_size > 0) { virBufferAsprintf(buf, " logical_block_size='%u'", - def->iolimits.logical_block_size); + def->blockio.logical_block_size); } - if (def->iolimits.physical_block_size > 0) { + if (def->blockio.physical_block_size > 0) { virBufferAsprintf(buf, " physical_block_size='%u'", - def->iolimits.physical_block_size); + def->blockio.physical_block_size); } virBufferAddLit(buf, "/>\n"); } @@ -11599,7 +11599,7 @@ virDomainDiskDefFormat(virBufferPtr buf, } virDomainDiskGeometryDefFormat(buf, def); - virDomainDiskIolimitsDefFormat(buf, def); + virDomainDiskBlockIoDefFormat(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 f9f486557a..3995c2d6a7 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -572,7 +572,7 @@ struct _virDomainDiskDef { struct { unsigned int logical_block_size; unsigned int physical_block_size; - } iolimits; + } blockio; virDomainBlockIoTuneInfo blkdeviotune; diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2ba7956e69..ed85b6f0c8 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -172,7 +172,7 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST, "bridge", /* 100 */ "lsi", "virtio-scsi-pci", - "iolimits", + "blockio", "disable-s3", "disable-s4", /* 105 */ @@ -1512,7 +1512,7 @@ qemuCapsParseDeviceStr(const char *str, virBitmapPtr flags) */ if (strstr(str, ".logical_block_size") && strstr(str, ".physical_block_size")) - qemuCapsSet(flags, QEMU_CAPS_IOLIMITS); + qemuCapsSet(flags, QEMU_CAPS_BLOCKIO); if (strstr(str, "PIIX4_PM.disable_s3=")) qemuCapsSet(flags, QEMU_CAPS_DISABLE_S3); if (strstr(str, "PIIX4_PM.disable_s4=")) diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index a7b3a061c4..49d64e5fc5 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -138,7 +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_BLOCKIO = 103, /* -device ...logical_block_size & co */ QEMU_CAPS_DISABLE_S3 = 104, /* S3 BIOS Advertisement on/off */ QEMU_CAPS_DISABLE_S4 = 105, /* S4 BIOS Advertisement on/off */ diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index e739f34e3f..a83d6de0fa 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2637,13 +2637,13 @@ 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) + if (qemuCapsGet(qemuCaps, QEMU_CAPS_BLOCKIO)) { + if (disk->blockio.logical_block_size > 0) virBufferAsprintf(&opt, ",logical_block_size=%u", - disk->iolimits.logical_block_size); - if (disk->iolimits.physical_block_size > 0) + disk->blockio.logical_block_size); + if (disk->blockio.physical_block_size > 0) virBufferAsprintf(&opt, ",physical_block_size=%u", - disk->iolimits.physical_block_size); + disk->blockio.physical_block_size); } if (virBufferError(&opt)) { diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c index a391edde70..0d884f4d0e 100644 --- a/tests/qemuhelptest.c +++ b/tests/qemuhelptest.c @@ -541,7 +541,7 @@ mymain(void) QEMU_CAPS_VIRTIO_BLK_SCSI, QEMU_CAPS_VIRTIO_BLK_SG_IO, QEMU_CAPS_CPU_HOST, - QEMU_CAPS_IOLIMITS); + QEMU_CAPS_BLOCKIO); DO_TEST("qemu-kvm-0.12.1.2-rhel62-beta", 12001, 1, 0, QEMU_CAPS_VNC_COLON, QEMU_CAPS_NO_REBOOT, @@ -609,7 +609,7 @@ mymain(void) QEMU_CAPS_DRIVE_COPY_ON_READ, QEMU_CAPS_CPU_HOST, QEMU_CAPS_SCSI_CD, - QEMU_CAPS_IOLIMITS); + QEMU_CAPS_BLOCKIO); DO_TEST("qemu-1.0", 1000000, 0, 0, QEMU_CAPS_VNC_COLON, QEMU_CAPS_NO_REBOOT, @@ -682,7 +682,7 @@ mymain(void) QEMU_CAPS_SCSI_CD, QEMU_CAPS_IDE_CD, QEMU_CAPS_SCSI_LSI, - QEMU_CAPS_IOLIMITS); + QEMU_CAPS_BLOCKIO); DO_TEST("qemu-1.1.0", 1001000, 0, 0, QEMU_CAPS_VNC_COLON, QEMU_CAPS_NO_REBOOT, @@ -763,7 +763,7 @@ mymain(void) QEMU_CAPS_NETDEV_BRIDGE, QEMU_CAPS_SCSI_LSI, QEMU_CAPS_VIRTIO_SCSI_PCI, - QEMU_CAPS_IOLIMITS); + QEMU_CAPS_BLOCKIO); return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.args similarity index 100% rename from tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.args rename to tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.args diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.xml similarity index 93% rename from tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.xml rename to tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.xml index 440984b0ef..52c9704cd2 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.xml @@ -23,7 +23,7 @@
- + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index c65595704e..47c3f6c53d 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -793,9 +793,9 @@ mymain(void) QEMU_CAPS_IDE_CD); DO_TEST("disk-geometry", QEMU_CAPS_DRIVE); - DO_TEST("disk-iolimits", + DO_TEST("disk-blockio", QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_IDE_CD, QEMU_CAPS_IOLIMITS); + QEMU_CAPS_IDE_CD, QEMU_CAPS_BLOCKIO); VIR_FREE(driver.stateDir); virCapabilitiesFree(driver.caps);