Re: [PATCHv2] blockinfo: fix qemu regression in handling disk name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/08/2011 10:29 AM, Michal Privoznik wrote:
On 08.09.2011 11:12, Eric Blake wrote:
Regression introduced in commit 89b6284fd, due to an incorrect
conversion to the new means of converting disk names back to
the correct object.

-    path = actual;
+    disk = vm->def->disks[i];

      /* The path is correct, now try to open it and get its size. */
      fd = open(path, O_RDONLY);

In fact, we need to update path as well, beacuse we use it later (as can
be seen in context. but that is not the only place).

Ouch; you're right.  I'm squashing this in:

diff --git i/src/qemu/qemu_driver.c w/src/qemu/qemu_driver.c
index f73270f..b94d1c4 100644
--- i/src/qemu/qemu_driver.c
+++ w/src/qemu/qemu_driver.c
@@ -7784,6 +7784,13 @@ static int qemuDomainGetBlockInfo(virDomainPtr dom,
         goto cleanup;
     }
     disk = vm->def->disks[i];
+    if (!disk->src) {
+        qemuReportError(VIR_ERR_INVALID_ARG,
+ _("disk %s does not currently have a source assigned"),
+                        path);
+        goto cleanup;
+    }
+    path = disk->src;

     /* The path is correct, now try to open it and get its size. */
     fd = open(path, O_RDONLY);



so ACK with this nit fixed.

and pushing.

--
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]