Received: from eggs.gnu.org ([2001:4830:134:3::10]:36534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW2oK-0003El-No for qemu-devel@nongnu.org; Mon, 22 Sep 2014 08:33:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XW2oA-000734-Nt for qemu-devel@nongnu.org; Mon, 22 Sep 2014 08:33:40 -0400 Received: from dew.nodalink.com ([95.130.14.197]:59636) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW2oA-0006wl-HX for qemu-devel@nongnu.org; Mon, 22 Sep 2014 08:33:34 -0400 Date: Mon, 22 Sep 2014 12:33:30 +0000 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140922123330.GE20345@nodalink.com> References: <1408723870-7826-1-git-send-email-benoit.canet@nodalink.com> <1408723870-7826-2-git-send-email-benoit.canet@nodalink.com> <20140909115646.GI4847@noname.str.redhat.com> <20140909142822.GA7953@nodalink.com> <20140912034833.GC5478@fam-t430.nay.redhat.com> <20140915151705.GA26550@nodalink.com> <20140918025748.GA23325@fam-t430.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20140918025748.GA23325@fam-t430.nay.redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] block: Make op blockers recursive List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , jcody@redhat.com, stefanha@redhat.com, qemu-devel@nongnu.org, =?iso-8859-1?Q?Beno=EEt?= Canet On Thu, Sep 18, 2014 at 10:57:48AM +0800, Fam Zheng wrote: > > > >=20 > > > > BLOCK_OP_TYPE_MIRROR_REPLACE is checked and blocked by block-job-= complete > > > > during the time the mirror finish when an arbitrary node of the g= raph must be > > > > replaced. > > >=20 > > > It seems to me mirror unblocks this operation from the job->blocker= when job > > > starts, and never block it (with the job->blocker) again. It's leak= ed. > > >=20 > >=20 > > block-job-complete will block it in mirror_complete. > >=20 > > BLOCK_OP_TYPE_MIRROR_REPLACE is blocked by driver-mirror code trigger= ed by > > block-job complete to block the "replaces" BDS during the end of the = mirroring. > >=20 > > If you find silly that block-job-complete prevent itself from running= twice on > > the same BDS by checking the blocker then blocking it then the existi= ng code is > > wrong. > >=20 > > Else the code in this current patch is correct. > >=20 > > Could you have a glance at "static void mirror_complete(BlockJob *job= , Error **errp)" > > and tell me what you think about the situation. You should also look = at > > check_to_replace_node. > >=20 >=20 > I'd prefer early error from user's point of view, so maybe checking and > blocking can be done during mirror_start instead, then we don't need th= e > relaxation. What's the advantage to delay the check to block-job-comple= te? >=20 > Fam BLOCK_OP_TYPE_MIRROR_REPLACE is the blocker for the replacement work so I= blocked it where the replacement happen. Another point is that until block-job-complete happen we are not complete= ly sure that this replacement operation will happen. Best regards Beno=EEt