From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=33577 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PFduh-0008Vb-Rx for qemu-devel@nongnu.org; Mon, 08 Nov 2010 21:26:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PFduf-0005dE-V8 for qemu-devel@nongnu.org; Mon, 08 Nov 2010 21:26:23 -0500 Received: from e2.ny.us.ibm.com ([32.97.182.142]:36317) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PFduf-0005cV-SO for qemu-devel@nongnu.org; Mon, 08 Nov 2010 21:26:21 -0500 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e2.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id oA92A5GE028039 for ; Mon, 8 Nov 2010 21:10:05 -0500 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oA92Q34S440098 for ; Mon, 8 Nov 2010 21:26:03 -0500 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oA92Q2wO029407 for ; Mon, 8 Nov 2010 19:26:03 -0700 From: Ryan Harper Date: Mon, 8 Nov 2010 20:25:52 -0600 Message-Id: <1289269554-6766-1-git-send-email-ryanh@us.ibm.com> Subject: [Qemu-devel] [PATCH 0/2] v6 Decouple block device removal from device removal List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , "Michael S. Tsirkin" , Markus Armbruster , Anthony Liguori , Ryan Harper , Stefan Hajnoczi 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