qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: lcapitulino@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 2/7] do_device_add(): look up "device" opts list with qemu_find_opts_err()
Date: Fri,  1 Feb 2013 18:38:14 +0100	[thread overview]
Message-ID: <1359740299-27968-3-git-send-email-lersek@redhat.com> (raw)
In-Reply-To: <1359740299-27968-1-git-send-email-lersek@redhat.com>


Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 hw/qdev-monitor.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c
index 3ec9e49..32be5a2 100644
--- a/hw/qdev-monitor.c
+++ b/hw/qdev-monitor.c
@@ -590,14 +590,17 @@ void do_info_qdm(Monitor *mon, const QDict *qdict)
 int do_device_add(Monitor *mon, const QDict *qdict, QObject **ret_data)
 {
     Error *local_err = NULL;
+    QemuOptsList *list;
     QemuOpts *opts;
 
-    opts = qemu_opts_from_qdict(qemu_find_opts("device"), qdict, &local_err);
-    if (error_is_set(&local_err)) {
+    if ((list = qemu_find_opts_err("device", &local_err)) == NULL ||
+        (opts = qemu_opts_from_qdict(list, qdict, &local_err)) == NULL) {
+        assert(error_is_set(&local_err));
         qerror_report_err(local_err);
         error_free(local_err);
         return -1;
     }
+
     if (!monitor_cur_is_qmp() && qdev_device_help(opts)) {
         qemu_opts_del(opts);
         return 0;
-- 
1.7.1

  parent reply	other threads:[~2013-02-01 17:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-01 17:38 [Qemu-devel] [PATCH 0/7] propagate Errors to do_device_add() Laszlo Ersek
2013-02-01 17:38 ` [Qemu-devel] [PATCH 1/7] remove some trailing whitespace Laszlo Ersek
2013-02-01 17:38 ` Laszlo Ersek [this message]
2013-02-01 17:38 ` [Qemu-devel] [PATCH 3/7] qdev_prop_parse(): report errors via Error Laszlo Ersek
2013-02-01 17:38 ` [Qemu-devel] [PATCH 4/7] qbus_find_recursive(): reorganize Laszlo Ersek
2013-02-01 17:38 ` [Qemu-devel] [PATCH 5/7] qbus_find_recursive(): terminate search by name in case of fatal error Laszlo Ersek
2013-02-01 17:38 ` [Qemu-devel] [PATCH 6/7] qbus_find(): report errors via Error Laszlo Ersek
2013-02-01 17:38 ` [Qemu-devel] [PATCH 7/7] qdev_device_add(): report errors with Error Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1359740299-27968-3-git-send-email-lersek@redhat.com \
    --to=lersek@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).