[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-5.0 v11 18/20] virtio-iommu: Support migration
From: |
Peter Xu |
Subject: |
Re: [PATCH for-5.0 v11 18/20] virtio-iommu: Support migration |
Date: |
Tue, 10 Dec 2019 15:01:10 -0500 |
User-agent: |
Mutt/1.12.1 (2019-06-15) |
On Fri, Nov 22, 2019 at 07:29:41PM +0100, Eric Auger wrote:
> +static const VMStateDescription vmstate_virtio_iommu_device = {
> + .name = "virtio-iommu-device",
> + .minimum_version_id = 1,
> + .version_id = 1,
> + .post_load = iommu_post_load,
> + .fields = (VMStateField[]) {
> + VMSTATE_GTREE_DIRECT_KEY_V(domains, VirtIOIOMMU, 1,
> + &vmstate_domain, viommu_domain),
> + VMSTATE_GTREE_DIRECT_KEY_V(endpoints, VirtIOIOMMU, 1,
> + &vmstate_endpoint, viommu_endpoint),
IIUC vmstate_domain already contains all the endpoint information (in
endpoint_list of vmstate_domain), but here we migrate it twice. I
suppose that's why now we need reconstruct_ep_domain_link() to fixup
the duplicated migration?
Then I'll instead ask whether we can skip migrating here? Then in
post_load we simply:
foreach(domain)
foreach(endpoint in domain)
g_tree_insert(s->endpoints);
It might help to avoid the reconstruct_ep_domain_link ugliness?
And besides, I also agree with Jean that the endpoint data structure
could be reused with IOMMUDevice somehow.
Thanks,
--
Peter Xu