]> xenbits.xensource.com Git - libvirt.git/commitdiff
bhyve: use virDomainDiskDefNew to instead of VIR_ALLOC
authorPeter Krempa <pkrempa@redhat.com>
Mon, 18 Feb 2019 09:12:24 +0000 (10:12 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 18 Feb 2019 09:27:30 +0000 (10:27 +0100)
Use the proper function to allocate a disk definition.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
src/bhyve/bhyve_parse_command.c

index 1c9191fb9606ac7e678dd1865b6c678aba3f332f..bd93070dfb23716103a11920677825d9d6e7688b 100644 (file)
@@ -430,10 +430,8 @@ bhyveParsePCIDisk(virDomainDefPtr def,
     int idx = -1;
     virDomainDiskDefPtr disk = NULL;
 
-    if (VIR_ALLOC(disk) < 0)
+    if (!(disk = virDomainDiskDefNew(NULL)))
         goto cleanup;
-    if (VIR_ALLOC(disk->src) < 0)
-        goto error;
 
     disk->bus = bus;
     disk->device = device;