On 20/04/2022 13.57, Pierre Morel wrote:
Let's add STSI support for the container level 3, books, and provide the information back to the guest. Signed-off-by: Pierre Morel <pmorel@xxxxxxxxxxxxx> ---
...
+static char *drawer_bus_get_dev_path(DeviceState *dev) +{ + S390TopologyDrawer *drawer = S390_TOPOLOGY_DRAWER(dev); + DeviceState *node = dev->parent_bus->parent; + char *id = qdev_get_dev_path(node); + char *ret; + + if (id) { + ret = g_strdup_printf("%s:%02d", id, drawer->drawer_id); + g_free(id); + } else { + ret = g_malloc(6); + snprintf(ret, 6, "_:%02d", drawer->drawer_id);
Please use g_strdup_printf() here as well. Thomas
+ } + + return ret; +}