From patchwork Tue Mar 22 22:10:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 8645851 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DC260C0553 for ; Tue, 22 Mar 2016 22:11:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 445BF2038F for ; Tue, 22 Mar 2016 22:11:25 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A3F922038A for ; Tue, 22 Mar 2016 22:11:24 +0000 (UTC) Received: from localhost ([::1]:39874 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiUWK-0000Sq-18 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 Mar 2016 18:11:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiUVX-00084f-4N for qemu-devel@nongnu.org; Tue, 22 Mar 2016 18:10:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiUVS-0005zD-0u for qemu-devel@nongnu.org; Tue, 22 Mar 2016 18:10:35 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:36057) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiUVR-0005yr-Qt for qemu-devel@nongnu.org; Tue, 22 Mar 2016 18:10:29 -0400 Received: by mail-wm0-x244.google.com with SMTP id l68so75099wml.3 for ; Tue, 22 Mar 2016 15:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=XMqojzZObasHf5oq9/+40rz8AzpRr1KNebrqi3R+BjU=; b=yy6Yjstcz2Rd3CeaNnRGeOYUcBzDNXBynFTAiBDEbVXlQbASlJLPFucPsDk1lyElzR UYpie2mwS9nvhF24uOIcpSsIMjLlqPKsDn+9hQSzfzNPIC+UAwRfu+JdnCYp2Boo5kXi 6v9e50Y7Fsrqe7E1ilyT9x5R2W4abQot1WVOAm/7uYaHhZvFOVjZkVCUqCN5e3xLKVY5 D+De7p+DQKIE2xWmMyov7+2x2eUQf7YbU32cME0lVfSadwCjPpo3qd06hjpk/5S2zQ97 jXo3wQt3gH8oJkfHaRScbEIda6PZSp9v7zeHCsIGzWqnYdT5zgICb/6Br0Z+yt84Hf03 8SKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=XMqojzZObasHf5oq9/+40rz8AzpRr1KNebrqi3R+BjU=; b=gfDRcve69tC1knxhPcMeMOmbuXwCOhXzHKmMqRTpUMbP7sWdiykx5F6iHJDjtRZmiW gmieVC6ZXWs4JEnpqTmA7MZhkFOylExK8K5wygoJclTeAvyAWfAzh4PKMf89mws7ECAa nBg44fu1orf8MpqHkhBU00DykCFbuTwJ7r1eIGl0NqGQWwrq7O+XkQmfoq6kOD3+OqYg dEIYxni4Lcdj9SYvNu7TfYeeHgJIA9tiOkN5i4ADIWWcuoLWtWLGFndS9oJSzr8VSDPu 6ymXl0778/ptSBcNOU9Y+BDrp8GSY8Y25FFsPe07xbdvbYbtNHCaZBAFeSchwehYhfa7 p5yw== X-Gm-Message-State: AD7BkJIwy7LYN74exJtHF5Omg1BbZZPG5b2ntxj1dIw4xnnUjoUdGwHbJ7dtXVABn+phTA== X-Received: by 10.194.133.101 with SMTP id pb5mr38761009wjb.106.1458684629272; Tue, 22 Mar 2016 15:10:29 -0700 (PDT) Received: from [192.168.10.165] (94-39-161-17.adsl-ull.clienti.tiscali.it. [94.39.161.17]) by smtp.googlemail.com with ESMTPSA id v188sm19176407wmv.3.2016.03.22.15.10.28 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Mar 2016 15:10:28 -0700 (PDT) To: Kevin Wolf , Markus Armbruster References: <1456151945-11225-1-git-send-email-pbonzini@redhat.com> <1456151945-11225-4-git-send-email-pbonzini@redhat.com> <87k2kvzu0z.fsf@blackfin.pond.sub.org> <56F01F8A.2090902@redhat.com> <87shzj68n2.fsf@blackfin.pond.sub.org> <20160321173957.GC4985@noname.redhat.com> From: Paolo Bonzini Message-ID: <56F1C2D3.3050904@redhat.com> Date: Tue, 22 Mar 2016 23:10:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160321173957.GC4985@noname.redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::244 Cc: qemu-devel@nongnu.org, Max Reitz Subject: Re: [Qemu-devel] [PATCH 3/3] block: remove legacy_dinfo at blk_detach_dev time X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 21/03/2016 18:39, Kevin Wolf wrote: > > When I wrote my review, I forgot that I expect x-blockdev-del to accept > > only backends created with blockdev-add. With that, my question is > > indeed moot. > > > > However, I've now tested my expectation, and it turned out to be wrong. > > I'm inclined to call that a bug. > > Yes. Like this? Paolo Reviewed-by: Markus Armbruster diff --git a/blockdev.c b/blockdev.c index 3eb05d1..0bc7ea2 100644 --- a/blockdev.c +++ b/blockdev.c @@ -4023,6 +4023,11 @@ void qmp_x_blockdev_del(bool has_id, const char *id, error_setg(errp, "Cannot find block backend %s", id); return; } + if (blk_legacy_dinfo(blk)) { + error_setg(errp, "Deleting block backend added with drive-add" + " is not supported"); + return; + } if (blk_get_refcnt(blk) > 1) { error_setg(errp, "Block backend %s is in use", id); return;