mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
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 <mihajlov@linux.vnet.ibm.com>
This commit is contained in:
parent
03c42a4510
commit
72f1f2206e
@ -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)</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt><code>iolimits</code></dt>
|
||||
<dd>If present, the <code>iolimits</code> element allows
|
||||
<dt><code>blockio</code></dt>
|
||||
<dd>If present, the <code>blockio</code> element allows
|
||||
to override any of the block device properties listed below.
|
||||
<span class="since">Since 0.10.2 (QEMU and KVM)</span>
|
||||
<dl>
|
||||
|
@ -890,7 +890,7 @@
|
||||
<ref name="geometry"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="diskIoLimits"/>
|
||||
<ref name="diskBlockIo"/>
|
||||
</optional>
|
||||
</interleave>
|
||||
</define>
|
||||
@ -1116,8 +1116,8 @@
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
<define name="diskIoLimits">
|
||||
<element name="iolimits">
|
||||
<define name="diskBlockIo">
|
||||
<element name="blockio">
|
||||
<optional>
|
||||
<attribute name="logical_block_size">
|
||||
<data type="integer"/>
|
||||
|
@ -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");
|
||||
if (def->iolimits.logical_block_size > 0) {
|
||||
if (def->blockio.logical_block_size > 0 ||
|
||||
def->blockio.physical_block_size > 0) {
|
||||
virBufferAddLit(buf," <blockio");
|
||||
if (def->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
|
||||
|
@ -572,7 +572,7 @@ struct _virDomainDiskDef {
|
||||
struct {
|
||||
unsigned int logical_block_size;
|
||||
unsigned int physical_block_size;
|
||||
} iolimits;
|
||||
} blockio;
|
||||
|
||||
virDomainBlockIoTuneInfo blkdeviotune;
|
||||
|
||||
|
@ -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="))
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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)) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
<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'/>
|
||||
<blockio logical_block_size='512' physical_block_size='512'/>
|
||||
</disk>
|
||||
<controller type='usb' index='0'/>
|
||||
<controller type='ide' index='0'/>
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user