<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Hi Daniel,</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span>Thanks for your suggestion. I made some changes in config and it works fine. One more thing I wanted to ask is I want to add an attribute to xml. But I am not able to figure out how exactly libvirt is defining xml. I understand that config can only add the attributes that are defined in the xml. But how do I add a new attribute?</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif;
 background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span>Thanks.</span></div><div></div><div> </div><div><font class="Apple-style-span" color="#9E8FA9">~Peeyush Gupta</font><br></div>  <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font size="2" face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Daniel P. Berrange <berrange@redhat.com><br> <b><span style="font-weight: bold;">To:</span></b> Peeyush Gupta <gpeeyush@ymail.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "openstack@lists.launchpad.net" <openstack@lists.launchpad.net> <br> <b><span style="font-weight:
 bold;">Sent:</span></b> Tuesday, 23 July 2013 4:34 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Openstack] How to set vcpupin in guest XML?<br> </font> </div> <div class="y_msg_container"><br>On Tue, Jul 23, 2013 at 05:31:25PM +0800, Peeyush Gupta wrote:<br>> Hi all,<br>> <br>> I am working with openstack and I want to pin vcpus to pcpus in<br>> guest xml. Now, the pinning operation can be done using<br>> virsh vcpupin guestname vcpu pcpu<br>> But I want to do it using python API. I investigated the openstack<br>> code and found out that get_guest_config function in libvirt/driver.py<br>> is responsible for generation of guest XML file. Now, I tried to put<br>> vcpupin attribute here by guest.vcpupin or guest.cputune_vcpupin but<br>> none of them is working. Any idea what am I doing wrong? Or is this<br>> functionality not available with openstack?<br><br>The get_guest_config() function returns an
 instance of the<br>nova.virt.libvirt.config.LibvirtConfigGuest object. That class<br>has defined attributes for setting various parts of the XML<br>config. You can't simply set arbitrary attributes and expect<br>it to work - you'll need to define how it is exposed in the<br>LibvirtConfigGuest object (or one of the related classes<br>that it uses) and then impl the code to generate the XML dom<br>from that attribute.<br><br>Daniel<br>-- <br>|: <a href="http://berrange.com/" target="_blank">http://berrange.com </a>     -o-    <a href="http://www.flickr.com/photos/dberrange/" target="_blank">http://www.flickr.com/photos/dberrange/ </a>:|<br>|: <a href="http://libvirt.org/" target="_blank">http://libvirt.org </a>             -o-             <a href="http://virt-manager.org/" target="_blank">http://virt-manager.org </a>:|<br>|: <a href="http://autobuild.org/"
 target="_blank">http://autobuild.org </a>      -o-         <a href="http://search.cpan.org/~danberr/" target="_blank">http://search.cpan.org/~danberr/ </a>:|<br>|: <a href="http://entangle-photo.org/" target="_blank">http://entangle-photo.org </a>      -o-       <a href="http://live.gnome.org/gtk-vnc" target="_blank">http://live.gnome.org/gtk-vnc </a>:|<br><br><br></div> </div> </div>  </div></body></html>