[libvirt] [PATCH] bhyve: use virDomainDiskDefNew to instead of VIR_ALLOC

Peter Krempa posted 1 patch 5 years, 2 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/e5f36186102fb69f6bce99fc1a597a14dbdea7ce.1550481335.git.pkrempa@redhat.com
src/bhyve/bhyve_parse_command.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
[libvirt] [PATCH] bhyve: use virDomainDiskDefNew to instead of VIR_ALLOC
Posted by Peter Krempa 5 years, 2 months ago
Use the proper function to allocate a disk definition.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/bhyve/bhyve_parse_command.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] bhyve: use virDomainDiskDefNew to instead of VIR_ALLOC
Posted by Erik Skultety 5 years, 2 months ago
On Mon, Feb 18, 2019 at 10:15:35AM +0100, Peter Krempa wrote:
> Use the proper function to allocate a disk definition.
>
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
Reviewed-by: Erik Skultety <eskultet@redhat.com>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list