shashank rachamalla
2008-Feb-24 14:54 UTC
[Xen-users] Problem finding Block device statistics for a Xen domU using libvirt API.
I am using fedora core 8 with two domUs installed on xen, CentOS and Fedora Core 6. I manually created a 100MB block disk device and attached it to centos domU using the following set of commands. *creating a block device* dd if=/dev/zero of=/xen/dsk.img bs=1024 count=100000 mke2fs -q /xen/dsk.img *attaching a block device to domain* xm block-attach centOS file:///xen/dsk.img /dev/hdc w I can successfully access the above device in both domU and dom0. The following is the XML description for centos domain fetched using virDomainGetXMLDesc("centos",0); <domain type=''xen'' id=''1''> <name>centOS</name> <uuid>e335a8f8-405d-33f0-5c6a-bac8282c3cb1</uuid> <bootloader>/usr/bin/pygrub</bootloader> <os> <type>linux</type> </os> <memory>204800</memory> <currentMemory>190464</currentMemory> <vcpu>1</vcpu> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <interface type=''bridge''> <source bridge=''virbr0''/> <target dev=''vif1.0''/> <mac address=''00:16:3e:65:56:dc''/> <script path=''vif-bridge''/> </interface> <disk type=''file'' device=''disk''> <driver name=''file''/> <source file=''/var/lib/xen/images/centos.img''/> <target dev=''xvda''/> </disk> <disk type=''file'' device=''disk''> <driver name=''file''/> <source file=''///xen/dsk.img''/> <target dev=''/dev/hdc''/> </disk> <input type=''mouse'' bus=''xen''/> <graphics type=''vnc'' port=''5900'' keymap=''en-us''/> <console tty=''/dev/pts/3''/> </devices> </domain> I am using the function virDomainBlockStats(dom,"xvda",&blstructure,sizebl) to fetch the block statistics where dom is virDomainPtr blstructure is virDomainBlockStatsStruct size_t sizebl=sizeof(blstructure); and i can properly print read/write bytes and requests for "xvda", but if i use "/dev/hdc" in the place of "xvda" i get the following error *libvir: Linux Stats error : this function is not supported by the hypervisor: xenLinuxDomainBlockStats: unsupported path (use xvda, hda, etc.) *I tried using "hdc" but it did not work. * *plz let me know if i am doing anything wrong. Thanks in advance. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users