[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 106/106] qapi/string-output-visitor: fix bugs
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v2 106/106] qapi/string-output-visitor: fix bugs |
Date: |
Wed, 18 Jun 2014 19:22:39 +0300 |
in human mode, we are creating the string:
16-31 (16-31)
instead of
16-17 (10-1f)
because we forgot to pass 'true' as the human parameter on one of the
two calls to format_string.
Also, this is a worsening of quality; previously we would produce
16 (0x10)
to make it obvious which number was hex.
Fix these issues.
Reported-by: Eric Blake <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
qapi/string-output-visitor.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/qapi/string-output-visitor.c b/qapi/string-output-visitor.c
index 8735b00..e9aca3b 100644
--- a/qapi/string-output-visitor.c
+++ b/qapi/string-output-visitor.c
@@ -98,7 +98,7 @@ static void format_string(StringOutputVisitor *sov, Range *r,
bool next,
{
if (r->end - r->begin > 1) {
if (human) {
- g_string_append_printf(sov->string, "%" PRIx64 "-%" PRIx64,
+ g_string_append_printf(sov->string, "0x%" PRIx64 "-%" PRIx64,
r->begin, r->end - 1);
} else {
@@ -107,7 +107,7 @@ static void format_string(StringOutputVisitor *sov, Range
*r, bool next,
}
} else {
if (human) {
- g_string_append_printf(sov->string, "%" PRIx64, r->begin);
+ g_string_append_printf(sov->string, "0x%" PRIx64, r->begin);
} else {
g_string_append_printf(sov->string, "%" PRId64, r->begin);
}
@@ -186,7 +186,7 @@ static void print_type_int(Visitor *v, int64_t *obj, const
char *name,
g_string_append(sov->string, " (");
while (l) {
Range *r = l->data;
- format_string(sov, r, l->next != NULL, false);
+ format_string(sov, r, l->next != NULL, true);
l = l->next;
}
g_string_append(sov->string, ")");
--
MST
- [Qemu-devel] [PULL v2 100/106] acpi: implement ospm_status() method for PIIX4/ICH9_LPC devices, (continued)
- [Qemu-devel] [PULL v2 100/106] acpi: implement ospm_status() method for PIIX4/ICH9_LPC devices, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 101/106] qmp: add query-acpi-ospm-status command, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 102/106] qmp: add ACPI_DEVICE_OST event handling, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 104/106] qapi: fix input visitor bugs, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 103/106] acpi: rephrase comment, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 019/106] acpi: rename cpu_hotplug_defs.h to pc-hotplug.h, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 016/106] pc: add memory hotplug handler to PC_MACHINE, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 077/106] memory: add error propagation to file-based RAM allocation, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 040/106] migration: export SELF_ANNOUNCE_ROUNDS, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 078/106] vl: redo -object parsing, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 106/106] qapi/string-output-visitor: fix bugs,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v2 074/106] qom: introduce object_property_get_enum and object_property_get_uint16List, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 006/106] vl.c: extend -m option to support options for memory hotplug, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 020/106] acpi: memory hotplug ACPI hardware implementation, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 017/106] pc-dimm: add busy address check and address auto-allocation, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 008/106] qdev: expose DeviceState.hotplugged field as a property, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 048/106] vhost: add vhost_get_features and vhost_ack_features, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 076/106] memory: move mem_path handling to memory_region_allocate_system_memory, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 037/106] virtio: Drop superfluous conditionals around g_strdup(), Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 072/106] configure: add Linux libnuma detection, Michael S. Tsirkin, 2014/06/18
- Re: [Qemu-devel] [PULL v2 000/106] pc, pci, virtio, hotplug fixes, enhancements, Michael S. Tsirkin, 2014/06/18