[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] migration: Support gtree migration
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH v2] migration: Support gtree migration |
Date: |
Thu, 3 Oct 2019 15:58:37 +0100 |
User-agent: |
Mutt/1.12.1 (2019-06-15) |
On Thu, Oct 03, 2019 at 04:54:31PM +0200, Eric Auger wrote:
> Introduce support for GTree migration. A custom save/restore
> is implemented. Each item is made of a key and a data. For that
> reason, 2 VMSD objects are passed into the GTree VMStateField.
>
> When putting the items, the tree is traversed in sorted order by
> g_tree_foreach.
>
> On the get() path, gtrees must be allocated using the proper
> key compare, key destroy and value destroy. This can be done
> externally of automatically. If done automatically, the set of
> functions must be stored within the VMStateField in a new opaque
> pointer.
>
> Automatic allocation is needed for complex state save/restore.
> For instance the virtio-iommu uses a gtree of domain and each
> domain has a gtree of mappings.
>
> Special care was taken about direct key (ie. when the key is not
> a pointer to an object but is directly a value).
>
> Tests are added to test save/dump of structs containing gtrees
> including the virtio-iommu domain/mappings scenario.
>
> Signed-off-by: Eric Auger <address@hidden>
>
> ---
>
> diff --git a/migration/vmstate-types.c b/migration/vmstate-types.c
> index bee658a1b2..06c4663de6 100644
> --- a/migration/vmstate-types.c
> +++ b/migration/vmstate-types.c
> @@ -17,6 +17,7 @@
> #include "qemu/error-report.h"
> #include "qemu/queue.h"
> #include "trace.h"
> +#include <glib.h>
Not required, everything in QEMU includes this already.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|