Commit aca312affb616a907ae95eb7d9034e85512d6e7c
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 | 84 | } |
85 | 85 | |
86 | 86 | dev = qemu_mallocz(t->size); |
87 | - dev->name = name; | |
88 | 87 | dev->type = t; |
89 | 88 | |
90 | 89 | if (!bus) { |
... | ... | @@ -162,7 +161,7 @@ CharDriverState *qdev_init_chardev(DeviceState *dev) |
162 | 161 | static int next_serial; |
163 | 162 | static int next_virtconsole; |
164 | 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 | 165 | return virtcon_hds[next_virtconsole++]; |
167 | 166 | } else { |
168 | 167 | return serial_hds[next_serial++]; | ... | ... |
hw/qdev.h
... | ... | @@ -13,7 +13,6 @@ typedef struct BusState BusState; |
13 | 13 | /* This structure should not be accessed directly. We declare it here |
14 | 14 | so that it can be embedded in individual device state structures. */ |
15 | 15 | struct DeviceState { |
16 | - const char *name; | |
17 | 16 | DeviceType *type; |
18 | 17 | BusState *parent_bus; |
19 | 18 | DeviceProperty *props; | ... | ... |