From: Fam Zheng <famz@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH] block: add 'backing' option to drive_add
Date: Tue, 18 Jun 2013 15:06:41 +0800 [thread overview]
Message-ID: <20130618070641.GB1220@localhost.nay.redhat.com> (raw)
In-Reply-To: <871u7zx6u3.fsf@blackfin.pond.sub.org>
On Tue, 06/18 08:37, Markus Armbruster wrote:
> Fam Zheng <famz@redhat.com> 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.
>
Maybe I meant basically the same as Kevin, but just that QEMU finds out
A has existing BDS, and reattach it.
> >> > > 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.
I assume it should be less wrong than having two BDS for the same file.
--
Fam
next prev parent reply other threads:[~2013-06-18 7:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1371457366-10993-1-git-send-email-famz@redhat.com>
[not found] ` <51BED513.3030800@redhat.com>
[not found] ` <20130617093241.GA22609@localhost.nay.redhat.com>
[not found] ` <51BEDCB9.5090905@redhat.com>
[not found] ` <20130617135253.GB3994@dhcp-200-207.str.redhat.com>
[not found] ` <51BF16B8.6040801@redhat.com>
[not found] ` <20130617142605.GD3994@dhcp-200-207.str.redhat.com>
[not found] ` <51BF213F.60601@redhat.com>
[not found] ` <20130617151238.GF3994@dhcp-200-207.str.redhat.com>
2013-06-18 3:58 ` [Qemu-devel] [PATCH] block: add 'backing' option to drive_add Fam Zheng
2013-06-18 6:32 ` Kevin Wolf
2013-06-18 7:00 ` Fam Zheng
2013-06-18 7:51 ` Kevin Wolf
2013-06-18 8:11 ` Fam Zheng
2013-06-18 8:52 ` Kevin Wolf
2013-06-18 14:18 ` Markus Armbruster
2013-06-19 1:17 ` Fam Zheng
2013-06-19 6:27 ` Markus Armbruster
2013-06-19 7:08 ` Fam Zheng
2013-06-18 6:37 ` Markus Armbruster
2013-06-18 7:06 ` Fam Zheng [this message]
2013-06-18 8:40 ` Paolo Bonzini
2013-06-18 8:56 ` Kevin Wolf
2013-06-18 9:11 ` Paolo Bonzini
2013-06-18 9:12 ` Fam Zheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130618070641.GB1220@localhost.nay.redhat.com \
--to=famz@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).