intel_iommu: Fix root_scalable migration breakage
commit2811af3b497b2bfadf38cda0fc92a709f83e8a7e
authorPeter Xu <peterx@redhat.com>
Fri, 29 Mar 2019 06:14:21 +0000 (29 14:14 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 2 Apr 2019 15:49:14 +0000 (2 11:49 -0400)
tree685b0c5fc0fa2777f3831c2cb5eb571051f72ff7
parent20f86a75a75efe7d2743d2f746d2933d01d582f1
intel_iommu: Fix root_scalable migration breakage

When introducing the initial support for scalable mode we added a
new field into vmstate however we blindly migrate that field without
notice.  That'll break migration no matter forward or backward.

The normal way should be that we use something like
VMSTATE_UINT32_TEST() or subsections for the new vmstate field however
for this case of vt-d we can even make it simpler because we've
already migrated all the registers and it'll be fairly simple that we
re-generate root_scalable field from the register values during post
load of the device.

Fixes: fb43cf739e ("intel_iommu: scalable mode emulation")
Reviewed-by: Yi Sun <yi.y.sun@linux.intel.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20190329061422.7926-2-peterx@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/i386/intel_iommu.c