]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Add checks for blkdeviotune 'size_iops_sec' and adjust error
authorJohn Ferlan <jferlan@redhat.com>
Wed, 12 Nov 2014 15:16:51 +0000 (10:16 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 14 Nov 2014 16:57:03 +0000 (11:57 -0500)
Seems the 'size_iops_sec' was a late add and the checks for whether
the field was defined, but unsupported and the maximum size of the
field were not being made.

Also, adjust blkdeviotune support error message for grammar, spelling
(paramater), and remove the "(need QEMU 1.7 or superior)".  None of
our other similar error messages list which QEMU version is required.

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_command.c

index 6df351f5e6013200c4cebeac31e0f9d279cbc428..1399ce42d6ad9f5d3894a5b520a3a58f44d3eaf3 100644 (file)
@@ -3676,11 +3676,12 @@ qemuBuildDriveStr(virConnectPtr conn,
          disk->blkdeviotune.write_bytes_sec_max ||
          disk->blkdeviotune.total_iops_sec_max ||
          disk->blkdeviotune.read_iops_sec_max ||
-         disk->blkdeviotune.write_iops_sec_max) &&
+         disk->blkdeviotune.write_iops_sec_max ||
+         disk->blkdeviotune.size_iops_sec) &&
         !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_IOTUNE_MAX)) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("there is some block I/O throttling paramater that are not supported with this "
-                         "QEMU binary(need QEMU 1.7 or superior)"));
+                       _("there are some block I/O throttling parameters "
+                         "that are not supported with this QEMU binary"));
         goto error;
     }
 
@@ -3695,7 +3696,8 @@ qemuBuildDriveStr(virConnectPtr conn,
         disk->blkdeviotune.write_bytes_sec_max > LLONG_MAX ||
         disk->blkdeviotune.total_iops_sec_max > LLONG_MAX ||
         disk->blkdeviotune.read_iops_sec_max > LLONG_MAX ||
-        disk->blkdeviotune.write_iops_sec_max > LLONG_MAX) {
+        disk->blkdeviotune.write_iops_sec_max > LLONG_MAX ||
+        disk->blkdeviotune.size_iops_sec > LLONG_MAX) {
         virReportError(VIR_ERR_OVERFLOW,
                       _("block I/O throttle limit must "
                         "be less than %llu using QEMU"), LLONG_MAX);