All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com
Subject: [Qemu-devel] [PATCH 10/21] Monitor: Convert pci_device_hot_remove() to cmd_new_ret()
Date: Wed, 10 Feb 2010 23:49:56 -0200	[thread overview]
Message-ID: <1265853007-27300-11-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1265853007-27300-1-git-send-email-lcapitulino@redhat.com>

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 hw/pci-hotplug.c |   14 +++++++-------
 qemu-monitor.hx  |    2 +-
 sysemu.h         |    6 +++---
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c
index 6cc70d5..bd82c6a 100644
--- a/hw/pci-hotplug.c
+++ b/hw/pci-hotplug.c
@@ -296,26 +296,26 @@ int pci_device_hot_add(Monitor *mon, const QDict *qdict, QObject **ret_data)
 }
 #endif
 
-void pci_device_hot_remove(Monitor *mon, const char *pci_addr)
+int pci_device_hot_remove(Monitor *mon, const char *pci_addr)
 {
     PCIDevice *d;
     int dom, bus;
     unsigned slot;
 
     if (pci_read_devaddr(mon, pci_addr, &dom, &bus, &slot)) {
-        return;
+        return -1;
     }
 
     d = pci_find_device(pci_find_root_bus(0), bus, slot, 0);
     if (!d) {
         monitor_printf(mon, "slot %d empty\n", slot);
-        return;
+        return -1;
     }
-    qdev_unplug(&d->qdev);
+    return qdev_unplug(&d->qdev);
 }
 
-void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict,
-                              QObject **ret_data)
+int do_pci_device_hot_remove(Monitor *mon, const QDict *qdict,
+                             QObject **ret_data)
 {
-    pci_device_hot_remove(mon, qdict_get_str(qdict, "pci_addr"));
+    return pci_device_hot_remove(mon, qdict_get_str(qdict, "pci_addr"));
 }
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index 2831055..e987cf1 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -874,7 +874,7 @@ ETEXI
         .params     = "[[<domain>:]<bus>:]<slot>",
         .help       = "hot remove PCI device",
         .user_print = monitor_user_noop,
-        .mhandler.cmd_new = do_pci_device_hot_remove,
+        .cmd_new_ret = do_pci_device_hot_remove,
     },
 #endif
 
diff --git a/sysemu.h b/sysemu.h
index d41a338..8ba618e 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -215,9 +215,9 @@ DriveInfo *add_init_drive(const char *opts);
 void pci_device_hot_add_print(Monitor *mon, const QObject *data);
 int pci_device_hot_add(Monitor *mon, const QDict *qdict, QObject **ret_data);
 void drive_hot_add(Monitor *mon, const QDict *qdict);
-void pci_device_hot_remove(Monitor *mon, const char *pci_addr);
-void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict,
-                              QObject **ret_data);
+int pci_device_hot_remove(Monitor *mon, const char *pci_addr);
+int do_pci_device_hot_remove(Monitor *mon, const QDict *qdict,
+                             QObject **ret_data);
 
 /* serial ports */
 
-- 
1.6.6

  parent reply	other threads:[~2010-02-11  1:50 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-11  1:49 [Qemu-devel] [PATCH v0 00/21]: Monitor: improve handlers error handling Luiz Capitulino
2010-02-11  1:49 ` [Qemu-devel] [PATCH 01/21] Monitor: Introduce cmd_new_ret() Luiz Capitulino
2010-02-19 21:28   ` Anthony Liguori
2010-02-11  1:49 ` [Qemu-devel] [PATCH 02/21] Monitor: Convert simple handlers to cmd_new_ret() Luiz Capitulino
2010-02-11  1:49 ` [Qemu-devel] [PATCH 03/21] Monitor: Convert do_cont() " Luiz Capitulino
2010-02-11  1:49 ` [Qemu-devel] [PATCH 04/21] Monitor: Convert do_eject() " Luiz Capitulino
2010-02-11  1:49 ` [Qemu-devel] [PATCH 05/21] Monitor: Convert do_cpu_set() " Luiz Capitulino
2010-02-11  1:49 ` [Qemu-devel] [PATCH 06/21] Monitor: Convert do_block_set_passwd() " Luiz Capitulino
2010-02-11  1:49 ` [Qemu-devel] [PATCH 07/21] Monitor: Convert do_getfd() " Luiz Capitulino
2010-02-11  1:49 ` [Qemu-devel] [PATCH 08/21] Monitor: Convert do_closefd() " Luiz Capitulino
2010-02-11  1:49 ` [Qemu-devel] [PATCH 09/21] Monitor: Convert pci_device_hot_add() " Luiz Capitulino
2010-02-11  1:49 ` Luiz Capitulino [this message]
2010-02-11  1:49 ` [Qemu-devel] [PATCH 11/21] Monitor: Convert do_migrate() " Luiz Capitulino
2010-02-11  1:49 ` [Qemu-devel] [PATCH 12/21] Monitor: Convert do_memory_save() " Luiz Capitulino
2010-02-11  1:49 ` [Qemu-devel] [PATCH 13/21] Monitor: Convert do_physical_memory_save() " Luiz Capitulino
2010-02-11  1:50 ` [Qemu-devel] [PATCH 14/21] Monitor: Convert do_info() " Luiz Capitulino
2010-02-11  1:50 ` [Qemu-devel] [PATCH 15/21] Monitor: Convert do_change() " Luiz Capitulino
2010-02-11  1:50 ` [Qemu-devel] [PATCH 16/21] Monitor: Rename cmd_new_ret() Luiz Capitulino
2010-02-11  1:50 ` [Qemu-devel] [PATCH 17/21] Monitor: Debugging support Luiz Capitulino
2010-02-11  1:50 ` [Qemu-devel] [PATCH 18/21] Monitor: Drop the print disabling mechanism Luiz Capitulino
2010-02-11  1:50 ` [Qemu-devel] [PATCH 19/21] Monitor: Audit handler return Luiz Capitulino
2010-02-11  1:50 ` [Qemu-devel] [PATCH 20/21] Monitor: Debug stray prints the right way Luiz Capitulino
2010-02-11  1:50 ` [Qemu-devel] [PATCH 21/21] Monitor: Report more than one error in handlers Luiz Capitulino
2010-02-11  8:58 ` [Qemu-devel] [PATCH v0 00/21]: Monitor: improve handlers error handling Markus Armbruster
2010-02-11 11:48   ` Luiz Capitulino
2010-02-11 12:21     ` Markus Armbruster
2010-02-11 14:04 ` Anthony Liguori
2010-02-11 15:27   ` Markus Armbruster
2010-02-11 16:00     ` Luiz Capitulino
2010-02-11 16:12     ` Anthony Liguori
2010-02-11 16:57       ` Markus Armbruster
2010-02-11 17:17         ` Anthony Liguori
2010-02-12 10:04           ` Markus Armbruster

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=1265853007-27300-11-git-send-email-lcapitulino@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=armbru@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.