openstack team mailing list archive
-
openstack team
-
Mailing list archive
-
Message #25358
Re: How to set vcpupin in guest XML?
On Tue, Jul 23, 2013 at 05:31:25PM +0800, Peeyush Gupta wrote:
> Hi all,
>
> I am working with openstack and I want to pin vcpus to pcpus in
> guest xml. Now, the pinning operation can be done using
> virsh vcpupin guestname vcpu pcpu
> But I want to do it using python API. I investigated the openstack
> code and found out that get_guest_config function in libvirt/driver.py
> is responsible for generation of guest XML file. Now, I tried to put
> vcpupin attribute here by guest.vcpupin or guest.cputune_vcpupin but
> none of them is working. Any idea what am I doing wrong? Or is this
> functionality not available with openstack?
The get_guest_config() function returns an instance of the
nova.virt.libvirt.config.LibvirtConfigGuest object. That class
has defined attributes for setting various parts of the XML
config. You can't simply set arbitrary attributes and expect
it to work - you'll need to define how it is exposed in the
LibvirtConfigGuest object (or one of the related classes
that it uses) and then impl the code to generate the XML dom
from that attribute.
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
Follow ups
References