[libvirt] CPU Topology in Libvirt Java 0.51

We are trying to get the cpu topology data (cores, sockets, threads) using the Java binding of the libvirt API, after connecting to a hypervisor. We are expecting the domain (vm) XML payload to contain the <cpu> element with the <topology> sub-element, but it is not present. <cpu mode='custom' match='exact'> <model fallback='allow'>Penryn</model> <vendor>Intel</vendor> <feature policy='require' name='tm2'/> ... </cpu>

On 03/20/2014 11:54 AM, Vikas Kokare wrote:
We are trying to get the cpu topology data (cores, sockets, threads) using the Java binding of the libvirt API, after connecting to a hypervisor. We are expecting the domain (vm) XML payload to contain the <cpu> element with the <topology> sub-element, but it is not present.
Whether you are using the Java bindings or the C bindings doesn't matter; in this case, the <domain> xml is not specified as listing any topology for the guest cpus. Right now, the only topology listing in our xml is when describing host capabilities. But your idea of describing guest topology has merit; are you willing to submit patches to add it? -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Thu, Mar 20, 2014 at 12:55:07 -0600, Eric Blake wrote:
On 03/20/2014 11:54 AM, Vikas Kokare wrote:
We are trying to get the cpu topology data (cores, sockets, threads) using the Java binding of the libvirt API, after connecting to a hypervisor. We are expecting the domain (vm) XML payload to contain the <cpu> element with the <topology> sub-element, but it is not present.
Whether you are using the Java bindings or the C bindings doesn't matter; in this case, the <domain> xml is not specified as listing any topology for the guest cpus. Right now, the only topology listing in our xml is when describing host capabilities. But your idea of describing guest topology has merit; are you willing to submit patches to add it?
Well, libvirt supports guest topology since 0.7.6 (released several years ago), see http://www.libvirt.org/formatdomain.html#elementsCPU The reason the topology element is not present in the domain XML is that the domain was apparently configured without it. It's not something every domain will have. It's only there if a user put it in the XML when defining the domain. Jirka
participants (3)
-
Eric Blake
-
Jiri Denemark
-
Vikas Kokare