mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-05 08:23:48 +00:00
qemu: monitor_json: Replace virJSONValueObjectCreate by virJSONValueObjectAdd
virJSONValueObjectAdd now works identically to virJSONValueObjectCreate when used with a NULL argument. Replace all callers. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
8de1edd5c7
commit
d7ea3fe7f4
@ -511,9 +511,9 @@ qemuMonitorJSONTransactionAdd(virJSONValue *actions,
|
|||||||
|
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
if (virJSONValueObjectCreate(&entry,
|
if (virJSONValueObjectAdd(&entry,
|
||||||
"s:type", cmdname,
|
"s:type", cmdname,
|
||||||
"A:data", &data, NULL) < 0)
|
"A:data", &data, NULL) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virJSONValueArrayAppend(actions, &entry) < 0)
|
if (virJSONValueArrayAppend(actions, &entry) < 0)
|
||||||
@ -538,9 +538,9 @@ qemuMonitorJSONMakeCommandInternal(const char *cmdname,
|
|||||||
{
|
{
|
||||||
virJSONValue *ret = NULL;
|
virJSONValue *ret = NULL;
|
||||||
|
|
||||||
ignore_value(virJSONValueObjectCreate(&ret,
|
ignore_value(virJSONValueObjectAdd(&ret,
|
||||||
"s:execute", cmdname,
|
"s:execute", cmdname,
|
||||||
"A:arguments", arguments, NULL));
|
"A:arguments", arguments, NULL));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -3608,7 +3608,7 @@ int qemuMonitorJSONAddFileHandleToSet(qemuMonitor *mon,
|
|||||||
g_autoptr(virJSONValue) reply = NULL;
|
g_autoptr(virJSONValue) reply = NULL;
|
||||||
g_autoptr(virJSONValue) cmd = NULL;
|
g_autoptr(virJSONValue) cmd = NULL;
|
||||||
|
|
||||||
if (virJSONValueObjectCreate(&args, "S:opaque", opaque, NULL) < 0)
|
if (virJSONValueObjectAdd(&args, "S:opaque", opaque, NULL) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (fdset >= 0 &&
|
if (fdset >= 0 &&
|
||||||
@ -6418,12 +6418,16 @@ qemuMonitorJSONBuildInetSocketAddress(const char *host,
|
|||||||
g_autoptr(virJSONValue) addr = NULL;
|
g_autoptr(virJSONValue) addr = NULL;
|
||||||
g_autoptr(virJSONValue) data = NULL;
|
g_autoptr(virJSONValue) data = NULL;
|
||||||
|
|
||||||
if (virJSONValueObjectCreate(&data, "s:host", host,
|
if (virJSONValueObjectAdd(&data,
|
||||||
"s:port", port, NULL) < 0)
|
"s:host", host,
|
||||||
|
"s:port", port,
|
||||||
|
NULL) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (virJSONValueObjectCreate(&addr, "s:type", "inet",
|
if (virJSONValueObjectAdd(&addr,
|
||||||
"a:data", &data, NULL) < 0)
|
"s:type", "inet",
|
||||||
|
"a:data", &data,
|
||||||
|
NULL) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return g_steal_pointer(&addr);
|
return g_steal_pointer(&addr);
|
||||||
@ -6435,11 +6439,12 @@ qemuMonitorJSONBuildUnixSocketAddress(const char *path)
|
|||||||
g_autoptr(virJSONValue) addr = NULL;
|
g_autoptr(virJSONValue) addr = NULL;
|
||||||
g_autoptr(virJSONValue) data = NULL;
|
g_autoptr(virJSONValue) data = NULL;
|
||||||
|
|
||||||
if (virJSONValueObjectCreate(&data, "s:path", path, NULL) < 0)
|
if (virJSONValueObjectAdd(&data, "s:path", path, NULL) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (virJSONValueObjectCreate(&addr, "s:type", "unix",
|
if (virJSONValueObjectAdd(&addr,
|
||||||
"a:data", &data, NULL) < 0)
|
"s:type", "unix",
|
||||||
|
"a:data", &data, NULL) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return g_steal_pointer(&addr);
|
return g_steal_pointer(&addr);
|
||||||
@ -8340,10 +8345,10 @@ qemuMonitorJSONTransactionBitmapMergeSourceAddBitmap(virJSONValue *sources,
|
|||||||
{
|
{
|
||||||
g_autoptr(virJSONValue) sourceobj = NULL;
|
g_autoptr(virJSONValue) sourceobj = NULL;
|
||||||
|
|
||||||
if (virJSONValueObjectCreate(&sourceobj,
|
if (virJSONValueObjectAdd(&sourceobj,
|
||||||
"s:node", sourcenode,
|
"s:node", sourcenode,
|
||||||
"s:name", sourcebitmap,
|
"s:name", sourcebitmap,
|
||||||
NULL) < 0)
|
NULL) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virJSONValueArrayAppend(sources, &sourceobj) < 0)
|
if (virJSONValueArrayAppend(sources, &sourceobj) < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user