Skip to contentSkip to conversation

qemu-img: fix invalid JSON

PATCH Applied Paolo Bonzini 3 participants 3 messages Sep 11, 2013 – Sep 12, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu-img: fix invalid JSON

Single quotes for JSON are a QMP-ism, use real JSON in qemu-img output.

---
 qemu-img.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-img.c +1 -1
index 3e5e388..626365d 100644
@@ -1842,7 +1842,7 @@ static void dump_map_entry(OutputFormat output_format, MapEntry *e,
                (e->flags & BDRV_BLOCK_ZERO) ? "true" : "false",
                (e->flags & BDRV_BLOCK_DATA) ? "true" : "false");
         if (e->flags & BDRV_BLOCK_OFFSET_VALID) {
-            printf(", 'offset': %"PRId64"", e->offset);
+            printf(", \"offset\": %"PRId64"", e->offset);
         }
         putchar('}');
 
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Paolo Bonzini

Single quotes for JSON are a QMP-ism, use real JSON in qemu-img output.

---
 qemu-img.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines
qemu-img.c +1 -1
index 3e5e388..626365d 100644
@@ -1842,7 +1842,7 @@ static void dump_map_entry(OutputFormat output_format, MapEntry *e,
                (e->flags & BDRV_BLOCK_ZERO) ? "true" : "false",
                (e->flags & BDRV_BLOCK_DATA) ? "true" : "false");
         if (e->flags & BDRV_BLOCK_OFFSET_VALID) {
-            printf(", 'offset': %"PRId64"", e->offset);
+            printf(", \"offset\": %"PRId64"", e->offset);
         }
         putchar('}');
 
Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org