diff mbox

[RFC,3/5] pci-hotplug-old: Avoid qerror_report_err() outside QMP command handlers

Message ID 1425114327-12136-4-git-send-email-zhang.zhanghailiang@huawei.com
State New
Headers show

Commit Message

Zhanghailiang Feb. 28, 2015, 9:05 a.m. UTC
qerror_report_err() is a transitional interface to help with
converting existing monitor commands to QMP. It should not be used
elsewhere.  Replace by error_report_err() in qemu_pci_hot_add_nic().

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
---
 hw/pci/pci-hotplug-old.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Markus Armbruster March 2, 2015, 10:12 a.m. UTC | #1
zhanghailiang <zhang.zhanghailiang@huawei.com> writes:

> qerror_report_err() is a transitional interface to help with
> converting existing monitor commands to QMP. It should not be used
> elsewhere.  Replace by error_report_err() in qemu_pci_hot_add_nic().
>
> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
> ---
>  hw/pci/pci-hotplug-old.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/hw/pci/pci-hotplug-old.c b/hw/pci/pci-hotplug-old.c
> index beea6d2..477bafc 100644
> --- a/hw/pci/pci-hotplug-old.c
> +++ b/hw/pci/pci-hotplug-old.c
> @@ -91,8 +91,7 @@ static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon,
>  
>      ret = net_client_init(opts, 0, &local_err);
>      if (local_err) {
> -        qerror_report_err(local_err);
> -        error_free(local_err);
> +        error_report_err(local_err);
>          return NULL;
>      }
>      if (nd_table[ret].devaddr) {

Hard to see, but this is actually dead code.

[PATCH v2 0/2] pci: Bury dead legacy commands pci_add, pci_del
diff mbox

Patch

diff --git a/hw/pci/pci-hotplug-old.c b/hw/pci/pci-hotplug-old.c
index beea6d2..477bafc 100644
--- a/hw/pci/pci-hotplug-old.c
+++ b/hw/pci/pci-hotplug-old.c
@@ -91,8 +91,7 @@  static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon,
 
     ret = net_client_init(opts, 0, &local_err);
     if (local_err) {
-        qerror_report_err(local_err);
-        error_free(local_err);
+        error_report_err(local_err);
         return NULL;
     }
     if (nd_table[ret].devaddr) {