Commit aca312affb616a907ae95eb7d9034e85512d6e7c

Authored by Gerd Hoffmann
Committed by Paul Brook
1 parent 1e9fa730

qdev: kill DeviceState->name

is redundant with DeviceState->type->name

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Showing 2 changed files with 1 additions and 3 deletions
hw/qdev.c
@@ -84,7 +84,6 @@ DeviceState *qdev_create(BusState *bus, const char *name) @@ -84,7 +84,6 @@ DeviceState *qdev_create(BusState *bus, const char *name)
84 } 84 }
85 85
86 dev = qemu_mallocz(t->size); 86 dev = qemu_mallocz(t->size);
87 - dev->name = name;  
88 dev->type = t; 87 dev->type = t;
89 88
90 if (!bus) { 89 if (!bus) {
@@ -162,7 +161,7 @@ CharDriverState *qdev_init_chardev(DeviceState *dev) @@ -162,7 +161,7 @@ CharDriverState *qdev_init_chardev(DeviceState *dev)
162 static int next_serial; 161 static int next_serial;
163 static int next_virtconsole; 162 static int next_virtconsole;
164 /* FIXME: This is a nasty hack that needs to go away. */ 163 /* FIXME: This is a nasty hack that needs to go away. */
165 - if (strncmp(dev->name, "virtio", 6) == 0) { 164 + if (strncmp(dev->type->name, "virtio", 6) == 0) {
166 return virtcon_hds[next_virtconsole++]; 165 return virtcon_hds[next_virtconsole++];
167 } else { 166 } else {
168 return serial_hds[next_serial++]; 167 return serial_hds[next_serial++];
hw/qdev.h
@@ -13,7 +13,6 @@ typedef struct BusState BusState; @@ -13,7 +13,6 @@ typedef struct BusState BusState;
13 /* This structure should not be accessed directly. We declare it here 13 /* This structure should not be accessed directly. We declare it here
14 so that it can be embedded in individual device state structures. */ 14 so that it can be embedded in individual device state structures. */
15 struct DeviceState { 15 struct DeviceState {
16 - const char *name;  
17 DeviceType *type; 16 DeviceType *type;
18 BusState *parent_bus; 17 BusState *parent_bus;
19 DeviceProperty *props; 18 DeviceProperty *props;