Rathidevi
2014-Jan-29 04:59 UTC
Re: [libvirt-users] How to find domain os type and ip address
Hi All, I am using the libvirt-0.5.1.jar and downloaded from this link ftp://libvirt.org/libvirt/java. 1) To find the os type of domain I use this method getOSType(). But it returns the kvm or hvm instead of windows and linux. Is the any way to find the original os type of domain? 2) Please give is there any option or method available to find the ipaddress of domain? Thanks & Regards Rathidevi
Eric Blake
2014-Jan-29 05:29 UTC
Re: [libvirt-users] How to find domain os type and ip address
On 01/28/2014 09:59 PM, Rathidevi wrote:> Hi All, > > I am using the libvirt-0.5.1.jar and downloaded from this link > ftp://libvirt.org/libvirt/java. > > 1) To find the os type of domain I use this method getOSType(). But it > returns the kvm or hvm instead of windows and linux. Is the any way to > find the original os type of domain?The libvirt getOSType is probably misnamed; you are referring to the Java bindings, but it is a wrapper around the C api virDomainGetOSType, which in turn is merely a shorthand for accesssing part of the domain XML for determining whether your guest is hardware-accelerated (kvm) or not. But the question you are asking is an easy task for libguestfs; in particular, the virt-inspector command is able to tell you quite a bit of information about the OS running in your guest. Libguestfs also comes with Java bindings, but this is probably not the best list for getting help with using libguestfs.> 2) Please give is there any option or method available to find the > ipaddress of domain?Not yet. Nehal is working on adding such an API, but it has been slow going, because the problem is not very straightforward. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org