qemu-devel
[Top][All Lists]
Advanced

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

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


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2] qom: Reject attempts to add a property that already exists
Date: Mon, 8 Oct 2012 14:47:32 +0100

On 8 October 2012 14:29, Anthony Liguori <address@hidden> 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 correctly today.

> Please limit this to static properties as they are not added by a user.

Adding two dynamic properties of the same name is also not
going to work and we need to do something with it...

What is the code path for properties being added by a user?
If it's qdev_device_add() then that code presumably doesn't
care about graceful failures because it passes NULL as an
error pointer. container_get() seems to assume that adding the
child property will always succeed and will not do the right
thing if there already exists a child property of the relevant
name but wrong type.

Basically it seems to me that any code which might actually
be hit by this assert() rather needs examination and rewriting
to handle the error case anyway...

-- PMM



reply via email to

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