qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/8] migration: Add VMSTATE_WITH_TMP


From: Juan Quintela
Subject: Re: [Qemu-devel] [PATCH 3/8] migration: Add VMSTATE_WITH_TMP
Date: Mon, 13 Feb 2017 13:04:56 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

"Dr. David Alan Gilbert (git)" <address@hidden> wrote:
> From: "Dr. David Alan Gilbert" <address@hidden>
>
> 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 <address@hidden>
> Reviewed-by: David Gibson <address@hidden>

My idea was to do the other way around.

But as you beat me with the idea.

Reviewed-by: Juan Quintela <address@hidden>


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 via email to

[Prev in Thread] Current Thread [Next in Thread]