From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vl8EQ-0006BD-6E for qemu-devel@nongnu.org; Mon, 25 Nov 2013 21:18:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vl8EK-0003Io-7c for qemu-devel@nongnu.org; Mon, 25 Nov 2013 21:18:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vl8EJ-0003Ii-VI for qemu-devel@nongnu.org; Mon, 25 Nov 2013 21:18:24 -0500 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 rAQ2IMUn010249 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 25 Nov 2013 21:18:22 -0500 Message-ID: <529404E6.3000904@redhat.com> Date: Tue, 26 Nov 2013 10:18:14 +0800 From: Fam Zheng MIME-Version: 1.0 References: <1385097894-1380-1-git-send-email-famz@redhat.com> <1385097894-1380-4-git-send-email-famz@redhat.com> <529384B2.7010109@redhat.com> In-Reply-To: <529384B2.7010109@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 3/7] block: Replace in_use with operation blocker List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, hbrock@redhat.com, qemu-devel@nongnu.org, rjones@redhat.com, imain@redhat.com, stefanha@redhat.com On 2013=E5=B9=B411=E6=9C=8826=E6=97=A5 01:11, Paolo Bonzini wrote: > Il 22/11/2013 06:24, Fam Zheng ha scritto: >> @@ -41,13 +41,11 @@ void *block_job_create(const BlockJobDriver *drive= r, BlockDriverState *bs, >> { >> BlockJob *job; >> >> - if (bs->job || bdrv_in_use(bs)) { >> + if (bs->job) { >> error_set(errp, QERR_DEVICE_IN_USE, bdrv_get_device_name(bs)= ); >> return NULL; >> } >> bdrv_ref(bs); > > Why is this check disappearing? > Because this patch is moving this check to callers, and changing it to=20 op blocker check. Fam