static DeviceState *qbus_find_dev(BusState *bus, char *elem)

{

    DeviceState *dev;



    











    LIST_FOREACH(dev, &bus->children, sibling) {

        if (dev->id  &&  strcmp(dev->id, elem) == 0) {

            return dev;

        }

    }

    LIST_FOREACH(dev, &bus->children, sibling) {

        if (strcmp(dev->info->name, elem) == 0) {

            return dev;

        }

    }

    LIST_FOREACH(dev, &bus->children, sibling) {

        if (dev->info->alias && strcmp(dev->info->alias, elem) == 0) {

            return dev;

        }

    }

    return NULL;

}
