[PATCH] Rename iolimit to blockio.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx>
---
 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 ++--
 .../qemuxml2argv-disk-blockio.args                 |    9 +++++
 .../qemuxml2argvdata/qemuxml2argv-disk-blockio.xml |   33 ++++++++++++++++++++
 .../qemuxml2argv-disk-iolimits.args                |    9 -----
 .../qemuxml2argv-disk-iolimits.xml                 |   33 --------------------
 tests/qemuxml2argvtest.c                           |    4 +-
 13 files changed, 78 insertions(+), 78 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.xml
 delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.args
 delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.xml

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 5cb5a56..503685f 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1288,7 +1288,7 @@
       &lt;driver name='qemu' type='raw'/&gt;
       &lt;source dev='/dev/sda'/&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;/disk&gt;
   &lt;/devices&gt;
@@ -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>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index abd0e8f..c2c6184 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -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"/>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index c34a0a8..8952b69 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");
-        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
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index f9f4865..3995c2d 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 2ba7956..ed85b6f 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 a7b3a06..49d64e5 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 e739f34..a83d6de 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 a391edd..0d884f4 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-blockio.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.args
new file mode 100644
index 0000000..5fb1367
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.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-blockio.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.xml
new file mode 100644
index 0000000..52c9704
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.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'/>
+      <blockio 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/qemuxml2argvdata/qemuxml2argv-disk-iolimits.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.args
deleted file mode 100644
index 5fb1367..0000000
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.args
+++ /dev/null
@@ -1,9 +0,0 @@
-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
deleted file mode 100644
index 440984b..0000000
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<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 c655957..47c3f6c 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);
-- 
1.7.0.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]