[libvirt] [PATCH 1/3] vmx: Use the allocator virDomainChrDefNew
John Ferlan
jferlan at redhat.com
Fri Oct 21 13:01:42 UTC 2016
Rather than VIR_ALLOC of the virDomainChrDefPtr
Signed-off-by: John Ferlan <jferlan at redhat.com>
---
src/vmx/vmx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index fc4347f..f61c4d6 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -2758,7 +2758,7 @@ virVMXParseSerial(virVMXContext *ctx, virConfPtr conf, int port,
return -1;
}
- if (VIR_ALLOC(*def) < 0)
+ if (!(*def = virDomainChrDefNew(NULL)))
return -1;
(*def)->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL;
@@ -2946,7 +2946,7 @@ virVMXParseParallel(virVMXContext *ctx, virConfPtr conf, int port,
return -1;
}
- if (VIR_ALLOC(*def) < 0)
+ if (!(*def = virDomainChrDefNew(NULL)))
return -1;
(*def)->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL;
--
2.7.4
More information about the libvir-list
mailing list