qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
Cc: qemu-devel@nongnu.org, amit.shah@redhat.com,
	samuel.thibault@ens-lyon.org, jan.kiszka@siemens.com,
	duanj@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH 3/8] migration: Add VMSTATE_WITH_TMP
Date: Mon, 13 Feb 2017 13:04:56 +0100	[thread overview]
Message-ID: <87fuji70uv.fsf@emacs.mitica> (raw)
In-Reply-To: <20161027153217.16984-4-dgilbert@redhat.com> (David Alan Gilbert's message of "Thu, 27 Oct 2016 16:32:12 +0100")

"Dr. David Alan Gilbert (git)" <dgilbert@redhat.com> wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> VMSTATE_WITH_TMP is for handling structures where some calculation
> or rearrangement of the data needs to be performed before the data
> hits the wire.
> For example,  where the value on the wire is an offset from a
> non-migrated base, but the data in the structure is the actual pointer.
>
> To use it, a temporary type is created and a vmsd used on that type.
> The first element of the type must be 'parent' a pointer back to the
> type of the main structure.  VMSTATE_WITH_TMP takes care of allocating
> and freeing the temporary before running the child vmsd.
>
> The post_load/pre_save on the child vmsd can copy things from the parent
> to the temporary using the parent pointer and do any other calculations
> needed; it can then use normal VMSD entries to do the actual data
> storage without having to fiddle around with qemu_get_*/qemu_put_*
>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

My idea was to do the other way around.

But as you beat me with the idea.

Reviewed-by: Juan Quintela <quintela@redhat.com>


Bascially what I created was a VMSTATE_SYNTHETIC() where the field value
is null.  You create a new get/put functions for the special values.


But looking for far away it is basically the same, I just preffered the
name O:-)

Later, Juan

  reply	other threads:[~2017-02-13 12:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-27 15:32 [Qemu-devel] [PATCH 0/8] VMSTATE_WITH_TMP and it's use in SLIRP Dr. David Alan Gilbert (git)
2016-10-27 15:32 ` [Qemu-devel] [PATCH 1/8] migration: extend VMStateInfo Dr. David Alan Gilbert (git)
2017-02-13 12:02   ` Juan Quintela
2016-10-27 15:32 ` [Qemu-devel] [PATCH 2/8] add QEMU_BUILD_BUG_EXPR Dr. David Alan Gilbert (git)
2017-02-13 12:02   ` Juan Quintela
2016-10-27 15:32 ` [Qemu-devel] [PATCH 3/8] migration: Add VMSTATE_WITH_TMP Dr. David Alan Gilbert (git)
2017-02-13 12:04   ` Juan Quintela [this message]
2016-10-27 15:32 ` [Qemu-devel] [PATCH 4/8] tests/migration: Add test for VMSTATE_WITH_TMP Dr. David Alan Gilbert (git)
2017-02-13 12:06   ` Juan Quintela
2016-10-27 15:32 ` [Qemu-devel] [PATCH 5/8] slirp: VMState conversion; tcpcb Dr. David Alan Gilbert (git)
2017-02-13 12:06   ` Juan Quintela
2016-10-27 15:32 ` [Qemu-devel] [PATCH 6/8] slirp: VMStatify sbuf Dr. David Alan Gilbert (git)
2016-10-30 14:40   ` Samuel Thibault
2017-02-13 12:07   ` Juan Quintela
2016-10-27 15:32 ` [Qemu-devel] [PATCH 7/8] slirp: VMStatify socket level Dr. David Alan Gilbert (git)
2016-10-30 14:47   ` Samuel Thibault
2016-11-07 19:55     ` Dr. David Alan Gilbert
2017-02-13 12:13   ` Juan Quintela
2016-10-27 15:32 ` [Qemu-devel] [PATCH 8/8] slirp: VMStatify remaining except for loop Dr. David Alan Gilbert (git)
2016-10-30 14:51   ` Samuel Thibault
2016-11-07 19:30     ` Dr. David Alan Gilbert
2017-02-13 12:09   ` Juan Quintela

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=87fuji70uv.fsf@emacs.mitica \
    --to=quintela@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=duanj@linux.vnet.ibm.com \
    --cc=jan.kiszka@siemens.com \
    --cc=qemu-devel@nongnu.org \
    --cc=samuel.thibault@ens-lyon.org \
    /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).