qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] qom: removal of link property need to release i


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] qom: removal of link property need to release its target
Date: Thu, 23 Aug 2012 00:01:28 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0

Il 22/08/2012 23:41, Anthony Liguori ha scritto:
> 
> (1) should drop the floating reference and the reference held by the
> container.  That's what I meant by calling object_unparent in
> qmp_device_del.
> 
> (2) should simply remove the device from the bus (further releasing a
> reference).
> 
> (3) would happen automatically from (1) and (2) if they were called in
> that order.
> 
> If the guest instantiates a remove on it's own, the device would be
> disconnected from the bus (functionally unplugged) but still in the
> container so it would *not* go away.
> 
> I think this is desirable behavior.

It may be (I'm not sure it is desirable for HMP), but it's also
backwards-incompatible.  Right now, an unrequested guest-initiated
remove causes the device to disappear in "info qtree" too.  So, for
backwards-compatibility we need to keep using object_delete after
setting the parent bus to NULL.

WRT adding the unparent *also* in qmp_device_del, that prevents you from
later doing a surprise removal via the monitor, because you don't have
anymore a way to refer the device.  I'm also worried of what happens if
an object loses its canonical path in the middle of its life...

I'm not sure object_unparent should be extern, even.

Paolo



reply via email to

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