From: Peter Krempa Date: Wed, 8 Nov 2017 19:44:35 +0000 (+0100) Subject: qemu: parse: Allocate disk definition with private data X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=994c49ac34181cb664b18856df38c2f5c326ff03;p=libvirt.git qemu: parse: Allocate disk definition with private data Use virDomainDiskDefNew instead of VIR_ALLOC in qemuParseCommandLineDisk. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1510781 --- diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c index 5333163850..c7c7bba032 100644 --- a/src/qemu/qemu_parse_command.c +++ b/src/qemu/qemu_parse_command.c @@ -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;