提交 72f1f220 编写于 作者: V Viktor Mihajlovski 提交者: Eric Blake

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: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
上级 03c42a45
...@@ -1288,7 +1288,7 @@ ...@@ -1288,7 +1288,7 @@
&lt;driver name='qemu' type='raw'/&gt; &lt;driver name='qemu' type='raw'/&gt;
&lt;source dev='/dev/sda'/&gt; &lt;source dev='/dev/sda'/&gt;
&lt;geometry cyls='16383' heads='16' secs='63' trans='lba'/&gt; &lt;geometry cyls='16383' heads='16' secs='63' trans='lba'/&gt;
&lt;iolimits logical_block_size='512' physical_block_size='4096'/&gt; &lt;blockio logical_block_size='512' physical_block_size='4096'/&gt;
&lt;target dev='hda' bus='ide'/&gt; &lt;target dev='hda' bus='ide'/&gt;
&lt;/disk&gt; &lt;/disk&gt;
&lt;/devices&gt; &lt;/devices&gt;
...@@ -1657,8 +1657,8 @@ ...@@ -1657,8 +1657,8 @@
BIOS-Translation-Modus (none, lba or auto)</dd> BIOS-Translation-Modus (none, lba or auto)</dd>
</dl> </dl>
</dd> </dd>
<dt><code>iolimits</code></dt> <dt><code>blockio</code></dt>
<dd>If present, the <code>iolimits</code> element allows <dd>If present, the <code>blockio</code> element allows
to override any of the block device properties listed below. to override any of the block device properties listed below.
<span class="since">Since 0.10.2 (QEMU and KVM)</span> <span class="since">Since 0.10.2 (QEMU and KVM)</span>
<dl> <dl>
......
...@@ -890,7 +890,7 @@ ...@@ -890,7 +890,7 @@
<ref name="geometry"/> <ref name="geometry"/>
</optional> </optional>
<optional> <optional>
<ref name="diskIoLimits"/> <ref name="diskBlockIo"/>
</optional> </optional>
</interleave> </interleave>
</define> </define>
...@@ -1116,8 +1116,8 @@ ...@@ -1116,8 +1116,8 @@
</optional> </optional>
</element> </element>
</define> </define>
<define name="diskIoLimits"> <define name="diskBlockIo">
<element name="iolimits"> <element name="blockio">
<optional> <optional>
<attribute name="logical_block_size"> <attribute name="logical_block_size">
<data type="integer"/> <data type="integer"/>
......
...@@ -3439,8 +3439,8 @@ virDomainDiskDefParseXML(virCapsPtr caps, ...@@ -3439,8 +3439,8 @@ virDomainDiskDefParseXML(virCapsPtr caps,
def->geometry.sectors = 0; def->geometry.sectors = 0;
def->geometry.trans = VIR_DOMAIN_DISK_TRANS_DEFAULT; def->geometry.trans = VIR_DOMAIN_DISK_TRANS_DEFAULT;
def->iolimits.logical_block_size = 0; def->blockio.logical_block_size = 0;
def->iolimits.physical_block_size = 0; def->blockio.physical_block_size = 0;
ctxt->node = node; ctxt->node = node;
...@@ -3580,12 +3580,12 @@ virDomainDiskDefParseXML(virCapsPtr caps, ...@@ -3580,12 +3580,12 @@ virDomainDiskDefParseXML(virCapsPtr caps,
goto error; goto error;
} }
} }
} else if (xmlStrEqual(cur->name, BAD_CAST "iolimits")) { } else if (xmlStrEqual(cur->name, BAD_CAST "blockio")) {
logical_block_size = logical_block_size =
virXMLPropString(cur, "logical_block_size"); virXMLPropString(cur, "logical_block_size");
if (logical_block_size && if (logical_block_size &&
virStrToLong_ui(logical_block_size, NULL, 0, virStrToLong_ui(logical_block_size, NULL, 0,
&def->iolimits.logical_block_size) < 0) { &def->blockio.logical_block_size) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("invalid logical block size '%s'"), _("invalid logical block size '%s'"),
logical_block_size); logical_block_size);
...@@ -3595,7 +3595,7 @@ virDomainDiskDefParseXML(virCapsPtr caps, ...@@ -3595,7 +3595,7 @@ virDomainDiskDefParseXML(virCapsPtr caps,
virXMLPropString(cur, "physical_block_size"); virXMLPropString(cur, "physical_block_size");
if (physical_block_size && if (physical_block_size &&
virStrToLong_ui(physical_block_size, NULL, 0, virStrToLong_ui(physical_block_size, NULL, 0,
&def->iolimits.physical_block_size) < 0) { &def->blockio.physical_block_size) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("invalid physical block size '%s'"), _("invalid physical block size '%s'"),
physical_block_size); physical_block_size);
...@@ -11406,21 +11406,21 @@ static void virDomainDiskGeometryDefFormat(virBufferPtr buf, ...@@ -11406,21 +11406,21 @@ static void virDomainDiskGeometryDefFormat(virBufferPtr buf,
virBufferAddLit(buf, "/>\n"); virBufferAddLit(buf, "/>\n");
} }
} }
static void virDomainDiskIolimitsDefFormat(virBufferPtr buf, static void virDomainDiskBlockIoDefFormat(virBufferPtr buf,
virDomainDiskDefPtr def) virDomainDiskDefPtr def)
{ {
if (def->iolimits.logical_block_size > 0 || if (def->blockio.logical_block_size > 0 ||
def->iolimits.physical_block_size > 0) { def->blockio.physical_block_size > 0) {
virBufferAddLit(buf," <iolimits"); virBufferAddLit(buf," <blockio");
if (def->iolimits.logical_block_size > 0) { if (def->blockio.logical_block_size > 0) {
virBufferAsprintf(buf, virBufferAsprintf(buf,
" logical_block_size='%u'", " 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, virBufferAsprintf(buf,
" physical_block_size='%u'", " physical_block_size='%u'",
def->iolimits.physical_block_size); def->blockio.physical_block_size);
} }
virBufferAddLit(buf, "/>\n"); virBufferAddLit(buf, "/>\n");
} }
...@@ -11599,7 +11599,7 @@ virDomainDiskDefFormat(virBufferPtr buf, ...@@ -11599,7 +11599,7 @@ virDomainDiskDefFormat(virBufferPtr buf,
} }
virDomainDiskGeometryDefFormat(buf, def); virDomainDiskGeometryDefFormat(buf, def);
virDomainDiskIolimitsDefFormat(buf, def); virDomainDiskBlockIoDefFormat(buf, def);
/* For now, mirroring is currently output-only: we only output it /* For now, mirroring is currently output-only: we only output it
* for live domains, therefore we ignore it on input except for * for live domains, therefore we ignore it on input except for
......
...@@ -572,7 +572,7 @@ struct _virDomainDiskDef { ...@@ -572,7 +572,7 @@ struct _virDomainDiskDef {
struct { struct {
unsigned int logical_block_size; unsigned int logical_block_size;
unsigned int physical_block_size; unsigned int physical_block_size;
} iolimits; } blockio;
virDomainBlockIoTuneInfo blkdeviotune; virDomainBlockIoTuneInfo blkdeviotune;
......
...@@ -172,7 +172,7 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST, ...@@ -172,7 +172,7 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
"bridge", /* 100 */ "bridge", /* 100 */
"lsi", "lsi",
"virtio-scsi-pci", "virtio-scsi-pci",
"iolimits", "blockio",
"disable-s3", "disable-s3",
"disable-s4", /* 105 */ "disable-s4", /* 105 */
...@@ -1512,7 +1512,7 @@ qemuCapsParseDeviceStr(const char *str, virBitmapPtr flags) ...@@ -1512,7 +1512,7 @@ qemuCapsParseDeviceStr(const char *str, virBitmapPtr flags)
*/ */
if (strstr(str, ".logical_block_size") && if (strstr(str, ".logical_block_size") &&
strstr(str, ".physical_block_size")) strstr(str, ".physical_block_size"))
qemuCapsSet(flags, QEMU_CAPS_IOLIMITS); qemuCapsSet(flags, QEMU_CAPS_BLOCKIO);
if (strstr(str, "PIIX4_PM.disable_s3=")) if (strstr(str, "PIIX4_PM.disable_s3="))
qemuCapsSet(flags, QEMU_CAPS_DISABLE_S3); qemuCapsSet(flags, QEMU_CAPS_DISABLE_S3);
if (strstr(str, "PIIX4_PM.disable_s4=")) if (strstr(str, "PIIX4_PM.disable_s4="))
......
...@@ -138,7 +138,7 @@ enum qemuCapsFlags { ...@@ -138,7 +138,7 @@ enum qemuCapsFlags {
QEMU_CAPS_NETDEV_BRIDGE = 100, /* bridge helper support */ QEMU_CAPS_NETDEV_BRIDGE = 100, /* bridge helper support */
QEMU_CAPS_SCSI_LSI = 101, /* -device lsi */ QEMU_CAPS_SCSI_LSI = 101, /* -device lsi */
QEMU_CAPS_VIRTIO_SCSI_PCI = 102, /* -device virtio-scsi-pci */ 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_S3 = 104, /* S3 BIOS Advertisement on/off */
QEMU_CAPS_DISABLE_S4 = 105, /* S4 BIOS Advertisement on/off */ QEMU_CAPS_DISABLE_S4 = 105, /* S4 BIOS Advertisement on/off */
......
...@@ -2637,13 +2637,13 @@ qemuBuildDriveDevStr(virDomainDefPtr def, ...@@ -2637,13 +2637,13 @@ qemuBuildDriveDevStr(virDomainDefPtr def,
virBufferAsprintf(&opt, ",id=%s", disk->info.alias); virBufferAsprintf(&opt, ",id=%s", disk->info.alias);
if (bootindex && qemuCapsGet(qemuCaps, QEMU_CAPS_BOOTINDEX)) if (bootindex && qemuCapsGet(qemuCaps, QEMU_CAPS_BOOTINDEX))
virBufferAsprintf(&opt, ",bootindex=%d", bootindex); virBufferAsprintf(&opt, ",bootindex=%d", bootindex);
if (qemuCapsGet(qemuCaps, QEMU_CAPS_IOLIMITS)) { if (qemuCapsGet(qemuCaps, QEMU_CAPS_BLOCKIO)) {
if (disk->iolimits.logical_block_size > 0) if (disk->blockio.logical_block_size > 0)
virBufferAsprintf(&opt, ",logical_block_size=%u", virBufferAsprintf(&opt, ",logical_block_size=%u",
disk->iolimits.logical_block_size); disk->blockio.logical_block_size);
if (disk->iolimits.physical_block_size > 0) if (disk->blockio.physical_block_size > 0)
virBufferAsprintf(&opt, ",physical_block_size=%u", virBufferAsprintf(&opt, ",physical_block_size=%u",
disk->iolimits.physical_block_size); disk->blockio.physical_block_size);
} }
if (virBufferError(&opt)) { if (virBufferError(&opt)) {
......
...@@ -541,7 +541,7 @@ mymain(void) ...@@ -541,7 +541,7 @@ mymain(void)
QEMU_CAPS_VIRTIO_BLK_SCSI, QEMU_CAPS_VIRTIO_BLK_SCSI,
QEMU_CAPS_VIRTIO_BLK_SG_IO, QEMU_CAPS_VIRTIO_BLK_SG_IO,
QEMU_CAPS_CPU_HOST, QEMU_CAPS_CPU_HOST,
QEMU_CAPS_IOLIMITS); QEMU_CAPS_BLOCKIO);
DO_TEST("qemu-kvm-0.12.1.2-rhel62-beta", 12001, 1, 0, DO_TEST("qemu-kvm-0.12.1.2-rhel62-beta", 12001, 1, 0,
QEMU_CAPS_VNC_COLON, QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT, QEMU_CAPS_NO_REBOOT,
...@@ -609,7 +609,7 @@ mymain(void) ...@@ -609,7 +609,7 @@ mymain(void)
QEMU_CAPS_DRIVE_COPY_ON_READ, QEMU_CAPS_DRIVE_COPY_ON_READ,
QEMU_CAPS_CPU_HOST, QEMU_CAPS_CPU_HOST,
QEMU_CAPS_SCSI_CD, QEMU_CAPS_SCSI_CD,
QEMU_CAPS_IOLIMITS); QEMU_CAPS_BLOCKIO);
DO_TEST("qemu-1.0", 1000000, 0, 0, DO_TEST("qemu-1.0", 1000000, 0, 0,
QEMU_CAPS_VNC_COLON, QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT, QEMU_CAPS_NO_REBOOT,
...@@ -682,7 +682,7 @@ mymain(void) ...@@ -682,7 +682,7 @@ mymain(void)
QEMU_CAPS_SCSI_CD, QEMU_CAPS_SCSI_CD,
QEMU_CAPS_IDE_CD, QEMU_CAPS_IDE_CD,
QEMU_CAPS_SCSI_LSI, QEMU_CAPS_SCSI_LSI,
QEMU_CAPS_IOLIMITS); QEMU_CAPS_BLOCKIO);
DO_TEST("qemu-1.1.0", 1001000, 0, 0, DO_TEST("qemu-1.1.0", 1001000, 0, 0,
QEMU_CAPS_VNC_COLON, QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT, QEMU_CAPS_NO_REBOOT,
...@@ -763,7 +763,7 @@ mymain(void) ...@@ -763,7 +763,7 @@ mymain(void)
QEMU_CAPS_NETDEV_BRIDGE, QEMU_CAPS_NETDEV_BRIDGE,
QEMU_CAPS_SCSI_LSI, QEMU_CAPS_SCSI_LSI,
QEMU_CAPS_VIRTIO_SCSI_PCI, QEMU_CAPS_VIRTIO_SCSI_PCI,
QEMU_CAPS_IOLIMITS); QEMU_CAPS_BLOCKIO);
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
} }
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<source file='/tmp/idedisk.img'/> <source file='/tmp/idedisk.img'/>
<target dev='hdc' bus='ide'/> <target dev='hdc' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='2'/> <address type='drive' controller='0' bus='0' target='0' unit='2'/>
<iolimits logical_block_size='512' physical_block_size='512'/> <blockio logical_block_size='512' physical_block_size='512'/>
</disk> </disk>
<controller type='usb' index='0'/> <controller type='usb' index='0'/>
<controller type='ide' index='0'/> <controller type='ide' index='0'/>
......
...@@ -793,9 +793,9 @@ mymain(void) ...@@ -793,9 +793,9 @@ mymain(void)
QEMU_CAPS_IDE_CD); QEMU_CAPS_IDE_CD);
DO_TEST("disk-geometry", QEMU_CAPS_DRIVE); 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_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); VIR_FREE(driver.stateDir);
virCapabilitiesFree(driver.caps); virCapabilitiesFree(driver.caps);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册