qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Ryan Harper <ryanh@us.ibm.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
	Anthony Liguori <aliguori@linux.vnet.ibm.com>,
	Stefan Hajnoczi <stefan.hajnoczi@uk.ibm.com>
Subject: [Qemu-devel] Re: [PATCH 0/2] v6 Decouple block device removal from device removal
Date: Tue, 9 Nov 2010 15:29:14 +0200	[thread overview]
Message-ID: <20101109132914.GG22705@redhat.com> (raw)
In-Reply-To: <1289269554-6766-1-git-send-email-ryanh@us.ibm.com>

On Mon, Nov 08, 2010 at 08:25:52PM -0600, Ryan Harper wrote:
> After *much* discussion, here's version 6.
> 
> This patch series decouples the detachment of a block device from the removal
> of the backing pci-device.  Removal of a hotplugged pci device requires the
> guest to respond before qemu tears down the block device. In some cases, the
> guest may not respond leaving the guest with continued access to the block
> device.  
> 
> The new monitor command, drive_del, will revoke a guests access to the
> block device independently of the removal of the pci device.
> 
> The first patch implements drive_del and bdrv_unplug, the second patch
> implements the qmp version of the monitor command.
> 
> Changes since v5:
> - Removed dangling pointers in guest and host state.  This ensures things like 
>   info block no longer displays the deleted drive; though info pci will
>   continue to display the pci device until the guest responds to the removal
>   request.
> - Renamed drive_unplug -> drive_del
> Changes since v4:
> - Droppped drive_get_by_id patch and use bdrv_find() instead
> - Added additional details about drive_unplug to hmp/qmp interface
> 
> Changes since v3:
> - Moved QMP command for drive_unplug() to separate patch
> 
> Changes since v2:
> - Added QMP command for drive_unplug()
> 
> Changes since v1:
> - CodingStyle fixes
> - Added qemu_aio_flush() to bdrv_unplug()
> 
> Signed-off-by: Ryan Harper <ryanh@us.ibm.com>

Acked-by: Michael S. Tsirkin <mst@redhat.com>

I note that to complete the fix we will need a way
for management to check whether the device has
been ejected by guest. Quoting a proposal by Daniel:

	We don't use info block for anything. Having to parse the full qdev tree
	to determine if a single device is gone seems rather tedious. It would
	be better if query-qdev took an optional argument, which is the name
	of the device to root the tree at. Then checking whether a device
	named 'foo' is gone just means running 'query-qdev foo' and seeing if
	that returns an error about the device not existing, then we know it
	has gone. No need to parse anything. Being able to query the qdev data
	for a single device, or sub-tree of devices seems useful in its own
	right.

-- 
MST

      parent reply	other threads:[~2010-11-09 13:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-09  2:25 [Qemu-devel] [PATCH 0/2] v6 Decouple block device removal from device removal Ryan Harper
2010-11-09  2:25 ` [Qemu-devel] [PATCH 1/2] Fix Block Hotplug race with drive_del() Ryan Harper
2010-11-10 12:48   ` Markus Armbruster
2010-11-10 16:01     ` Ryan Harper
2010-11-10 17:39       ` Markus Armbruster
2010-11-10 17:50         ` Ryan Harper
2010-11-10 19:31         ` Ryan Harper
2010-11-11 10:48           ` Markus Armbruster
2010-11-11 13:25             ` Ryan Harper
2010-11-11 14:50               ` Markus Armbruster
2010-11-09  2:25 ` [Qemu-devel] [PATCH 2/2] Add qmp version of drive_del Ryan Harper
2010-11-09 13:29 ` Michael S. Tsirkin [this message]

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=20101109132914.GG22705@redhat.com \
    --to=mst@redhat.com \
    --cc=aliguori@linux.vnet.ibm.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=ryanh@us.ibm.com \
    --cc=stefan.hajnoczi@uk.ibm.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).