From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:52808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzo0S-0004Lq-24 for qemu-devel@nongnu.org; Fri, 01 Mar 2019 14:39:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzo0R-00028T-27 for qemu-devel@nongnu.org; Fri, 01 Mar 2019 14:39:39 -0500 References: <20190301191545.8728-1-jsnow@redhat.com> <20190301191545.8728-6-jsnow@redhat.com> From: Eric Blake Message-ID: Date: Fri, 1 Mar 2019 13:39:16 -0600 MIME-Version: 1.0 In-Reply-To: <20190301191545.8728-6-jsnow@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 5/7] block/dirty-bitmaps: prohibit removing readonly bitmaps List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-devel@nongnu.org, qemu-block@nongnu.org Cc: Max Reitz , Fam Zheng , Kevin Wolf , Markus Armbruster , vsementsov@virtuozzo.com, "Dr. David Alan Gilbert" , Stefan Hajnoczi , Juan Quintela On 3/1/19 1:15 PM, John Snow wrote: > Remove is an inherently RW operation, so this will fail anyway, but > we can fail it very quickly instead of trying and failing, so do so. > > Signed-off-by: John Snow > --- > blockdev.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Eric Blake > > diff --git a/blockdev.c b/blockdev.c > index c8255dda0b..a9a059c570 100644 > --- a/blockdev.c > +++ b/blockdev.c > @@ -2881,7 +2881,8 @@ void qmp_block_dirty_bitmap_remove(const char *node, const char *name, > return; > } > > - if (bdrv_dirty_bitmap_check(bitmap, BDRV_BITMAP_BUSY, errp)) { > + if (bdrv_dirty_bitmap_check(bitmap, BDRV_BITMAP_BUSY | BDRV_BITMAP_RO, > + errp)) { > return; > } > > -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org