Re: [Qemu-devel] [PATCH v2] qom: Reject attempts to add a property that already exists

2012-10-08 Thread Anthony Liguori
Peter Maydell writes: > On 8 October 2012 14:29, Anthony Liguori wrote: >> This is wrong. >> >> Container properties are added by the user. You will turn a gracefully >> failure (during hotplug) into an abort(). > > No, it's turning a bug into an abort -- we don't handle trying to > create two

Re: [Qemu-devel] [PATCH v2] qom: Reject attempts to add a property that already exists

2012-10-08 Thread Peter Maydell
On 8 October 2012 14:38, Peter Crosthwaite wrote: > Can we just populate errp with a nice meaningful error (perhaps the > contents of that printf), then the caller can decide if failure is > tolerable? I would find this approach more plausible if it wasn't that so many places in qemu just happily

Re: [Qemu-devel] [PATCH v2] qom: Reject attempts to add a property that already exists

2012-10-08 Thread Peter Maydell
On 8 October 2012 14:29, Anthony Liguori wrote: > This is wrong. > > Container properties are added by the user. You will turn a gracefully > failure (during hotplug) into an abort(). No, it's turning a bug into an abort -- we don't handle trying to create two identically named properties correc

Re: [Qemu-devel] [PATCH v2] qom: Reject attempts to add a property that already exists

2012-10-08 Thread Peter Crosthwaite
On Mon, Oct 8, 2012 at 11:29 PM, Anthony Liguori wrote: > Peter Maydell writes: > >> Ping! > > This is wrong. > > Container properties are added by the user. You will turn a gracefully > failure (during hotplug) into an abort(). > Can we just populate errp with a nice meaningful error (perhaps

Re: [Qemu-devel] [PATCH v2] qom: Reject attempts to add a property that already exists

2012-10-08 Thread Anthony Liguori
Peter Maydell writes: > Ping! This is wrong. Container properties are added by the user. You will turn a gracefully failure (during hotplug) into an abort(). Please limit this to static properties as they are not added by a user. Regards, Anthony Liguori > > -- PMM > > On 7 September 2012

Re: [Qemu-devel] [PATCH v2] qom: Reject attempts to add a property that already exists

2012-10-08 Thread Peter Maydell
Ping! -- PMM On 7 September 2012 14:55, Peter Maydell wrote: > Reject attempts to add a property to an object if one of > that name already exists. This is always a bug in the caller; > this is merely diagnosing it gracefully rather than behaving > oddly later. > > Signed-off-by: Peter Maydell

Re: [Qemu-devel] [PATCH v2] qom: Reject attempts to add a property that already exists

2012-09-07 Thread Andreas Färber
Am 07.09.2012 15:55, schrieb Peter Maydell: > Reject attempts to add a property to an object if one of > that name already exists. This is always a bug in the caller; > this is merely diagnosing it gracefully rather than behaving > oddly later. > > Signed-off-by: Peter Maydell Looks fine to me,

[Qemu-devel] [PATCH v2] qom: Reject attempts to add a property that already exists

2012-09-07 Thread Peter Maydell
Reject attempts to add a property to an object if one of that name already exists. This is always a bug in the caller; this is merely diagnosing it gracefully rather than behaving oddly later. Signed-off-by: Peter Maydell --- Changes v1->v2: * use abort() rather than assert(0), as suggested by P