diff options
author | Greg Kurz <groug@kaod.org> | 2018-06-14 23:50:11 +0200 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2018-06-16 16:32:33 +1000 |
commit | dbb3e8d5da028a6cc4c576c6a0960bcf740cb035 (patch) | |
tree | 96c7c5ac5602d1c1c55cc68838ef9a95b24e03e4 /hw/ppc | |
parent | 5e22e29201d80124bca0124f2034e72b698cbb6f (diff) |
spapr_cpu_core: convert last snprintf() to g_strdup_printf()
Because this is the preferred practice in QEMU.
Signed-off-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc')
-rw-r--r-- | hw/ppc/spapr_cpu_core.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index 7fdb3b6667..ad404d13ec 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -176,7 +176,7 @@ static void spapr_cpu_core_realize(DeviceState *dev, Error **errp) sc->threads = g_new(PowerPCCPU *, cc->nr_threads); for (i = 0; i < cc->nr_threads; i++) { - char id[32]; + char *id; CPUState *cs; PowerPCCPU *cpu; @@ -194,8 +194,9 @@ static void spapr_cpu_core_realize(DeviceState *dev, Error **errp) /* Set NUMA node for the threads belonged to core */ cpu->node_id = sc->node_id; - snprintf(id, sizeof(id), "thread[%d]", i); + id = g_strdup_printf("thread[%d]", i); object_property_add_child(OBJECT(sc), id, obj, &local_err); + g_free(id); if (local_err) { goto err; } |