From 7d9def2ec1afaf50ec680f2aadfe359cb1ba5b80 Mon Sep 17 00:00:00 2001 From: Martin Kletzander Date: Fri, 15 Aug 2014 14:35:53 +0200 Subject: [PATCH] qemu: allow device block I/O tuning in session mode In commit 45ad1adb I added a nicer message for tunings that need cgroups when unavailable (unprivileged), 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 --- 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 8a699765ed..a92315adf7 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 bff8f77bbc..d01920e55c 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -15864,11 +15864,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; @@ -16016,7 +16011,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 | @@ -16031,13 +16025,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; @@ -16140,7 +16127,6 @@ qemuDomainGetBlockIoTune(virDomainPtr dom, if (vm) virObjectUnlock(vm); virObjectUnref(caps); - virObjectUnref(cfg); return ret; } -- GitLab