mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user