From dbb3e8d5da028a6cc4c576c6a0960bcf740cb035 Mon Sep 17 00:00:00 2001 From: Greg Kurz Date: Thu, 14 Jun 2018 23:50:11 +0200 Subject: spapr_cpu_core: convert last snprintf() to g_strdup_printf() Because this is the preferred practice in QEMU. Signed-off-by: Greg Kurz Signed-off-by: David Gibson --- hw/ppc/spapr_cpu_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'hw/ppc') 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; } -- cgit v1.2.3