[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] Is a libvirt connection remote?



What's a good way to ask if a libvirt connection is remote or not?
(Fundamentally I want to know if the disk images are openable as local
files, and I'm using "remote" as an proxy for this property.)

One way might be to compare virConnectGetHostname with the local
hostname.  This would fail if the client and server had the hostname
set incorrectly (eg. "localhost.localdomain").

Another way might be some hairy libvirt URL parsing.

Another way would be to speculatively open the disk images.  This
would fail if the client and server had guests with coincidentally
named disk images.

Or I could write a qemu block driver that could use
virDomainBlockPeek.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]