bus: simplify name handling

Simplify a bit the code by using g_strdup_printf() and store it in a
non-const value so casting is no longer needed, and ownership is
clearer.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Marc-André Lureau 2016-07-15 12:04:49 +02:00
parent e9529768d4
commit f73480c36f
2 changed files with 7 additions and 16 deletions

View file

@ -224,7 +224,7 @@ typedef struct BusChild {
struct BusState {
Object obj;
DeviceState *parent;
const char *name;
char *name;
HotplugHandler *hotplug_handler;
int max_index;
bool realized;