Skip to contentSkip to conversation

qdev: kill DeviceState->name

PATCH New Gerd Hoffmann 1 participant 1 message May 28, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qdev: kill DeviceState->name

... it is redundant with DeviceState->type->name

please apply,
Gerd

Quoted 1 line

From 320b8d821fe156ae057ab1dcedb8e8bf1ebf2275 Mon Sep 17 00:00:00 2001

From: Gerd Hoffmann <[email protected]>
Date: Wed, 27 May 2009 22:54:29 +0200
Subject: [PATCH 04/21] qdev: kill DeviceState->name

is redundant with DeviceState->type->name

---
 hw/qdev.c |    3 +--
 hw/qdev.h |    1 -
 2 files changed, 1 insertions(+), 3 deletions(-)
hw/qdev.c +1 -2
index d945ff9..cedb772 100644
@@ -84,7 +84,6 @@ DeviceState *qdev_create(BusState *bus, const char *name)
     }
 
     dev = qemu_mallocz(t->size);
-    dev->name = name;
     dev->type = t;
 
     if (!bus) {
@@ -162,7 +161,7 @@ CharDriverState *qdev_init_chardev(DeviceState *dev)
     static int next_serial;
     static int next_virtconsole;
     /* FIXME: This is a nasty hack that needs to go away.  */
-    if (strncmp(dev->name, "virtio", 6) == 0) {
+    if (strncmp(dev->type->name, "virtio", 6) == 0) {
         return virtcon_hds[next_virtconsole++];
     } else {
         return serial_hds[next_serial++];
hw/qdev.h +0 -1
index 143a1f8..b3cc3ec 100644
@@ -13,7 +13,6 @@ typedef struct BusState BusState;
 /* This structure should not be accessed directly.  We declare it here
    so that it can be embedded in individual device state structures.  */
 struct DeviceState {
-    const char *name;
     DeviceType *type;
     BusState *parent_bus;
     DeviceProperty *props;
Signature · 1 line
1.6.2.2