On Tue, Oct 15, 2019 at 05:34:49PM +0200, Jiri Denemark wrote:
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
Notes:
Version 2:
- no change
src/qemu/qemu_monitor.c | 33 +++++++++++++++++++++++++++++++++
src/qemu/qemu_monitor.h | 2 ++
2 files changed, 35 insertions(+)
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index adb6befe4a..614fee98c1 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -3582,7 +3582,7 @@ int
qemuMonitorCPUDefsCopy(qemuMonitorCPUDefsPtr *dst,
qemuMonitorCPUDefsPtr src)
{
- VIR_AUTOPTR(qemuMonitorCPUDefs) defs = NULL;
+ g_autoptr(qemuMonitorCPUDefs) defs = NULL;
size_t i;
if (!src) {
@@ -3599,14 +3599,11 @@ qemuMonitorCPUDefsCopy(qemuMonitorCPUDefsPtr *dst,
qemuMonitorCPUDefInfoPtr cpuSrc = src->cpus + i;
cpuDst->usable = cpuSrc->usable;
-
- if (VIR_STRDUP(cpuDst->name, cpuSrc->name) < 0 ||
- virStringListCopy(&cpuDst->blockers,
- (const char **)cpuSrc->blockers) < 0)
- return -1;
+ cpuDst->name = g_strdup(cpuSrc->name);
+ cpuDst->blockers = g_strdupv(cpuSrc->blockers);
}
- VIR_STEAL_PTR(*dst, defs);
+ *dst = g_steal_pointer(&defs);
return 0;
}