qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qom: do nothing on unparent of object without p


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH] qom: do nothing on unparent of object without parent
Date: Tue, 09 Apr 2013 18:36:29 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

Am 02.04.2013 15:50, schrieb Paolo Bonzini:
> Otherwise, device_unparent will fail to get a canonical path of
> the object.
> 
> Signed-off-by: Paolo Bonzini <address@hidden>

Reviewed-by: Andreas Färber <address@hidden>

Andreas

> ---
>  qom/object.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/qom/object.c b/qom/object.c
> index 8818149..093502e 100644
> --- a/qom/object.c
> +++ b/qom/object.c
> @@ -362,6 +362,10 @@ static void object_property_del_child(Object *obj, 
> Object *child, Error **errp)
>  
>  void object_unparent(Object *obj)
>  {
> +    if (!obj->parent) {
> +        return;
> +    }
> +
>      object_ref(obj);
>      if (obj->class->unparent) {
>          (obj->class->unparent)(obj);
> 


-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]