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.

Backports commit f73480c36f49562556b80bb5bf8acc45e20dcca1 from qemu
This commit is contained in:
Marc-André Lureau 2018-03-09 13:02:06 -05:00 committed by Lioncash
parent af3cd62c4b
commit 9ec040b74d
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -202,7 +202,7 @@ typedef struct BusChild {
struct BusState {
Object obj;
DeviceState *parent;
const char *name;
char *name;
int max_index;
bool realized;
QTAILQ_HEAD(ChildrenHead, BusChild) children;