qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Liu Ping Fan <pingfank@linux.vnet.ibm.com>,
	Liu Ping Fan <qemulist@gmail.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qom: removal of link property need to release its target
Date: Thu, 23 Aug 2012 00:01:28 +0200	[thread overview]
Message-ID: <503556B8.3040109@redhat.com> (raw)
In-Reply-To: <87628a4nb1.fsf@codemonkey.ws>

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	other threads:[~2012-08-22 22:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-22  3:02 [Qemu-devel] [PATCH] qom: removal of link property need to release its target Liu Ping Fan
2012-08-22 12:02 ` Paolo Bonzini
2012-08-22 16:36   ` Anthony Liguori
2012-08-22 20:55     ` Paolo Bonzini
2012-08-22 21:41       ` Anthony Liguori
2012-08-22 22:01         ` Paolo Bonzini [this message]
2012-08-22 22:40           ` Anthony Liguori
2012-08-23  8:35             ` Paolo Bonzini
2012-08-23  8:02     ` liu ping fan
2012-08-22 17:07 ` Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=503556B8.3040109@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=pingfank@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemulist@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).