virtio-gpu: fix v2 migration
commit40a23ef643664b5c1021a9789f9d680b6294fb50
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 16 May 2024 08:40:22 +0000 (16 12:40 +0400)
committerFabiano Rosas <farosas@suse.de>
Wed, 22 May 2024 20:34:41 +0000 (22 17:34 -0300)
tree91af1e50c0bb69bf2b4792698b4cd6c698ebfaec
parentf0937ec669f9f39f5ece39f62d048606b9ee3877
virtio-gpu: fix v2 migration

Commit dfcf74fa ("virtio-gpu: fix scanout migration post-load") broke
forward/backward version migration. Versioning of nested VMSD structures
is not straightforward, as the wire format doesn't have nested
structures versions. Introduce x-scanout-vmstate-version and a field
test to save/load appropriately according to the machine version.

Fixes: dfcf74fa ("virtio-gpu: fix scanout migration post-load")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Fiona Ebner <f.ebner@proxmox.com>
[fixed long lines]
Signed-off-by: Fabiano Rosas <farosas@suse.de>
hw/core/machine.c
hw/display/virtio-gpu.c
include/hw/virtio/virtio-gpu.h