Received: from eggs.gnu.org ([2001:4830:134:3::10]:48506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YigDa-00046y-Qz for qemu-devel@nongnu.org; Thu, 16 Apr 2015 05:36:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YigDX-0007Hs-3g for qemu-devel@nongnu.org; Thu, 16 Apr 2015 05:36:18 -0400 From: Alberto Garcia In-Reply-To: <552E8D2E.8060103@redhat.com> References: <552E8D2E.8060103@redhat.com> Date: Thu, 16 Apr 2015 11:36:11 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 4/6] block: Support streaming to an intermediate layer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Stefan Hajnoczi , qemu-block@nongnu.org On Wed 15 Apr 2015 06:09:18 PM CEST, Max Reitz wrote: >> + orig_bs_flags = bdrv_get_flags(bs); >> + if (!(orig_bs_flags & BDRV_O_RDWR)) { > > I feel like we don't want to do this if we're not streaming to an > intermediate layer but to the top layer (because that means there is > some reason for the BDS to be read-only beyond it just being a backing > BDS). I didn't think about this... that I can fix easily, but I wonder what's the scenario where the top layer is read-only. >> + /* Block all intermediate nodes between bs and base, because they >> + * will disappear from the chain after this operation */ > > Hm, do we really need to? There's a difference between "it doesn't > make sense, but it works if you want to" and "it will > break". Shouldn't it be enough that the intermediate nodes are all > read-only anyway (hopefully)? I don't think that the fact that intermediate nodes are read-only changes anything, because some operations (this one, block-commit) reopens them in r/w mode. > But then again, it probably won't hurt and I don't really want to > think about the implications of trying to run a block-commit or a > separate block-stream on the chain... I actually tried with scenarios such as A>B>C>D>E, streaming from B to E and from A to C simultaneously, and it seems to work (at least I didn't see any obvious problems), but I don't think we want to support that because a) I don't see the use case and b) we're likely opening a can of worms. What we can do is stream from A to C and from D to E at the same time, that would be allowed with these patches and I don't see any obvious reason why it would fail. Berto