qemuMonitorJSONAddObject: Take double pointer for @props

Prepare for a refactor of qemuMonitorJSONMakeCommandInternal.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2020-11-30 15:32:14 +01:00
parent 812b0e9122
commit f18f4031b1
3 changed files with 5 additions and 5 deletions

View File

@ -3078,8 +3078,7 @@ qemuMonitorAddObject(qemuMonitorPtr mon,
if (alias)
tmp = g_strdup(id);
ret = qemuMonitorJSONAddObject(mon, *props);
*props = NULL;
ret = qemuMonitorJSONAddObject(mon, props);
if (alias)
*alias = g_steal_pointer(&tmp);

View File

@ -4593,12 +4593,13 @@ qemuMonitorJSONAddDevice(qemuMonitorPtr mon,
int
qemuMonitorJSONAddObject(qemuMonitorPtr mon,
virJSONValuePtr props)
virJSONValuePtr *props)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
virJSONValuePtr pr = g_steal_pointer(props);
if (!(cmd = qemuMonitorJSONMakeCommandInternal("object-add", props)))
if (!(cmd = qemuMonitorJSONMakeCommandInternal("object-add", pr)))
return -1;
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)

View File

@ -244,7 +244,7 @@ int qemuMonitorJSONDelDevice(qemuMonitorPtr mon,
const char *devalias);
int qemuMonitorJSONAddObject(qemuMonitorPtr mon,
virJSONValuePtr props);
virJSONValuePtr *props);
int qemuMonitorJSONDelObject(qemuMonitorPtr mon,
const char *objalias,