diff mbox

[RFC,4/5] pci-assign: Avoid qerror_report_err() outside QMP command handlers

Message ID 1425114327-12136-5-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 assigned_initfn().

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

Comments

Markus Armbruster March 2, 2015, 10:14 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 assigned_initfn().
>
> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
> ---
>  hw/i386/kvm/pci-assign.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
> index bd92c69..f2f4e07 100644
> --- a/hw/i386/kvm/pci-assign.c
> +++ b/hw/i386/kvm/pci-assign.c
> @@ -1831,8 +1831,7 @@ out:
>  
>  exit_with_error:
>      assert(local_err);
> -    qerror_report_err(local_err);
> -    error_free(local_err);
> +    error_report_err(local_err);
>      return -1;
>  }

This breaks the error reply when you hot plug the devices via QMP
device_add.

A correct solution is my "[PATCH 10/10] pci-assign: Convert to realize".
diff mbox

Patch

diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index bd92c69..f2f4e07 100644
--- a/hw/i386/kvm/pci-assign.c
+++ b/hw/i386/kvm/pci-assign.c
@@ -1831,8 +1831,7 @@  out:
 
 exit_with_error:
     assert(local_err);
-    qerror_report_err(local_err);
-    error_free(local_err);
+    error_report_err(local_err);
     return -1;
 }