qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Wolfgang Richter <wolf@cs.cmu.edu>,
	qemu-devel <qemu-devel@nongnu.org>,
	stefanha <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [RFC] block-trace Low Level Command Supporting Disk Introspection
Date: Wed, 15 May 2013 09:59:04 +0200	[thread overview]
Message-ID: <20130515075904.GA2858@dhcp-200-207.str.redhat.com> (raw)
In-Reply-To: <51926A37.3060902@redhat.com>

Am 14.05.2013 um 18:45 hat Paolo Bonzini geschrieben:
> Il 14/05/2013 17:48, Wolfgang Richter ha scritto:
> > On Tue, May 14, 2013 at 6:04 AM, Paolo Bonzini <pbonzini@redhat.com
> > <mailto:pbonzini@redhat.com>> wrote:
> > 
> >     Il 14/05/2013 10:50, Kevin Wolf ha scritto:
> >     > Or, to translate it into our existing terminology, drive-mirror
> >     > implements a passive mirror, you're proposing an active one (which we
> >     > do want to have).
> >     >
> >     > With an active mirror, we'll want to have another choice: The
> >     mirror can
> >     > be synchronous (guest writes only complete after the mirrored
> >     write has
> >     > completed) or asynchronous (completion is based only on the original
> >     > image). It should be easy enough to support both once an active mirror
> >     > exists.
> > 
> >     Right, I'm waiting for Stefan's block-backup to give me the "right"
> >     hooks for the active mirror.
> > 
> >     The bulk phase will always be passive, but an active-asynchronous mirror
> >     has some interesting properties and it makes sense to implement it.
> > 
> > 
> > Do you mean you'd model the 'active' mode after 'block-backup,' or actually
> > call functions provided by 'block-backup'?
> 
> No, I'll just reuse the same hooks within block/mirror.c (almost... it
> looks like I need after_write too, not just before_write :( that's a
> pity).

Makes me wonder if using a real BlockDriver for the filter from the
beginning wouldn't be better than accumulating more and more hooks and
having to find ways to pass data from 'before' to 'after' hooks...

> Basically:
> 
> 1) before the write, if there is space in the job's buffers, allocate a
> MirrorOp and a data buffer for the write.  Also record whether the block
> was dirty before;
> 
> 2) after the write, do nothing if there was no room to allocate the data
> buffer.  Else clear the block from the dirty bitmap.  If the block was
> dirty, read the whole cluster from the source as in passive mirroring.
> If it wasn't, copy the data from guest memory to the preallocated buffer
> and write it to the destination;

Does the "if there was no room" part mean that the mirror is active only
sometimes?

And why even bother with a dirty bitmap for an active mirror? The
background job that sequentially processes the whole image only needs a
counter, no bitmap.

At which point it looks like implementing it separate from mirror.c
could make more sense.

Kevin

  parent reply	other threads:[~2013-05-15  7:59 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-13 21:21 [Qemu-devel] [RFC] block-trace Low Level Command Supporting Disk Introspection Wolfgang Richter
2013-05-14  8:40 ` Stefan Hajnoczi
2013-05-14 15:42   ` Wolfgang Richter
2013-05-14  8:50 ` Kevin Wolf
2013-05-14 10:04   ` Paolo Bonzini
2013-05-14 15:48     ` Wolfgang Richter
2013-05-14 16:45       ` Paolo Bonzini
2013-05-14 19:30         ` Wolfgang Richter
2013-05-15  7:59         ` Kevin Wolf [this message]
2013-05-15  8:25           ` Paolo Bonzini
2013-05-15  8:53             ` Kevin Wolf
2013-05-15  9:16               ` Paolo Bonzini
2013-05-15  9:46                 ` Kevin Wolf
2013-05-15 11:54                   ` Paolo Bonzini
2013-05-22 15:46                     ` Wolfgang Richter
2013-05-14 15:45   ` Wolfgang Richter
2013-05-16 13:44 ` Richard W.M. Jones
2013-05-22 15:51   ` Wolfgang Richter
2013-05-22 16:11     ` Paolo Bonzini
2013-05-22 16:29       ` Wolfgang Richter
2013-05-22 16:42     ` Richard W.M. Jones
2013-05-22 18:32       ` Wolfgang Richter
2013-05-22 19:26         ` Richard W.M. Jones
2013-05-22 19:38           ` Wolfgang Richter
2013-05-22 20:47             ` Richard W.M. Jones
2013-05-22 21:46               ` Paolo Bonzini
2013-05-23  7:50                 ` Stefan Hajnoczi

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=20130515075904.GA2858@dhcp-200-207.str.redhat.com \
    --to=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=wolf@cs.cmu.edu \
    /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).