Patchwork [v3,03/17] vl.c: convert *vga_enabled functions to QOM

login
register
mail settings
Submitter Aurelien Jarno
Date Sept. 11, 2012, 7:10 p.m.
Message ID <1347390642-17434-4-git-send-email-aurelien@aurel32.net>
Download mbox | patch
Permalink /patch/183189/
State New
Headers show

Comments

Aurelien Jarno - Sept. 11, 2012, 7:10 p.m.
And get rid of qdev_exists().

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 hw/qdev.c |    5 -----
 hw/qdev.h |    1 -
 vl.c      |    7 ++++---
 3 files changed, 4 insertions(+), 9 deletions(-)

Patch

diff --git a/hw/qdev.c b/hw/qdev.c
index b5a52ac..0eb30a2 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -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);
 
diff --git a/hw/qdev.h b/hw/qdev.h
index d699194..c6ac636 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -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;
diff --git a/vl.c b/vl.c
index 7c577fa..f7eed7a 100644
--- a/vl.c
+++ b/vl.c
@@ -1690,17 +1690,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)