[libvirt-users] vnc port of VM

Eric Blake eblake at redhat.com
Thu Aug 23 06:07:43 UTC 2012


[please drop spurious in-reply-to headers when starting a new thread.
Also, your mailer needs to learn to wrap long lines]

On 08/22/2012 09:57 PM, 张章 wrote:
> 
> hi,all     Does any of you know how to get the vnc port of a running vm through libvirt API instead of virsh vncdisplay ?     I can't find any relevent API from libvirt, many thanks!

Looking at the source code of virsh, 'vncdisplay' boils down to a call
to virDomainGetXMLDesc followed by scraping the XML for the XPath
/domain/devices/graphics[@type='vnc']/@port

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120823/e89d069c/attachment.sig>


More information about the libvirt-users mailing list