[libvirt-users] bug in Libvirt(-python)?

Dennis Jacobfeuerborn dennisml at conversis.de
Tue Feb 16 17:55:44 UTC 2016

I've noticed that the capacity of the disk in one of my VMs is
completely wrongly reported by the python api. The image was transfered
using scp but the transfer was aborted and now the api show a strange value:

[root at virt83 ~]# du -h /var/lib/libvirt/images/test-disk1
706M	/var/lib/libvirt/images/test-disk1
[root at virt83 ~]# ls -lh /var/lib/libvirt/images/test-disk1
-rw-r--r--. 1 root root 706M  3. Nov 20:03
[root at virt83 ~]# qemu-img info /var/lib/libvirt/images/test-disk1
image: /var/lib/libvirt/images/test-disk1
file format: raw
virtual size: 705M (739573760 bytes)
disk size: 705M

Notice how that raw image is seen with a size of 705M by ls, du and
qemu-img however when I get a blockinfo using libvirt-python using the
blockInfo() call I get this:

{'source': '/var/lib/libvirt/images/test-disk1', 'target': 'vda'}
[2423276348619671841L, 739577856L, 739577856L]

Obviously the first value (capacity) is way too large to be correct.
Any ideas if this is a bug or if there is something else going on?

This is a CentOS 7 system with the following versions:

[root at virt83 ~]# cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
[root at virt83 ~]# rpm -q libvirt
[root at virt83 ~]# rpm -q libvirt-python


More information about the libvirt-users mailing list