diff --git a/src/util/virqemu.c b/src/util/virqemu.c index e7ea068b94f4544191b540d1c55d8fe59672fa43..d6652262fea8fab06bd998365f6de312cf02456d 100644 --- a/src/util/virqemu.c +++ b/src/util/virqemu.c @@ -148,6 +148,7 @@ virQEMUBuildCommandLineJSONRecurse(const char *key, struct virQEMUCommandLineJSONIteratorData data = { key, buf, arrayFunc }; virJSONType type = virJSONValueGetType(value); virJSONValuePtr elem; + bool tmp; size_t i; if (!key && type != VIR_JSON_TYPE_OBJECT) { @@ -159,16 +160,17 @@ virQEMUBuildCommandLineJSONRecurse(const char *key, switch (type) { case VIR_JSON_TYPE_STRING: virBufferAsprintf(buf, "%s=", key); - virQEMUBuildBufferEscapeComma(buf, value->data.string); + virQEMUBuildBufferEscapeComma(buf, virJSONValueGetString(value)); virBufferAddLit(buf, ","); break; case VIR_JSON_TYPE_NUMBER: - virBufferAsprintf(buf, "%s=%s,", key, value->data.number); + virBufferAsprintf(buf, "%s=%s,", key, virJSONValueGetNumberString(value)); break; case VIR_JSON_TYPE_BOOLEAN: - if (value->data.boolean) + virJSONValueGetBoolean(value, &tmp); + if (tmp) virBufferAsprintf(buf, "%s=yes,", key); else virBufferAsprintf(buf, "%s=no,", key);