<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Yes, I have run both of them on same machine. And <span style="font-size: 12pt;">I </span></div><div style="color: rgb(0, 0, 0); font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="font-size: 12pt;">am running libvirt 1.1.0. So, I guess it's not a </span><span style="font-size: 12pt;">problem </span></div><div style="color: rgb(0, 0, 0); font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="font-size: 12pt;">of older version.</span></div><div></div><div> </div><div>Thanks</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> "libvirt-users@redhat.com" <libvirt-users@redhat.com> <br> <b><span style="font-weight: bold;">Sent:</span></b> Tuesday, 17 September 2013 3:19 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [libvirt-users] Finding out CPU topology.<br> </font> </div> <div class="y_msg_container"><br>On Tue, Sep 17, 2013 at 05:41:12PM +0800, Peeyush Gupta wrote:<br>> Hi all,<br>> <br>> I have been trying to find out cpu topology using libvirt. When<br>> I do 'virsh capabilites', I find this inside <topology>
tag:<br>> <br>> <br>> <topology><br>> <cells num='1'><br>> <cell id='0'><br>> <memory unit='KiB'>3908488</memory><br>> <cpus num='4'><br>> <cpu id='0' socket_id='0' core_id='0' siblings='0'/><br>> <cpu id='1' socket_id='0' core_id='0' siblings='1'/><br>> <cpu id='2' socket_id='0' core_id='1' siblings='2'/><br>> <cpu id='3' socket_id='0' core_id='1' siblings='3'/><br>> </cpus><br>> </cell><br>> </cells><br>> </topology><br>> <br>> But when I use the
'getCapbilities()' function of the python binding,<br>> the result is:<br>> <topology> <br>> <cells num='1'> <br>> <cell id='0'> <br>> <cpus num='4'> <br>> <cpu id='0'/><br>> <cpu id='1'/><br>> <cpu id='2'/><br>> <cpu id='3'/> <br>> </cpus> <br>> </cell> <br>> </cells> <br>> </topology>\n<br>> <br>> As you can see this doesnt give any information about socket/core/thread etc.<br>> What I an interested to know is that is it a limitation of python binding or libvirt<br>> C API itself? How
can I get the whole topology without just parsing the output<br>> of virsh capabilities?<br><br>Did you really run these two examples on the same machine, with the same<br>libvirt URI ? Both virsh and the python binding call the same libvirt API<br>'virConnectGetCapabilities' so will return the same data if run against<br>the same libvirt. The socket_id, core_id and siblings data is a relatively<br>new feature we added, so older libvirt won't show it.<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>