Patchwork [v2,13/15] qdev_device_add(): extend signature with Error

login
register
mail settings
Submitter Laszlo Ersek
Date Feb. 5, 2013, 8:39 p.m.
Message ID <1360096768-8863-14-git-send-email-lersek@redhat.com>
Download mbox | patch
Permalink /patch/218356/
State New
Headers show

Comments

Laszlo Ersek - Feb. 5, 2013, 8:39 p.m.
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 hw/qdev-monitor.h |    3 ++-
 hw/qdev-monitor.c |    4 ++--
 vl.c              |    2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

Patch

diff --git a/hw/qdev-monitor.h b/hw/qdev-monitor.h
index 9ec4850..3760bf5 100644
--- a/hw/qdev-monitor.h
+++ b/hw/qdev-monitor.h
@@ -3,6 +3,7 @@ 
 
 #include "qdev-core.h"
 #include "monitor/monitor.h"
+#include "qapi/error.h"
 
 /*** monitor commands ***/
 
@@ -11,6 +12,6 @@  void do_info_qdm(Monitor *mon, const QDict *qdict);
 int do_device_add(Monitor *mon, const QDict *qdict, QObject **ret_data);
 int do_device_del(Monitor *mon, const QDict *qdict, QObject **ret_data);
 int qdev_device_help(QemuOpts *opts);
-DeviceState *qdev_device_add(QemuOpts *opts);
+DeviceState *qdev_device_add(QemuOpts *opts, Error **errp);
 
 #endif
diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c
index 80fc9f8..a7f73dc 100644
--- a/hw/qdev-monitor.c
+++ b/hw/qdev-monitor.c
@@ -453,7 +453,7 @@  static BusState *qbus_find(const char *path, Error **errp)
     }
 }
 
-DeviceState *qdev_device_add(QemuOpts *opts)
+DeviceState *qdev_device_add(QemuOpts *opts, Error **errp)
 {
     ObjectClass *obj;
     DeviceClass *k;
@@ -666,7 +666,7 @@  int do_device_add(Monitor *mon, const QDict *qdict, QObject **ret_data)
         qemu_opts_del(opts);
         return 0;
     }
-    dev = qdev_device_add(opts);
+    dev = qdev_device_add(opts, NULL);
     if (!dev) {
         qemu_opts_del(opts);
         return -1;
diff --git a/vl.c b/vl.c
index 059e512..1860662 100644
--- a/vl.c
+++ b/vl.c
@@ -2280,7 +2280,7 @@  static int device_init_func(QemuOpts *opts, void *opaque)
 {
     DeviceState *dev;
 
-    dev = qdev_device_add(opts);
+    dev = qdev_device_add(opts, NULL);
     if (!dev)
         return -1;
     object_unref(OBJECT(dev));