At 06/30/2011 03:27 PM, Taku Izumi Write:
On Thu, 30 Jun 2011 11:19:14 +0800
Wen Congyang <wency(a)cn.fujitsu.com> wrote:
> Introduce new command vcpu-bandwidth to change and query bandwidth for each vcpu.
>
> Usage:
> 1. query bandwidth for all vcpus:
> # virsh vcpu-bandwidth <domain>
>
> 2. query bandwidth for a vcpu:
> # virsh vcpu-bandwidth <domain> <vcpuid>
>
> 3. change bandwidth for a vcpu:
> # virsh vcpu-bandwidth <domain> <vcpuid> <period> <quota>
> You can omit period or quota.
>
> The option --live, --config, and --current is the same as the other commands.
I try the following:
# virsh domstate VM
shut off
# virsh vcpu-bandwidth VM --config
vcpu: period quota
----------------------------------
0: 100000 50000
1: 100000 50000
2: 100000 50000
3: 100000 50000
# virsh start VM
Domain VM started
# virsh vcpu-bandwidth VM --live
vcpu: period quota
----------------------------------
0: 100000 -1
1: 100000 -1
2: 100000 -1
3: 100000 -1
This behavior doesn't make sense to me.
Is this what you intend?
Or, do I make a mistake?
Ah, It is a bug of my patchset(Patch 4/10).
Please use this temp fix to test:
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index 201c0b8..2bf7715 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -485,7 +485,7 @@ int qemuSetupCgroupForVcpu(struct qemud_driver *driver,
virDomainObjPtr vm)
if (vcpubw_list) {
if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU)) {
vcpubw = virDomainVcpuBWFindByVcpu(vcpubw_list, nvcpubw, i);
- if (qemuSetupCgroupVcpuBW(cgroup, vcpubw) < 0)
+ if (qemuSetupCgroupVcpuBW(cgroup_vcpu, vcpubw) < 0)
goto cleanup;
}
}
>