Use the accessors instead.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/util/virqemu.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/util/virqemu.c b/src/util/virqemu.c
index e7ea068b94..d6652262fe 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);
--
2.16.2