Description of problem: (Reported by muued on IRC) $ sudo virt-df -a /dev/vg_pin/Debian5x64 -a /dev/vg_pin/WinXP Filesystem 1K-blocks Used Available Use% WinXP:/dev/sda1 329679 67325 244787 21% WinXP:/dev/sdb1 6281380 2812564 3468816 45% WinXP:/dev/debian5x64.home.annexia.org/home 3555936 365544 3009760 11% WinXP:/dev/debian5x64.home.annexia.org/root 329233 309786 2449 95% WinXP:/dev/debian5x64.home.annexia.org/tmp 309401 10292 283135 4% WinXP:/dev/debian5x64.home.annexia.org/usr 3539776 2089124 1270840 60% WinXP:/dev/debian5x64.home.annexia.org/var 2774352 2088408 548332 76% Version-Release number of selected component (if applicable): libguestfs 1.18.10 libguestfs 1.19.64 How reproducible: 100% Steps to Reproduce: 1. Run virt-df with two -a options.
Strictly speaking (reading the man page), this is an incorrect use of virt-df: "If any -a or -d arguments are specified, "virt-df" performs a "df"-type operation on either the single named libvirt domain, or on the disk image(s) listed on the command line (which must all belong to a single VM). In this mode (with arguments), "virt-df" will only work for a single guest. If you want to run on multiple guests, then you have to invoke "virt-df" multiple times." But: (1) The behaviour is unexpected. We should at least document it more clearly. (2) Using the name of the last disk is arbitrary, and wrong. We should use something else here, perhaps both names, or perhaps the first name plus '*', or an explanatory string.
Note also, the same thing can happen if the user uses the -d option multiple times: $ sudo virt-df -d F17x64 -d F19Rawhidex32 Filesystem 1K-blocks Used Available Use% F19Rawhidex32:/dev/sda1 495844 97005 373239 20% F19Rawhidex32:/dev/sdb1 495844 96275 373969 20% F19Rawhidex32:/dev/sdb3 26894392 3714140 21814084 14% F19Rawhidex32:/dev/vg_f17x64/lv_root 28447752 5318808 21683876 19% Roughly the same code in main.c:282 is involved.
Also the --help output and SYNOPSIS in the man page is less than clear on this issue.
Upstream fix here: https://github.com/libguestfs/libguestfs/commit/9e7daf2ee8f0a619440ca1c55dfe5ddcf61b4460