vl.c: convert *vga_enabled functions to QOM

And get rid of qdev_exists().

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
Aurelien Jarno 2012-09-08 16:01:20 +02:00
parent 6405c86412
commit 36b7f27d21
3 changed files with 4 additions and 9 deletions

View File

@ -52,11 +52,6 @@ const char *qdev_fw_name(DeviceState *dev)
return object_get_typename(OBJECT(dev));
}
bool qdev_exists(const char *name)
{
return !!object_class_by_name(name);
}
static void qdev_property_add_legacy(DeviceState *dev, Property *prop,
Error **errp);

View File

@ -153,7 +153,6 @@ typedef struct GlobalProperty {
DeviceState *qdev_create(BusState *bus, const char *name);
DeviceState *qdev_try_create(BusState *bus, const char *name);
bool qdev_exists(const char *name);
int qdev_device_help(QemuOpts *opts);
DeviceState *qdev_device_add(QemuOpts *opts);
int qdev_init(DeviceState *dev) QEMU_WARN_UNUSED_RESULT;

7
vl.c
View File

@ -1700,17 +1700,18 @@ static const QEMUOption qemu_options[] = {
static bool vga_available(void)
{
return qdev_exists("VGA") || qdev_exists("isa-vga");
return object_class_by_name("VGA") || object_class_by_name("isa-vga");
}
static bool cirrus_vga_available(void)
{
return qdev_exists("cirrus-vga") || qdev_exists("isa-cirrus-vga");
return object_class_by_name("cirrus-vga")
|| object_class_by_name("isa-cirrus-vga");
}
static bool vmware_vga_available(void)
{
return qdev_exists("vmware-svga");
return object_class_by_name("vmware-svga");
}
static void select_vgahw (const char *p)