From patchwork Mon Nov 1 21:13:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Harper X-Patchwork-Id: 69842 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2E63AB70A5 for ; Tue, 2 Nov 2010 08:19:03 +1100 (EST) Received: from localhost ([127.0.0.1]:43526 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PD1m6-00039w-5Y for incoming@patchwork.ozlabs.org; Mon, 01 Nov 2010 17:18:42 -0400 Received: from [140.186.70.92] (port=40748 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PD1hQ-0000cH-Ta for qemu-devel@nongnu.org; Mon, 01 Nov 2010 17:13:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PD1hQ-00039w-01 for qemu-devel@nongnu.org; Mon, 01 Nov 2010 17:13:52 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:56456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PD1hP-00039j-Ol for qemu-devel@nongnu.org; Mon, 01 Nov 2010 17:13:51 -0400 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by e36.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id oA1L9XFn014430 for ; Mon, 1 Nov 2010 15:09:33 -0600 Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oA1LDoWS143362 for ; Mon, 1 Nov 2010 15:13:50 -0600 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oA1LHnT5000751 for ; Mon, 1 Nov 2010 15:17:49 -0600 Received: from localhost.localdomain (sig-9-48-44-96.mts.ibm.com [9.48.44.96]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id oA1LHgjA000482; Mon, 1 Nov 2010 15:17:47 -0600 From: Ryan Harper To: Date: Mon, 1 Nov 2010 16:13:30 -0500 Message-Id: <1288646010-8272-3-git-send-email-ryanh@us.ibm.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1288646010-8272-1-git-send-email-ryanh@us.ibm.com> References: <1288646010-8272-1-git-send-email-ryanh@us.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: Stefan Hajnoczi , Anthony Liguori , Ryan Harper , Markus Armbruster , Kevin Wolf Subject: [Qemu-devel] [PATCH 2/2] Add qmp version of drive_unplug X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Ryan Harper --- qmp-commands.hx | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/qmp-commands.hx b/qmp-commands.hx index 793cf1c..a1f7b2f 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -338,6 +338,37 @@ Example: EQMP { + .name = "drive_unplug", + .args_type = "id:s", + .params = "device", + .help = "unplug block device", + .user_print = monitor_user_noop, + .mhandler.cmd_new = do_drive_unplug, + }, + +SQMP +drive unplug +---------- + +Unplug a block device. The result is that guest generated IO is no longer +submitted against the host device underlying the disk. Once a drive has +been unplugged, the QEMU Block layer returns -EIO which results in IO +errors in the guest for applications that are reading/writing to the device +when it is unplugged. Unplugged block devices can be safely deleted along with +the associated pci devices (if present). + +Arguments: + +- "id": the device's ID (json-string) + +Example: + +-> { "execute": "drive_unplug", "arguments": { "id": "drive-virtio-blk1" } } +<- { "return": {} } + +EQMP + + { .name = "cpu", .args_type = "index:i", .params = "index",