* [Qemu-devel] [PATCH] qom: do nothing on unparent of object without parent
@ 2013-04-02 13:50 Paolo Bonzini
2013-04-09 16:25 ` Paolo Bonzini
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Paolo Bonzini @ 2013-04-02 13:50 UTC (permalink / raw)
To: qemu-devel; +Cc: afaerber
Otherwise, device_unparent will fail to get a canonical path of
the object.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
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);
--
1.8.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] qom: do nothing on unparent of object without parent
2013-04-02 13:50 [Qemu-devel] [PATCH] qom: do nothing on unparent of object without parent Paolo Bonzini
@ 2013-04-09 16:25 ` Paolo Bonzini
2013-04-09 16:36 ` Andreas Färber
2013-04-22 18:38 ` Anthony Liguori
2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2013-04-09 16:25 UTC (permalink / raw)
Cc: qemu-devel, afaerber
Il 02/04/2013 15:50, Paolo Bonzini ha scritto:
> Otherwise, device_unparent will fail to get a canonical path of
> the object.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> 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);
>
Ping.
Paolo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] qom: do nothing on unparent of object without parent
2013-04-02 13:50 [Qemu-devel] [PATCH] qom: do nothing on unparent of object without parent Paolo Bonzini
2013-04-09 16:25 ` Paolo Bonzini
@ 2013-04-09 16:36 ` Andreas Färber
2013-04-22 18:38 ` Anthony Liguori
2 siblings, 0 replies; 4+ messages in thread
From: Andreas Färber @ 2013-04-09 16:36 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
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 <pbonzini@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] qom: do nothing on unparent of object without parent
2013-04-02 13:50 [Qemu-devel] [PATCH] qom: do nothing on unparent of object without parent Paolo Bonzini
2013-04-09 16:25 ` Paolo Bonzini
2013-04-09 16:36 ` Andreas Färber
@ 2013-04-22 18:38 ` Anthony Liguori
2 siblings, 0 replies; 4+ messages in thread
From: Anthony Liguori @ 2013-04-22 18:38 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: afaerber
Applied. Thanks.
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-22 18:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-02 13:50 [Qemu-devel] [PATCH] qom: do nothing on unparent of object without parent Paolo Bonzini
2013-04-09 16:25 ` Paolo Bonzini
2013-04-09 16:36 ` Andreas Färber
2013-04-22 18:38 ` Anthony Liguori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).