[PATCH] qemu: allow device block I/O tuning in session mode

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

 



In commit 45ad1adb I added a nicer message for tunings that need
cgroups when unavailable (unprigileged) ,but I added this check for
I/O tuning of block devices, which doesn't need cgroups, because it is
done by QEMU, so let's fix that.

Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 src/qemu/qemu_command.c |  2 +-
 src/qemu/qemu_driver.c  | 14 --------------
 2 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 8a69976..a92315a 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7375,7 +7375,7 @@ qemuBuildCommandLine(virConnectPtr conn,
             goto error;
         }

-        if (def->blkio.weight || def->blkio.ndevices) {
+        if (def->blkio.weight) {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                            _("Block I/O tuning is not available in session mode"));
             goto error;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index ac0717c..b95432a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15857,11 +15857,6 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
         goto cleanup;

     cfg = virQEMUDriverGetConfig(driver);
-    if (!cfg->privileged) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("Block I/O tuning is not available in session mode"));
-        goto cleanup;
-    }

     if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
         goto cleanup;
@@ -16009,7 +16004,6 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
     int ret = -1;
     size_t i;
     virCapsPtr caps = NULL;
-    virQEMUDriverConfigPtr cfg = NULL;

     virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
                   VIR_DOMAIN_AFFECT_CONFIG |
@@ -16024,13 +16018,6 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
     if (virDomainGetBlockIoTuneEnsureACL(dom->conn, vm->def) < 0)
         goto cleanup;

-    cfg = virQEMUDriverGetConfig(driver);
-    if (!cfg->privileged) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("Block I/O tuning is not available in session mode"));
-        goto cleanup;
-    }
-
     if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
         goto cleanup;

@@ -16133,7 +16120,6 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
     if (vm)
         virObjectUnlock(vm);
     virObjectUnref(caps);
-    virObjectUnref(cfg);
     return ret;
 }

-- 
2.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]