]> xenbits.xensource.com Git - libvirt.git/commitdiff
GetBlockInfo: Use the correct path to qemuOpenFile
authorJohn Ferlan <jferlan@redhat.com>
Mon, 14 Jul 2014 16:17:44 +0000 (12:17 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 14 Jul 2014 17:19:28 +0000 (13:19 -0400)
Commit id '3ea661de' refactored the code to use the 'disk->src->path'
instead of getting the path from virDomainDiskGetSource().  The one
call to qemuOpenFile() didn't use the disk source path, rather it used
the path as passed from the caller (in this case 'vda') - this caused
a failure with the virt-test/tp-libvirt as follows:

$ virsh domblkinfo virt-tests-vm1 vda
error: cannot stat file '/home/virt-test/shared/data/images/jeos-20-64.qcow2': Bad file descriptor

$

src/qemu/qemu_driver.c

index ecccf6ca098392feecb05f3bceb7e69a901af6f1..8d40bc9d0ee02194bd0ed4e775ee8fe75be27b90 100644 (file)
@@ -10370,7 +10370,8 @@ qemuDomainGetBlockInfo(virDomainPtr dom,
             goto cleanup;
         }
 
-        if ((fd = qemuOpenFile(driver, vm, path, O_RDONLY, NULL, NULL)) == -1)
+        if ((fd = qemuOpenFile(driver, vm, disk->src->path, O_RDONLY,
+                               NULL, NULL)) == -1)
             goto cleanup;
 
         if (fstat(fd, &sb) < 0) {