From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsAZ9-0001LJ-0t for qemu-devel@nongnu.org; Thu, 27 Jun 2013 07:40:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsAZ7-0001LL-1g for qemu-devel@nongnu.org; Thu, 27 Jun 2013 07:40:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19295) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsAZ6-0001Ky-Lo for qemu-devel@nongnu.org; Thu, 27 Jun 2013 07:40:40 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5RBeeqP004286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 27 Jun 2013 07:40:40 -0400 Message-ID: <51CC24AF.9010001@redhat.com> Date: Thu, 27 Jun 2013 13:40:31 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1372219161-12209-1-git-send-email-famz@redhat.com> <1372219161-12209-2-git-send-email-famz@redhat.com> <20130627081536.GE13780@stefanha-thinkpad.redhat.com> <20130627094134.GA8076@t430s.nay.redhat.com> <51CC1A8F.3070004@redhat.com> <20130627113722.GA22728@t430s.nay.redhat.com> In-Reply-To: <20130627113722.GA22728@t430s.nay.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 1/3] block: add target-id option to drive-backup QMP command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: famz@redhat.com Cc: kwolf@redhat.com, obarenbo@redhat.com, armbru@redhat.com, roliveri@redhat.com, hbrock@redhat.com, qemu-devel@nongnu.org, rjones@redhat.com, pmyers@redhat.com, imain@redhat.com, Stefan Hajnoczi Il 27/06/2013 13:37, Fam Zheng ha scritto: >>> > > >>> > > Yes, this makes me realize that ref count it not a solution to retire >>> > > bs->in_use, because we can't tell if drive-del or block-resize is safe >>> > > with only reference number. But I can't think of two situations to deny >>> > > different subsets of commands, shouldn't a general blocker, like in_use >>> > > does, be good enough? >> > >> > For example, right now nbd-server-add does not check bdrv_in_use. But >> > shrinking a device that is exposed via NBD could be surprising to the >> > NBD clients. >> > > So it seems to me that both block job and nbd server have the same > restriction on device: don't resize, and notify on close. So my question > is if we implement bdrv_add_command_blocker(), do the callers still need to distinguish what actions to block, or it's generally to block all the actions those change the device parameter? It would be a good start to have a list of things that are setting and checking bdrv_in_use. Then we can make a matrix. Paolo