All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: agraf@suse.de, quintela@redhat.com, stefanb@linux.vnet.ibm.com,
	mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org,
	aliguori@amazon.com, afaerber@suse.de
Subject: Re: [Qemu-devel] [RFC PATCH 00/16] visitor+BER migration format
Date: Wed, 26 Mar 2014 09:16:49 +0000	[thread overview]
Message-ID: <20140326091649.GA2504@work-vm> (raw)
In-Reply-To: <20140325204312.GB3169@redhat.com>

* Michael S. Tsirkin (mst@redhat.com) wrote:
> On Tue, Mar 25, 2014 at 08:17:11PM +0000, Dr. David Alan Gilbert (git) wrote:

<snip>

> >    5) At the moment you select BER output format by setting an environment
> >       variable ( export QEMUMIGFORMAT=BER ) , I need to put more thought
> >       in to the right way to do this, there are some harder questions like
> >       what happens to devices that are still using pre-vmstate encodings
> >       (that are currently sent as blobs) when they eventually convert over
> >       and thus how to keep compatibility with earlier BER output versions
> >       where they were blobs.
> 
> A simple way is the way we always changed migration
> format - trying this to the machine type.
> Old machine type gets you binary, newer one BER with blobs,
> then we can add more flags gradually.

Right, that should work; it gets a little messy to tie machine type
to formats for individual devices, but no big issue.

> With BER we'll actually be able to do smarter things in the future,
> such as send out multiple formats and have destination select
> the one it understands, but this isn't mandatory as a first step.
> 
> >    6) At the moment for blobs (i.e. pre-vmstate) the whole blob gets loaded
> >       into memory and then processed; that's not necessary and can be done
> >       with a QEMUFile shim.
> >    7) I need to sort out my Error** handling (probably in a lot of places)
> 
> That's mostly broken in migration as it is.
> 
> >    8) The visitors should be able to share much more code.
> > 
> > The not-yet-done:
> >    a) XBZRLE
> >    b) block-migration
> >    c) SPAPR (it's an iterative migration like RAM and block)
> >    d) RDMA (I'm guessing I've broken it, but haven't tried)
> >    e) Floats are currently sent as blobs.
> 
> So at least a,b and c  need to be done.

Yep, agreed; iterative migration stuff has direct byte/word putting all over
so is rather manual, so I just did enough to get it going first.

> Not sure about RDMA - it was never supported and no one
> seems to work on it.
> Maybe, somehow, it can use the old format when enabled?

I think Michael still throws bug fixes in from time to time, however my worry
is actually more about the Visitor conversion than the actual format change
that might break it; anyway needs testing and then we'll see.

> > What I've done:
> >   There are separate output visitors (binary compatible, debug and BER) and
> > they're selected by setting QEMUMIGFORMAT to one of 'debug', 'BER' or just
> > leaving it unset.
> > 
> >   The Input visitor is selected automatically from the first 4 bytes of the
> > file.
> 
> Not really necessary if you use machine type.

It's easy anyway.

> >   In general most types are BER sequences of indefinite length, with some
> > types that I've allocated an Application specific type tag to.  There is a hook
> > to give any VMState it's own type tag (which I've shown using one example
> > for cpu-common).  Integers and strings are standard 'universal' types.
> > 
> >   Objects with .get/.put methods or register_savevm are saved as an 'octet string'.
> > There are a few places where a device registered with .get/.put calls back into
> > vmstate_save_state for part of their state (typically for devices built on PCI)
> > and when they do that, even when in BER mode, those components get stored inside
> > the octet string in the old format.
> > 
> >   I've used the 'asn1c' tool to validate the schema (which is
> > in docs/specs/migration.schema) and also to verify streams that I've produced
> > match the schema.
> > 
> >   I've tested it with virt-test (hacked to have different source/dest qemu's)
> > and tried bin-bin, ber-ber, and pre-visitor-qemu -> this and
> > this -> pre-visitor-qemu just on the standard migration.default.tcp migration
> > test, but I've not tried a large combination of configurations.
> > 
> >   My fix for qemu_peek_buffer that's on the list is needed to stabilise
> > the binary format input visitor.
> > 
> >   I'll keep chipping away at that list, and would expect to pop another
> > version out in a month or so.
> > 
> > Dave
> > 
> > Dr. David Alan Gilbert (16):
> >   Visitor: Add methods for migration format use
> >   QEMUSizedBuffer/QEMUFile
> >   qemu-file: Add set/get tmp_visitor
> >   Header/constant/types fixes for visitors
> >   Visitor: Binary compatible output visitor
> >   Visitor: Debug output visitor
> >   Visitor: Binary compatible input visitor
> >   Visitor: Output path
> >   Visitor: Load path
> >   Visitor: Common types to use visitors
> >   Choose output visitor based on env variable
> >   BER Visitor: Create output visitor
> >   BER Visitor: Create input visitor
> >   Start some BER format docs
> >   ASN.1 schema for new migration format
> >   Wire in BER visitors
> 
> One nifty feature of Stefan's patches was that a
> set of unit tests for parser was included.
> Worth reusing?

Yes, unit tests are one thing I missed off my list but know
need doing.

Dave
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

      reply	other threads:[~2014-03-26  9:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-25 20:17 [Qemu-devel] [RFC PATCH 00/16] visitor+BER migration format Dr. David Alan Gilbert (git)
2014-03-25 20:17 ` [Qemu-devel] [RFC PATCH 01/16] Visitor: Add methods for migration format use Dr. David Alan Gilbert (git)
2014-06-05 17:00   ` Markus Armbruster
2014-06-05 17:43     ` Dr. David Alan Gilbert
2014-06-05 18:59       ` Dr. David Alan Gilbert
2014-06-06  8:19       ` Markus Armbruster
2014-06-06 11:44         ` Dr. David Alan Gilbert
2014-03-25 20:17 ` [Qemu-devel] [RFC PATCH 02/16] QEMUSizedBuffer/QEMUFile Dr. David Alan Gilbert (git)
2014-03-25 20:17 ` [Qemu-devel] [RFC PATCH 03/16] qemu-file: Add set/get tmp_visitor Dr. David Alan Gilbert (git)
2014-03-25 20:17 ` [Qemu-devel] [RFC PATCH 04/16] Header/constant/types fixes for visitors Dr. David Alan Gilbert (git)
2014-03-25 20:17 ` [Qemu-devel] [RFC PATCH 05/16] Visitor: Binary compatible output visitor Dr. David Alan Gilbert (git)
2014-03-25 20:17 ` [Qemu-devel] [RFC PATCH 06/16] Visitor: Debug " Dr. David Alan Gilbert (git)
2014-03-25 20:17 ` [Qemu-devel] [RFC PATCH 07/16] Visitor: Binary compatible input visitor Dr. David Alan Gilbert (git)
2014-03-25 20:17 ` [Qemu-devel] [RFC PATCH 08/16] Visitor: Output path Dr. David Alan Gilbert (git)
2014-03-25 20:17 ` [Qemu-devel] [RFC PATCH 09/16] Visitor: Load path Dr. David Alan Gilbert (git)
2014-03-25 20:17 ` [Qemu-devel] [RFC PATCH 10/16] Visitor: Common types to use visitors Dr. David Alan Gilbert (git)
2014-03-25 20:17 ` [Qemu-devel] [RFC PATCH 11/16] Choose output visitor based on env variable Dr. David Alan Gilbert (git)
2014-03-25 20:17 ` [Qemu-devel] [RFC PATCH 12/16] BER Visitor: Create output visitor Dr. David Alan Gilbert (git)
2014-03-25 20:17 ` [Qemu-devel] [RFC PATCH 13/16] BER Visitor: Create input visitor Dr. David Alan Gilbert (git)
2014-03-25 20:17 ` [Qemu-devel] [RFC PATCH 14/16] Start some BER format docs Dr. David Alan Gilbert (git)
2014-03-25 20:17 ` [Qemu-devel] [RFC PATCH 15/16] ASN.1 schema for new migration format Dr. David Alan Gilbert (git)
2014-03-25 20:17 ` [Qemu-devel] [RFC PATCH 16/16] Wire in BER visitors Dr. David Alan Gilbert (git)
2014-03-25 20:43 ` [Qemu-devel] [RFC PATCH 00/16] visitor+BER migration format Michael S. Tsirkin
2014-03-26  9:16   ` Dr. David Alan Gilbert [this message]

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=20140326091649.GA2504@work-vm \
    --to=dgilbert@redhat.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aliguori@amazon.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=stefanb@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.