]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: parse: Allocate disk definition with private data
authorPeter Krempa <pkrempa@redhat.com>
Wed, 8 Nov 2017 19:44:35 +0000 (20:44 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 13 Nov 2017 12:28:49 +0000 (13:28 +0100)
Use virDomainDiskDefNew instead of VIR_ALLOC in
qemuParseCommandLineDisk.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1510781

src/qemu/qemu_parse_command.c

index 5333163850208f80ae62454c037e4cd151395441..c7c7bba0323eb6b93583134ad544254b2ac29fcd 100644 (file)
@@ -658,10 +658,8 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
                           0) < 0)
         return NULL;
 
-    if (VIR_ALLOC(def) < 0)
+    if (!(def = virDomainDiskDefNew(xmlopt)))
         goto cleanup;
-    if (VIR_ALLOC(def->src) < 0)
-        goto error;
 
     if (qemuDomainIsPSeries(dom))
         def->bus = VIR_DOMAIN_DISK_BUS_SCSI;