* [Qemu-devel] [PATCH 0/2] Two small QOM fixes @ 2012-02-28 8:54 Paolo Bonzini 2012-02-28 8:54 ` [Qemu-devel] [PATCH 1/2] qdev: accept empty string properties Paolo Bonzini ` (3 more replies) 0 siblings, 4 replies; 8+ messages in thread From: Paolo Bonzini @ 2012-02-28 8:54 UTC (permalink / raw) To: qemu-devel Two fixes for bugs that were reported on the list. Paolo Bonzini (2): qdev: accept empty string properties qom: fix device hot-unplug hw/qdev-properties.c | 4 ---- qom/object.c | 7 ++----- 2 files changed, 2 insertions(+), 9 deletions(-) -- 1.7.7.6 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 1/2] qdev: accept empty string properties 2012-02-28 8:54 [Qemu-devel] [PATCH 0/2] Two small QOM fixes Paolo Bonzini @ 2012-02-28 8:54 ` Paolo Bonzini 2012-02-28 18:53 ` Gerhard Wiesinger 2012-03-10 13:14 ` Andreas Färber 2012-02-28 8:54 ` [Qemu-devel] [PATCH 2/2] qom: fix device hot-unplug Paolo Bonzini ` (2 subsequent siblings) 3 siblings, 2 replies; 8+ messages in thread From: Paolo Bonzini @ 2012-02-28 8:54 UTC (permalink / raw) To: qemu-devel; +Cc: Gerhard Wiesinger These were stored as NULL due to wrong cut-and-paste from set_pointer. Reported-by: Gerhard Wiesinger <lists@wiesinger.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- hw/qdev-properties.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c index 0423af1..bff9152 100644 --- a/hw/qdev-properties.c +++ b/hw/qdev-properties.c @@ -421,10 +421,6 @@ static void set_string(Object *obj, Visitor *v, void *opaque, error_propagate(errp, local_err); return; } - if (!*str) { - g_free(str); - str = NULL; - } if (*ptr) { g_free(*ptr); } -- 1.7.7.6 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] qdev: accept empty string properties 2012-02-28 8:54 ` [Qemu-devel] [PATCH 1/2] qdev: accept empty string properties Paolo Bonzini @ 2012-02-28 18:53 ` Gerhard Wiesinger 2012-03-10 13:14 ` Andreas Färber 1 sibling, 0 replies; 8+ messages in thread From: Gerhard Wiesinger @ 2012-02-28 18:53 UTC (permalink / raw) To: Paolo Bonzini; +Cc: qemu-devel Works well, Tested-by: Gerhard Wiesinger <lists@wiesinger.com> Ciao, Gerhard -- http://www.wiesinger.com/ On Tue, 28 Feb 2012, Paolo Bonzini wrote: > These were stored as NULL due to wrong cut-and-paste from set_pointer. > > Reported-by: Gerhard Wiesinger <lists@wiesinger.com> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> > --- > hw/qdev-properties.c | 4 ---- > 1 files changed, 0 insertions(+), 4 deletions(-) > > diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c > index 0423af1..bff9152 100644 > --- a/hw/qdev-properties.c > +++ b/hw/qdev-properties.c > @@ -421,10 +421,6 @@ static void set_string(Object *obj, Visitor *v, void *opaque, > error_propagate(errp, local_err); > return; > } > - if (!*str) { > - g_free(str); > - str = NULL; > - } > if (*ptr) { > g_free(*ptr); > } > -- > 1.7.7.6 > > > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] qdev: accept empty string properties 2012-02-28 8:54 ` [Qemu-devel] [PATCH 1/2] qdev: accept empty string properties Paolo Bonzini 2012-02-28 18:53 ` Gerhard Wiesinger @ 2012-03-10 13:14 ` Andreas Färber 1 sibling, 0 replies; 8+ messages in thread From: Andreas Färber @ 2012-03-10 13:14 UTC (permalink / raw) To: Paolo Bonzini; +Cc: Gerhard Wiesinger, qemu-devel Am 28.02.2012 09:54, schrieb Paolo Bonzini: > These were stored as NULL due to wrong cut-and-paste from set_pointer. > > Reported-by: Gerhard Wiesinger <lists@wiesinger.com> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> /-F > --- > hw/qdev-properties.c | 4 ---- > 1 files changed, 0 insertions(+), 4 deletions(-) > > diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c > index 0423af1..bff9152 100644 > --- a/hw/qdev-properties.c > +++ b/hw/qdev-properties.c > @@ -421,10 +421,6 @@ static void set_string(Object *obj, Visitor *v, void *opaque, > error_propagate(errp, local_err); > return; > } > - if (!*str) { > - g_free(str); > - str = NULL; > - } > if (*ptr) { > g_free(*ptr); > } -- 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] 8+ messages in thread
* [Qemu-devel] [PATCH 2/2] qom: fix device hot-unplug 2012-02-28 8:54 [Qemu-devel] [PATCH 0/2] Two small QOM fixes Paolo Bonzini 2012-02-28 8:54 ` [Qemu-devel] [PATCH 1/2] qdev: accept empty string properties Paolo Bonzini @ 2012-02-28 8:54 ` Paolo Bonzini 2012-03-10 13:12 ` Andreas Färber 2012-03-09 20:15 ` [Qemu-devel] [PATCH 0/2] Two small QOM fixes Paolo Bonzini 2012-03-13 1:59 ` Anthony Liguori 3 siblings, 1 reply; 8+ messages in thread From: Paolo Bonzini @ 2012-02-28 8:54 UTC (permalink / raw) To: qemu-devel; +Cc: Michael S. Tsirkin Property removal modifies the list, so it is not safe to continue iteration. We know anyway that each object can have only one parent (see object_property_add_child), so exit after finding the requested object. Reported-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- qom/object.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/qom/object.c b/qom/object.c index aa037d2..39cbcb9 100644 --- a/qom/object.c +++ b/qom/object.c @@ -304,12 +304,9 @@ static void object_property_del_child(Object *obj, Object *child, Error **errp) ObjectProperty *prop; QTAILQ_FOREACH(prop, &obj->properties, node) { - if (!strstart(prop->type, "child<", NULL)) { - continue; - } - - if (prop->opaque == child) { + if (strstart(prop->type, "child<", NULL) && prop->opaque == child) { object_property_del(obj, prop->name, errp); + break; } } } -- 1.7.7.6 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] qom: fix device hot-unplug 2012-02-28 8:54 ` [Qemu-devel] [PATCH 2/2] qom: fix device hot-unplug Paolo Bonzini @ 2012-03-10 13:12 ` Andreas Färber 0 siblings, 0 replies; 8+ messages in thread From: Andreas Färber @ 2012-03-10 13:12 UTC (permalink / raw) To: Paolo Bonzini; +Cc: qemu-devel, Michael S. Tsirkin Am 28.02.2012 09:54, schrieb Paolo Bonzini: > Property removal modifies the list, so it is not safe to continue > iteration. We know anyway that each object can have only one > parent (see object_property_add_child), so exit after finding > the requested object. > > Reported-by: Michael S. Tsirkin <mst@redhat.com> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> > --- > qom/object.c | 7 ++----- > 1 files changed, 2 insertions(+), 5 deletions(-) > > diff --git a/qom/object.c b/qom/object.c > index aa037d2..39cbcb9 100644 > --- a/qom/object.c > +++ b/qom/object.c > @@ -304,12 +304,9 @@ static void object_property_del_child(Object *obj, Object *child, Error **errp) > ObjectProperty *prop; > > QTAILQ_FOREACH(prop, &obj->properties, node) { > - if (!strstart(prop->type, "child<", NULL)) { > - continue; > - } > - > - if (prop->opaque == child) { > + if (strstart(prop->type, "child<", NULL) && prop->opaque == child) { Didn't someone post a patch introducing an object_property_is_child() or so? Would be handy here. Otherwise looks okay. Andreas > object_property_del(obj, prop->name, errp); > + break; > } > } > } -- 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] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 0/2] Two small QOM fixes 2012-02-28 8:54 [Qemu-devel] [PATCH 0/2] Two small QOM fixes Paolo Bonzini 2012-02-28 8:54 ` [Qemu-devel] [PATCH 1/2] qdev: accept empty string properties Paolo Bonzini 2012-02-28 8:54 ` [Qemu-devel] [PATCH 2/2] qom: fix device hot-unplug Paolo Bonzini @ 2012-03-09 20:15 ` Paolo Bonzini 2012-03-13 1:59 ` Anthony Liguori 3 siblings, 0 replies; 8+ messages in thread From: Paolo Bonzini @ 2012-03-09 20:15 UTC (permalink / raw) To: Anthony Liguori; +Cc: qemu-devel Il 28/02/2012 09:54, Paolo Bonzini ha scritto: > Two fixes for bugs that were reported on the list. > > Paolo Bonzini (2): > qdev: accept empty string properties > qom: fix device hot-unplug > > hw/qdev-properties.c | 4 ---- > qom/object.c | 7 ++----- > 2 files changed, 2 insertions(+), 9 deletions(-) > Ping. Paolo ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 0/2] Two small QOM fixes 2012-02-28 8:54 [Qemu-devel] [PATCH 0/2] Two small QOM fixes Paolo Bonzini ` (2 preceding siblings ...) 2012-03-09 20:15 ` [Qemu-devel] [PATCH 0/2] Two small QOM fixes Paolo Bonzini @ 2012-03-13 1:59 ` Anthony Liguori 3 siblings, 0 replies; 8+ messages in thread From: Anthony Liguori @ 2012-03-13 1:59 UTC (permalink / raw) To: Paolo Bonzini; +Cc: qemu-devel On 02/28/2012 02:54 AM, Paolo Bonzini wrote: > Two fixes for bugs that were reported on the list. Applied. Thanks. Regards, Anthony Liguori > > Paolo Bonzini (2): > qdev: accept empty string properties > qom: fix device hot-unplug > > hw/qdev-properties.c | 4 ---- > qom/object.c | 7 ++----- > 2 files changed, 2 insertions(+), 9 deletions(-) > ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-03-13 2:00 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-02-28 8:54 [Qemu-devel] [PATCH 0/2] Two small QOM fixes Paolo Bonzini 2012-02-28 8:54 ` [Qemu-devel] [PATCH 1/2] qdev: accept empty string properties Paolo Bonzini 2012-02-28 18:53 ` Gerhard Wiesinger 2012-03-10 13:14 ` Andreas Färber 2012-02-28 8:54 ` [Qemu-devel] [PATCH 2/2] qom: fix device hot-unplug Paolo Bonzini 2012-03-10 13:12 ` Andreas Färber 2012-03-09 20:15 ` [Qemu-devel] [PATCH 0/2] Two small QOM fixes Paolo Bonzini 2012-03-13 1:59 ` 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).