From mboxrd@z Thu Jan 1 00:00:00 1970 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) Sender: Paolo Bonzini 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 MIME-Version: 1.0 In-Reply-To: <20160321173957.GC4985@noname.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] block: remove legacy_dinfo at blk_detach_dev time List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , Markus Armbruster Cc: qemu-devel@nongnu.org, Max Reitz 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? 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; Paolo