From: Peter Krempa Date: Mon, 18 Feb 2019 09:12:24 +0000 (+0100) Subject: bhyve: use virDomainDiskDefNew to instead of VIR_ALLOC X-Git-Tag: v5.1.0-rc1~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84966103bedae06fc1a26d1b485bf12ba7667f2e;p=thirdparty%2Flibvirt.git bhyve: use virDomainDiskDefNew to instead of VIR_ALLOC Use the proper function to allocate a disk definition. Signed-off-by: Peter Krempa Reviewed-by: Erik Skultety --- diff --git a/src/bhyve/bhyve_parse_command.c b/src/bhyve/bhyve_parse_command.c index 1c9191fb96..bd93070dfb 100644 --- a/src/bhyve/bhyve_parse_command.c +++ b/src/bhyve/bhyve_parse_command.c @@ -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;