Description of problem: I need a robust, reliable way to determine if a particular block device is a logical volume when inspecting a guest. This rules out methods based on path name inspection, as these paths can be changed by configuration and vary between distributions. My chosen solution to this problem is to stat every device returned by lvs(), and to stat the target device, and test if the major and minor numbers of the target appear in the list returned by lvs(). This avoid any issues relating to path names. However, it is complicated because stat() doesn't chroot, and therefore you can't stat a device node. I'm doing sh("stat...") to work round this, which is ugly. I don't know what the best approach to this is. It could be a new is_lvm_device(dev), a change to the existing stat() api to work on device nodes, a new api to stat device nodes(), or something else. However, I'm slightly concerned that this use case is quite esoteric. I can't think of any previous occasion using libguestfs or otherwise when I have been concerned to know whether or not a block device is a logical volume. The high-level api may be extremely under-used, meaning an implementation in virt-v2v is more appropriate. Version-Release number of selected component (if applicable): libguestfs-1.5.0-4.fc13.x86_64
Patch posted upstream: https://www.redhat.com/archives/libguestfs/2010-July/msg00086.html
Pushed upstream: http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=6280ac9b987c14f89749b4b4fdfec5a647567432 Matt, you'd better clone this bug for RHEL 6.