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>
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);