mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-08-24 09:49:59 +03:00
qemumonitorjsontest: use virCPUDefNew()
virCPUDefPtr uses refcounting internally and must be allocated using virCPUDefNew, otherwise virCPUDefFree would be a no-op. Signed-off-by: Ján Tomko <jtomko@redhat.com> Fixes:fa2404bf4f
Fixes:eee09435ee
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
@ -2993,8 +2993,8 @@ testQemuMonitorJSONqemuMonitorJSONGetCPUModelComparison(const void *opaque)
|
|||||||
"{\"return\":{\"result\":\"test\"}}") < 0)
|
"{\"return\":{\"result\":\"test\"}}") < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (VIR_ALLOC(cpu_a) < 0 || VIR_ALLOC(cpu_b) < 0)
|
cpu_a = virCPUDefNew();
|
||||||
goto cleanup;
|
cpu_b = virCPUDefNew();
|
||||||
|
|
||||||
cpu_a->model = g_strdup("cpu_a");
|
cpu_a->model = g_strdup("cpu_a");
|
||||||
cpu_b->model = g_strdup("cpu_b");
|
cpu_b->model = g_strdup("cpu_b");
|
||||||
@ -3045,8 +3045,8 @@ testQemuMonitorJSONqemuMonitorJSONGetCPUModelBaseline(const void *opaque)
|
|||||||
"}") < 0)
|
"}") < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (VIR_ALLOC(cpu_a) < 0 || VIR_ALLOC(cpu_b) < 0)
|
cpu_a = virCPUDefNew();
|
||||||
goto cleanup;
|
cpu_b = virCPUDefNew();
|
||||||
|
|
||||||
cpu_a->model = g_strdup("cpu_a");
|
cpu_a->model = g_strdup("cpu_a");
|
||||||
cpu_b->model = g_strdup("cpu_b");
|
cpu_b->model = g_strdup("cpu_b");
|
||||||
|
Reference in New Issue
Block a user