On Thu, Jun 05, 2008 at 07:42:10PM +0100, Richard W.M. Jones wrote:
This patch adds support for virDomainBlockPeek over remote.
Also adds a QEMU driver implementation.
Also there is a minor fix in the Xen driver impl.
The latest virt-df has been updated to use this call, with the remote
& QEMU support, so I'm confident this is at least somewhat working. A
trace of virt-df running with LIBVIRT_DEBUG=1 is below.
Rich.
----------------------------------------------------------------------
$ LIBVIRT_DEBUG=1 ./virt-df/virt-df.opt -a -h
DEBUG: libvirt.c: virInitialize (register drivers)
DEBUG: libvirt.c: virConnectOpenReadOnly (name=(null))
DEBUG: libvirt.c: do_open (Probed qemu:///session)
DEBUG: libvirt.c: do_open (Using qemu:///session as default URI, 1 hypervisor found)
DEBUG: libvirt.c: do_open (name "qemu:///session" to URI components:
scheme qemu
opaque (null)
authority (null)
server (null)
user (null)
port 0
path /session
)
DEBUG: libvirt.c: do_open (trying driver 0 (Test) ...)
DEBUG: libvirt.c: do_open (driver 0 Test returned DECLINED)
DEBUG: libvirt.c: do_open (trying driver 1 (QEMU) ...)
DEBUG: libvirt.c: do_open (driver 1 QEMU returned DECLINED)
DEBUG: libvirt.c: do_open (trying driver 2 (Xen) ...)
DEBUG: libvirt.c: do_open (driver 2 Xen returned DECLINED)
DEBUG: libvirt.c: do_open (trying driver 3 (remote) ...)
DEBUG: remote_internal.c: doRemoteOpen (proceeding with name = qemu:///session)
DEBUG: libvirt.c: do_open (driver 3 remote returned SUCCESS)
DEBUG: libvirt.c: do_open (network driver 0 Test returned DECLINED)
DEBUG: libvirt.c: do_open (network driver 1 QEMU returned DECLINED)
DEBUG: libvirt.c: do_open (network driver 2 remote returned SUCCESS)
DEBUG: libvirt.c: do_open (storage driver 0 Test returned DECLINED)
DEBUG: libvirt.c: do_open (storage driver 1 remote returned SUCCESS)
DEBUG: libvirt.c: virConnectNumOfDomains (conn=0x6d69e0)
DEBUG: libvirt.c: virConnectListDomains (conn=0x6d69e0, ids=0x7fff3eb3fd50, maxids=0)
DEBUG: libvirt.c: virConnectNumOfDefinedDomains (conn=0x6d69e0)
DEBUG: libvirt.c: virConnectListDefinedDomains (conn=0x6d69e0, names=0x7fff3eb3fd30,
maxnames=1)
DEBUG: libvirt.c: virDomainLookupByName (conn=0x6d69e0, name=rhel51x32kvm)
DEBUG: hash.c: __virGetDomain (New hash entry 0x6d7dc0)
DEBUG: libvirt.c: virDomainGetXMLDesc (domain=0x6d7dc0, flags=0)
DEBUG: libvirt.c: virDomainBlockPeek (domain=0x6d7dc0,
path=/var/lib/xen/images/rhel51x32kvm.img, offset=0, size=0, buffer=0x683290)
DEBUG: libvirt.c: virDomainBlockPeek (domain=0x6d7dc0,
path=/var/lib/xen/images/rhel51x32kvm.img, offset=0, size=512, buffer=0x2aaaaad87230)
DEBUG: libvirt.c: virDomainBlockPeek (domain=0x6d7dc0,
path=/var/lib/xen/images/rhel51x32kvm.img, offset=33280, size=1024,
buffer=0x2aaaaad84320)
DEBUG: libvirt.c: virDomainBlockPeek (domain=0x6d7dc0,
path=/var/lib/xen/images/rhel51x32kvm.img, offset=106929664, size=1024,
buffer=0x2aaaaad7f9a0)
DEBUG: libvirt.c: virDomainBlockPeek (domain=0x6d7dc0,
path=/var/lib/xen/images/rhel51x32kvm.img, offset=106928640, size=4096,
buffer=0x2aaaaae24f80)
DEBUG: libvirt.c: virDomainBlockPeek (domain=0x6d7dc0,
path=/var/lib/xen/images/rhel51x32kvm.img, offset=106928640, size=4096,
buffer=0x2aaaaae23f70)
DEBUG: libvirt.c: virDomainBlockPeek (domain=0x6d7dc0,
path=/var/lib/xen/images/rhel51x32kvm.img, offset=106928640, size=512,
buffer=0x2aaaaad7db98)
DEBUG: libvirt.c: virDomainBlockPeek (domain=0x6d7dc0,
path=/var/lib/xen/images/rhel51x32kvm.img, offset=106928640, size=512,
buffer=0x2aaaaad7d808)
DEBUG: libvirt.c: virDomainBlockPeek (domain=0x6d7dc0,
path=/var/lib/xen/images/rhel51x32kvm.img, offset=106928640, size=4608,
buffer=0x2aaaaae22d60)
DEBUG: libvirt.c: virDomainBlockPeek (domain=0x6d7dc0,
path=/var/lib/xen/images/rhel51x32kvm.img, offset=106928640, size=4608,
buffer=0x2aaaaae21b50)
DEBUG: libvirt.c: virDomainBlockPeek (domain=0x6d7dc0,
path=/var/lib/xen/images/rhel51x32kvm.img, offset=106935296, size=1114,
buffer=0x2aaaaad7bf98)
DEBUG: libvirt.c: virDomainBlockPeek (domain=0x6d7dc0,
path=/var/lib/xen/images/rhel51x32kvm.img, offset=107126272, size=1024,
buffer=0x2aaaaad714d8)
DEBUG: libvirt.c: virDomainBlockPeek (domain=0x6d7dc0,
path=/var/lib/xen/images/rhel51x32kvm.img, offset=7321329152, size=1024,
buffer=0x2aaaaad6c240)
DEBUG: libvirt.c: virDomainBlockPeek (domain=0x6d7dc0,
path=/var/lib/xen/images/rhel51x32kvm.img, offset=7321328128, size=4096,
buffer=0x2aaaaae143e0)
Filesystem Size Used Available Type
rhel51x32kvm:hda1 96.8 MiB 14.6 MiB 82.2 MiB Linux ext2/3
rhel51x32kvm:VolGroup00/LogVol00 6.4 GiB 3.6 GiB 2.8 GiB Linux ext2/3
rhel51x32kvm:VolGroup00/LogVol01 992.0 MiB Linux swap
----------------------------------------------------------------------
--
Richard Jones, Emerging Technologies, Red Hat
http://et.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/