{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
+ virJSONValue *data;
*strList = NULL;
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
return -1;
- if (qemuMonitorJSONCheckReply(cmd, reply, VIR_JSON_TYPE_ARRAY) < 0)
+ if (!(data = qemuMonitorJSONGetReply(cmd, reply, VIR_JSON_TYPE_ARRAY)))
return -1;
- if (!(*strList = virJSONValueObjectGetStringArray(reply, "return")))
+ if (!(*strList = virJSONValueArrayToStringList(data)))
return -1;
return 0;
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
+ virJSONValue *data;
*array = NULL;
if (qemuMonitorJSONHasError(reply, "CommandNotFound"))
return 0;
- if (qemuMonitorJSONCheckReply(cmd, reply, VIR_JSON_TYPE_ARRAY) < 0)
+ if (!(data = qemuMonitorJSONGetReply(cmd, reply, VIR_JSON_TYPE_ARRAY)))
return -1;
- if (!(*array = virJSONValueObjectGetStringArray(reply, "return")))
+ if (!(*array = virJSONValueArrayToStringList(data)))
return -1;
return 0;