From 0471637d5628106d058f0eb5516ffa7d5285cc6f Mon Sep 17 00:00:00 2001 From: Martin Kletzander Date: Thu, 16 May 2013 14:37:54 +0200 Subject: [PATCH] qemu: Fix cgroup handling when setting VCPU BW Commit 632f78c introduced a regression which causes schedinfo being unable to set some parameters. When migrating to priv->cgroup there was missing variable left out and due to passed NULL to underlying function, the setting failed. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=963592 --- src/qemu/qemu_driver.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1933c8f269..203cc6d24c 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -8009,7 +8009,6 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, { virQEMUDriverPtr driver = dom->conn->privateData; int i; - virCgroupPtr group = NULL; virDomainObjPtr vm = NULL; virDomainDefPtr vmdef = NULL; unsigned long long value_ul; @@ -8087,7 +8086,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, QEMU_SCHED_MIN_PERIOD, QEMU_SCHED_MAX_PERIOD); if (flags & VIR_DOMAIN_AFFECT_LIVE && value_ul) { - if ((rc = qemuSetVcpusBWLive(vm, group, value_ul, 0))) + if ((rc = qemuSetVcpusBWLive(vm, priv->cgroup, value_ul, 0))) goto cleanup; vm->def->cputune.period = value_ul; @@ -8101,7 +8100,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, QEMU_SCHED_MIN_QUOTA, QEMU_SCHED_MAX_QUOTA); if (flags & VIR_DOMAIN_AFFECT_LIVE && value_l) { - if ((rc = qemuSetVcpusBWLive(vm, group, 0, value_l))) + if ((rc = qemuSetVcpusBWLive(vm, priv->cgroup, 0, value_l))) goto cleanup; vm->def->cputune.quota = value_l; @@ -8115,7 +8114,8 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, QEMU_SCHED_MIN_PERIOD, QEMU_SCHED_MAX_PERIOD); if (flags & VIR_DOMAIN_AFFECT_LIVE && value_ul) { - if ((rc = qemuSetEmulatorBandwidthLive(vm, group, value_ul, 0))) + if ((rc = qemuSetEmulatorBandwidthLive(vm, priv->cgroup, + value_ul, 0))) goto cleanup; vm->def->cputune.emulator_period = value_ul; @@ -8129,7 +8129,8 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, QEMU_SCHED_MIN_QUOTA, QEMU_SCHED_MAX_QUOTA); if (flags & VIR_DOMAIN_AFFECT_LIVE && value_l) { - if ((rc = qemuSetEmulatorBandwidthLive(vm, group, 0, value_l))) + if ((rc = qemuSetEmulatorBandwidthLive(vm, priv->cgroup, + 0, value_l))) goto cleanup; vm->def->cputune.emulator_quota = value_l;