render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
7a3408
From 314408b2a7fea6400ba6d5dda4c6031b7c7bde4e Mon Sep 17 00:00:00 2001
7a3408
Message-Id: <314408b2a7fea6400ba6d5dda4c6031b7c7bde4e@dist-git>
7a3408
From: Martin Kletzander <mkletzan@redhat.com>
7a3408
Date: Tue, 4 Aug 2015 13:11:29 +0200
7a3408
Subject: [PATCH] qemu: Check for iotune_max support properly
7a3408
7a3408
Commit d506a51aeb2a7a7b0c963f760e32b94376ea7173 meant to check for
7a3408
QEMU_CAPS_DRIVE_IOTUNE_MAX, but checked for QEMU_CAPS_DRIVE_IOTUNE
7a3408
instead.  That's clearly visible from the diff, but it got in.  Because
7a3408
of that, we were supplying information unknown for QEMU if it wasn't new
7a3408
enough and we couldn't even properly handle the error, leading to
7a3408
"Unexpected error".  Also iops_size came at the same time with all the
7a3408
other "_max" options, so check whether we're not setting that either if
7a3408
QEMU_CAPS_DRIVE_IOTUNE_MAX is not supported.
7a3408
7a3408
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1224053
7a3408
7a3408
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7a3408
(cherry picked from commit ba167186cf7753cf662697ab67a4b10e9b3d4096)
7a3408
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7a3408
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7a3408
---
7a3408
 src/qemu/qemu_driver.c | 8 +++++---
7a3408
 1 file changed, 5 insertions(+), 3 deletions(-)
7a3408
7a3408
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
7a3408
index fbe37c2..c59186d 100644
7a3408
--- a/src/qemu/qemu_driver.c
7a3408
+++ b/src/qemu/qemu_driver.c
7a3408
@@ -17666,7 +17666,8 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
7a3408
     }
7a3408
 
7a3408
     if (flags & VIR_DOMAIN_AFFECT_LIVE) {
7a3408
-        supportMaxOptions = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DRIVE_IOTUNE);
7a3408
+        supportMaxOptions = virQEMUCapsGet(priv->qemuCaps,
7a3408
+                                           QEMU_CAPS_DRIVE_IOTUNE_MAX);
7a3408
         if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DRIVE_IOTUNE)) {
7a3408
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
7a3408
                        _("block I/O throttling not supported with this "
7a3408
@@ -17674,12 +17675,13 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
7a3408
             goto endjob;
7a3408
         }
7a3408
 
7a3408
-        if (!supportMaxOptions && (set_iops_max || set_bytes_max)) {
7a3408
+        if (!supportMaxOptions &&
7a3408
+            (set_iops_max || set_bytes_max || set_size_iops)) {
7a3408
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
7a3408
                            _("a block I/O throttling parameter is not "
7a3408
                              "supported with this QEMU binary"));
7a3408
              goto endjob;
7a3408
-         }
7a3408
+        }
7a3408
 
7a3408
         if (!(device = qemuDiskPathToAlias(vm, disk, &idx)))
7a3408
             goto endjob;
7a3408
-- 
7a3408
2.5.0
7a3408