[libvirt] vcpuinfo returns wrong CPU value for kvm

vcpuinfo returns a wrong value for kvm with libvirt 0.6.2: virsh # nodeinfo CPU-Modell: x86_64 CPU(s): 2 CPU-Frequenz: 2333 MHz CPU-Socket(s): 1 Kern(e) pro Socket: 2 Thread(s) pro Kern: 1 NUMA-Zelle(n): 1 Speichergrösse: 3062956 kB virsh # dominfo rr019v3 Id: 2 Name: rr019v3 UUID: ff1ba599-5801-fca9-ab33-8962c2dfa46c OS Typ: hvm Status: laufend CPU(s): 2 CPU-Zeit: 46,5s Max Speicher: 1572864 kB Verwendeter Speicher: 1572864 kB Automatischer Start: deaktiviert As default a kvm-vm has a affinity on all cpus provided by the node virsh # vcpuinfo rr019v3 VCPU: 0 CPU: 0 Status: laufend CPU-Affinität: yy VCPU: 1 CPU: 0 Status: laufend CPU-Affinität: yy When i set the affinity of the vCPUs to dedicated CPUs of the node vcpuinfo returns CPU 0 as the assigned CPU. virsh # vcpupin rr019v3 0 0 virsh # vcpupin rr019v3 1 1 virsh # vcpuinfo rr019v3 VCPU: 0 CPU: 0 Status: laufend CPU-Affinität: y- VCPU: 1 CPU: 0 Status: laufend CPU-Affinität: -y Furthermore even when pinning all - in my case both - vCPUs of the domain to the second CPU of the node virsh reports the first cpu as the assigned cpu. virsh # vcpupin rr019v3 0 1 virsh # vcpuinfo rr019v3 VCPU: 0 CPU: 0 Status: laufend CPU-Affinität: -y VCPU: 1 CPU: 0 Status: laufend CPU-Affinität: -y Watching at the code in virsh.c i am a little bit on my wits end where virVcpuInfoPtr is defined as i am no c-programmer - only some java on my side. On my xen-machine with libvirt 0.3.3 the CPU is shown correctly though: virsh vcpuinfo rr010v2 VCPU: 0 CPU: 0 Status: blockiert CPU-Zeit: 550,4s CPU-Affinität: y--- VCPU: 1 CPU: 1 Status: blockiert CPU-Zeit: 27,9s CPU-Affinität: -y-- VCPU: 2 CPU: 2 Status: blockiert CPU-Zeit: 31,2s CPU-Affinität: --y- VCPU: 3 CPU: 3 Status: blockiert CPU-Zeit: 49,1s CPU-Affinität: ---y Is this only working with the xen-driver?

On Tue, Apr 14, 2009 at 09:53:51PM +0200, Gerrit Slomma wrote:
vcpuinfo returns a wrong value for kvm with libvirt 0.6.2:
Furthermore even when pinning all - in my case both - vCPUs of the domain to the second CPU of the node virsh reports the first cpu as the assigned cpu.
virsh # vcpupin rr019v3 0 1 virsh # vcpuinfo rr019v3 VCPU: 0 CPU: 0 Status: laufend CPU-Affinität: -y
VCPU: 1 CPU: 0 Status: laufend CPU-Affinität: -y
Watching at the code in virsh.c i am a little bit on my wits end where virVcpuInfoPtr is defined as i am no c-programmer - only some java on my side.
Unfortunately the answer is rather simple. We never fill in any value for the 'cpu' field of virVcpuInfo for QEMU/KVM guests, which means the 'CPU:' line should by virsh will always be zero. We need to fix this in the QEMU driver. Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (2)
-
Daniel P. Berrange
-
Gerrit Slomma