diff mbox

[v4,1/4] qdev: using error_abort instead of using local_err

Message ID 1409645070-8720-2-git-send-email-arei.gonglei@huawei.com
State New
Headers show

Commit Message

Gonglei (Arei) Sept. 2, 2014, 8:04 a.m. UTC
From: Gonglei <arei.gonglei@huawei.com>

This error can not happen normally. If it happens indicates
something very wrong, we should abort QEMU. moreover, The
user can only refer to /machine/peripheral, not
/machine/unattached.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 hw/core/qdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Gonglei (Arei) Sept. 2, 2014, 8:19 a.m. UTC | #1
> From: Gonglei (Arei)
> Sent: Tuesday, September 02, 2014 4:04 PM
> Subject: [PATCH v4 1/4] qdev: using error_abort instead of using local_err
> Importance: High
> 
> From: Gonglei <arei.gonglei@huawei.com>
> 
> This error can not happen normally. If it happens indicates
> something very wrong, we should abort QEMU. moreover, The
> user can only refer to /machine/peripheral, not
> /machine/unattached.
> 
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---

Oops, I forget to add 'Reviewed-by' Peter in this patch. 

Next version will fix this. Sorry!

Best regards,
-Gonglei

>  hw/core/qdev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/core/qdev.c b/hw/core/qdev.c
> index da1ba48..4a1ac5b 100644
> --- a/hw/core/qdev.c
> +++ b/hw/core/qdev.c
> @@ -820,13 +820,13 @@ static void device_set_realized(Object *obj, bool
> value, Error **errp)
>      }
> 
>      if (value && !dev->realized) {
> -        if (!obj->parent && local_err == NULL) {
> +        if (!obj->parent) {
>              static int unattached_count;
>              gchar *name = g_strdup_printf("device[%d]",
> unattached_count++);
> 
> 
> object_property_add_child(container_get(qdev_get_machine(),
> 
> "/unattached"),
> -                                      name, obj, &local_err);
> +                                      name, obj, &error_abort);
>              g_free(name);
>          }
> 
> --
> 1.7.12.4
>
Michael S. Tsirkin Sept. 2, 2014, 8:25 a.m. UTC | #2
On Tue, Sep 02, 2014 at 08:19:22AM +0000, Gonglei (Arei) wrote:
> > From: Gonglei (Arei)
> > Sent: Tuesday, September 02, 2014 4:04 PM
> > Subject: [PATCH v4 1/4] qdev: using error_abort instead of using local_err
> > Importance: High
> > 
> > From: Gonglei <arei.gonglei@huawei.com>
> > 
> > This error can not happen normally. If it happens indicates
> > something very wrong, we should abort QEMU. moreover, The
> > user can only refer to /machine/peripheral, not
> > /machine/unattached.
> > 
> > Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> > ---
> 
> Oops, I forget to add 'Reviewed-by' Peter in this patch. 
> 
> Next version will fix this. Sorry!
> 
> Best regards,
> -Gonglei

No need to repost just for this: reply to the
appropriate patch with Reviewed-by in the body.

> >  hw/core/qdev.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/hw/core/qdev.c b/hw/core/qdev.c
> > index da1ba48..4a1ac5b 100644
> > --- a/hw/core/qdev.c
> > +++ b/hw/core/qdev.c
> > @@ -820,13 +820,13 @@ static void device_set_realized(Object *obj, bool
> > value, Error **errp)
> >      }
> > 
> >      if (value && !dev->realized) {
> > -        if (!obj->parent && local_err == NULL) {
> > +        if (!obj->parent) {
> >              static int unattached_count;
> >              gchar *name = g_strdup_printf("device[%d]",
> > unattached_count++);
> > 
> > 
> > object_property_add_child(container_get(qdev_get_machine(),
> > 
> > "/unattached"),
> > -                                      name, obj, &local_err);
> > +                                      name, obj, &error_abort);
> >              g_free(name);
> >          }
> > 
> > --
> > 1.7.12.4
> >
Gonglei (Arei) Sept. 2, 2014, 8:28 a.m. UTC | #3
> > > Subject: [PATCH v4 1/4] qdev: using error_abort instead of using local_err
> > > Importance: High
> > >
> > > From: Gonglei <arei.gonglei@huawei.com>
> > >
> > > This error can not happen normally. If it happens indicates
> > > something very wrong, we should abort QEMU. moreover, The
> > > user can only refer to /machine/peripheral, not
> > > /machine/unattached.
> > >
> > > Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> > > ---
> >
> > Oops, I forget to add 'Reviewed-by' Peter in this patch.
> >
> > Next version will fix this. Sorry!
> >
> > Best regards,
> > -Gonglei
> 
> No need to repost just for this: reply to the
> appropriate patch with Reviewed-by in the body.
> 
OK, understood. Thanks!

Best regards,
-Gonglei

> > >  hw/core/qdev.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/hw/core/qdev.c b/hw/core/qdev.c
> > > index da1ba48..4a1ac5b 100644
> > > --- a/hw/core/qdev.c
> > > +++ b/hw/core/qdev.c
> > > @@ -820,13 +820,13 @@ static void device_set_realized(Object *obj, bool
> > > value, Error **errp)
> > >      }
> > >
> > >      if (value && !dev->realized) {
> > > -        if (!obj->parent && local_err == NULL) {
> > > +        if (!obj->parent) {
> > >              static int unattached_count;
> > >              gchar *name = g_strdup_printf("device[%d]",
> > > unattached_count++);
> > >
> > >
> > > object_property_add_child(container_get(qdev_get_machine(),
> > >
> > > "/unattached"),
> > > -                                      name, obj, &local_err);
> > > +                                      name, obj, &error_abort);
> > >              g_free(name);
> > >          }
> > >
> > > --
> > > 1.7.12.4
> > >
diff mbox

Patch

diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index da1ba48..4a1ac5b 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -820,13 +820,13 @@  static void device_set_realized(Object *obj, bool value, Error **errp)
     }
 
     if (value && !dev->realized) {
-        if (!obj->parent && local_err == NULL) {
+        if (!obj->parent) {
             static int unattached_count;
             gchar *name = g_strdup_printf("device[%d]", unattached_count++);
 
             object_property_add_child(container_get(qdev_get_machine(),
                                                     "/unattached"),
-                                      name, obj, &local_err);
+                                      name, obj, &error_abort);
             g_free(name);
         }