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

Eric Blake eblake at redhat.com
Thu Sep 8 09:43:02 UTC 2011


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 at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




More information about the libvir-list mailing list