[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 22/47] QEMU_VM_CMD_PACKAGED: Send a packaged
From: |
David Gibson |
Subject: |
Re: [Qemu-devel] [PATCH v4 22/47] QEMU_VM_CMD_PACKAGED: Send a packaged chunk of migration stream |
Date: |
Tue, 18 Nov 2014 15:36:43 +1100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Tue, Nov 04, 2014 at 10:19:15AM +0000, Dr. David Alan Gilbert wrote:
> * David Gibson (address@hidden) wrote:
> > On Fri, Oct 03, 2014 at 06:47:28PM +0100, Dr. David Alan Gilbert (git)
> > wrote:
> > > From: "Dr. David Alan Gilbert" <address@hidden>
> > >
> > > QEMU_VM_CMD_PACKAGED is a migration command that allows a chunk
> > > of migration stream to be sent in one go, and be received by
> > > a separate instance of the loadvm loop while not interacting
> > > with the migration stream.
> > >
> > > This is used by postcopy to load device state (from the package)
> > > while loading memory pages from the main stream.
> > >
> > > Signed-off-by: Dr. David Alan Gilbert <address@hidden>
> >
> > Reviewed-by: David Gibson <address@hidden>
> >
> > Though one minor comment:
> >
> > [snip]
> > > +/* We have a buffer of data to send; we don't want that all to be loaded
> > > + * by the command itself, so the command contains just the length of the
> > > + * extra buffer that we then send straight after it.
> > > + * TODO: Must be a better way to organise that
> >
> > I'm not quite understanding what that comment's getting at.
>
> We have these VM Commands; and they are a command type, and a length:
> CMD_whatever
> length: whatever
> data for whatever
>
> This comment is describing that, to make things easier for this code it's
> ended up as:
>
> CMD_PACKAGED
> CMD length: 4 <--- i.e. just enough to hold the next 'length' field
> package length
> ---------------
> The package
>
> Which is a little different, hence i thought it needed the comment.
Ah.. right. That seems.. gratuitously easy to get wrong further down
the track. Why not just use the cmd length as the package length.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
pgp6Se4guLReM.pgp
Description: PGP signature