Received: from eggs.gnu.org ([2001:4830:134:3::10]:40728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UopXk-0001qA-4s for qemu-devel@nongnu.org; Tue, 18 Jun 2013 02:37:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UopXj-0004PU-1h for qemu-devel@nongnu.org; Tue, 18 Jun 2013 02:37:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8769) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UopXi-0004PM-Or for qemu-devel@nongnu.org; Tue, 18 Jun 2013 02:37:26 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5I6bQUt002142 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 18 Jun 2013 02:37:26 -0400 From: Markus Armbruster References: <1371457366-10993-1-git-send-email-famz@redhat.com> <51BED513.3030800@redhat.com> <20130617093241.GA22609@localhost.nay.redhat.com> <51BEDCB9.5090905@redhat.com> <20130617135253.GB3994@dhcp-200-207.str.redhat.com> <51BF16B8.6040801@redhat.com> <20130617142605.GD3994@dhcp-200-207.str.redhat.com> <51BF213F.60601@redhat.com> <20130617151238.GF3994@dhcp-200-207.str.redhat.com> <20130618035854.GA17533@localhost.nay.redhat.com> Date: Tue, 18 Jun 2013 08:37:24 +0200 In-Reply-To: <20130618035854.GA17533@localhost.nay.redhat.com> (Fam Zheng's message of "Tue, 18 Jun 2013 11:58:54 +0800") Message-ID: <871u7zx6u3.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] block: add 'backing' option to drive_add List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Paolo Bonzini , qemu-devel@nongnu.org, stefanha@redhat.com Fam Zheng writes: > On Mon, 06/17 17:12, Kevin Wolf wrote: >> Am 17.06.2013 um 16:46 hat Paolo Bonzini geschrieben: >> > Il 17/06/2013 16:26, Kevin Wolf ha scritto: >> > > Am 17.06.2013 um 16:01 hat Paolo Bonzini geschrieben: >> > >> Il 17/06/2013 15:52, Kevin Wolf ha scritto: >> > >>> It's not a new thought that we need to change the block layer so that a >> > >>> BlockDriverState can't be "empty", but that one BlockDriverState always >> > >>> refers to one image. If you change media, you attach a different >> > >>> BlockDriverState to the device. Once you have this, you can start >> > >>> refcounting BlockDriverStates, so that the backing file remains usable >> > >>> while the guest device already uses a different image. >> > >>> >> > >>> Not that it's it easy to get there... >> > >> >> > >> I'm not sure that is safe to do. >> > >> >> > >> Consider the case where the guest switches from A to B during backup, >> > >> and then from B to A. You get two BDS for the same file, which pretty >> > >> much means havoc. >> > > >> > > Well, yes, it means that the management tool needs to know what it's >> > > doing. It shouldn't create a second BDS for A, but reattach the still >> > > existing one. >> > >> > How? That would require the management tool to know the full chain of >> > BDSes that were opened in the past. >> >> They better know on which files they are operating. It's not like the >> management could be unaware of running backup jobs or things like that. >> > > Is there any case that QEMU needs to have two BDS pointing to the same > file? Maybe, I don't know. > If not, can we try to detect such case on opening Gee, what a nice swamp you found there! For local files, you can compare (dev-major, dev-minor, inode). Beyond that, you tend not to get comparisons, but best guesses. > and try to > reuse the bs? I doubt reusing the BDS is correct in the general case. [...]