[libvirt] [bug] problem with python interface, dom.vcpus() cpu info doesn't match cpu map

Chris Friesen chris.friesen at windriver.com
Tue May 20 16:50:03 UTC 2014


Hi,

I was playing around with vcpupin and emulatorpin and managed to get 
into a strange state.

 From within python I get the following:

(Pdb) dom = self._lookup_by_name(instance.name)
(Pdb) dom.vcpus()
([(0, 1, 5970000000L, 2), (1, 1, 4580000000L, 3)], [(False, False, True, 
False), (False, False, True, False)])


The problem is that the cpuinfo for the second vcpu has it running on 
physical cpu 3, even though the affinity mask (within python and from 
taskset) says it can only run on physical cpu 2.


The VM in question was originally started up running on pysical cpus 2 
and 3, then I used the vcpupin/emulatorpin commands to only use physical 
cpu 2.

Anyone got any ideas?  I'm using libvirt-1.1.2 and libvirt-python-1.1.2 
on a 3.4.82 kernel.



Some more data:


I have one VM running, taskset shows affinity as follows:

root at compute-0:~# taskset -pac 7680
pid 7680's current affinity list: 2
pid 7681's current affinity list: 1-3
pid 7683's current affinity list: 2
pid 7684's current affinity list: 0


"virsh" has the following view:

root at compute-0:~# virsh list
  Id    Name                           State
----------------------------------------------------
  3     instance-0000001d              running


root at compute-0:~# virsh emulatorpin 3
emulator: CPU Affinity
----------------------------------
        *: 2

root at compute-0:~#  virsh vcpupin 3
VCPU: CPU Affinity
----------------------------------
    0: 2
    1: 2


Thanks,
Chris




More information about the libvir-list mailing list