bhyve: use virDomainDiskDefNew to instead of VIR_ALLOC

Use the proper function to allocate a disk definition.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
Peter Krempa 2019-02-18 10:12:24 +01:00
parent 0624ac3fa8
commit 84966103be

View 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;