render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
c1c534
From 53806054c0b1b7ee2c8df5e46fa18b87aaee1ca1 Mon Sep 17 00:00:00 2001
c1c534
Message-Id: <53806054c0b1b7ee2c8df5e46fa18b87aaee1ca1@dist-git>
c1c534
From: Peter Krempa <pkrempa@redhat.com>
c1c534
Date: Mon, 13 Nov 2017 13:37:52 +0100
c1c534
Subject: [PATCH] qemu: parse: Allocate disk definition with private data
c1c534
c1c534
Use virDomainDiskDefNew instead of VIR_ALLOC in
c1c534
qemuParseCommandLineDisk.
c1c534
c1c534
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1510781
c1c534
(cherry picked from commit 994c49ac34181cb664b18856df38c2f5c326ff03)
c1c534
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c1c534
---
c1c534
 src/qemu/qemu_parse_command.c | 4 +---
c1c534
 1 file changed, 1 insertion(+), 3 deletions(-)
c1c534
c1c534
diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c
c1c534
index 649c3b1ccf..a8d0d7c535 100644
c1c534
--- a/src/qemu/qemu_parse_command.c
c1c534
+++ b/src/qemu/qemu_parse_command.c
c1c534
@@ -658,10 +658,8 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
c1c534
                           0) < 0)
c1c534
         return NULL;
c1c534
 
c1c534
-    if (VIR_ALLOC(def) < 0)
c1c534
+    if (!(def = virDomainDiskDefNew(xmlopt)))
c1c534
         goto cleanup;
c1c534
-    if (VIR_ALLOC(def->src) < 0)
c1c534
-        goto error;
c1c534
 
c1c534
     if (qemuDomainIsPSeries(dom))
c1c534
         def->bus = VIR_DOMAIN_DISK_BUS_SCSI;
c1c534
-- 
c1c534
2.15.0
c1c534