mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-18 10:35:20 +00:00
qemuMonitorAddObject: Fix semantics of @alias
The callers of qemuMonitorAddObject rely on the fact that @alias is filled only when the object is added successfully. This is documented but the code didn't behave like that. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
83e1d8fb97
commit
64cf9b0fa7
@ -3078,11 +3078,14 @@ qemuMonitorAddObject(qemuMonitorPtr mon,
|
||||
if (alias)
|
||||
tmp = g_strdup(id);
|
||||
|
||||
ret = qemuMonitorJSONAddObject(mon, props);
|
||||
if (qemuMonitorJSONAddObject(mon, props) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (alias)
|
||||
*alias = g_steal_pointer(&tmp);
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(tmp);
|
||||
virJSONValueFree(*props);
|
||||
|
Loading…
x
Reference in New Issue
Block a user