From: Peter Xu <peterx@redhat.com>
To: marcandre.lureau@redhat.com
Cc: qemu-devel@nongnu.org, "Gerd Hoffmann" <kraxel@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Fabiano Rosas" <farosas@suse.de>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Yanan Wang" <wangyanan55@huawei.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Eduardo Habkost" <eduardo@habkost.net>
Subject: Re: [PATCH v2 3/4] virtio-gpu: add x-vmstate-version
Date: Mon, 13 May 2024 22:29:01 -0600 [thread overview]
Message-ID: <ZkLojVI4ZAKANIBr@x1n> (raw)
In-Reply-To: <20240513071905.499143-4-marcandre.lureau@redhat.com>
Hey, Marc-Andre,
On Mon, May 13, 2024 at 11:19:04AM +0400, marcandre.lureau@redhat.com wrote:
> diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
> index ae831b6b3e..7f9fb5eacc 100644
> --- a/hw/display/virtio-gpu.c
> +++ b/hw/display/virtio-gpu.c
> @@ -1234,7 +1234,8 @@ static int virtio_gpu_save(QEMUFile *f, void *opaque, size_t size,
> }
> qemu_put_be32(f, 0); /* end of list */
>
> - return vmstate_save_state(f, &vmstate_virtio_gpu_scanouts, g, NULL);
> + return vmstate_save_state_v(f, &vmstate_virtio_gpu_scanouts, g,
> + NULL, g->vmstate_version, NULL);
> }
>
> static bool virtio_gpu_load_restore_mapping(VirtIOGPU *g,
> @@ -1339,7 +1340,7 @@ static int virtio_gpu_load(QEMUFile *f, void *opaque, size_t size,
> }
>
> /* load & apply scanout state */
> - vmstate_load_state(f, &vmstate_virtio_gpu_scanouts, g, 1);
> + vmstate_load_state(f, &vmstate_virtio_gpu_scanouts, g, g->vmstate_version);
[sorry for a late response; attending a conf, and will reply to the v1
thread later for the other discussions..]
These two changes shouldn't be needed if we go with the .field_exists()
approach, am I right? IIUC in that case we can keep the version 1 here and
don't boost anything, because we relied on the machine versions.
IIUC this might be the reason why we found 9.0 mahines are broken on
migration. E.g, IIUC my original patch should work for 9.0<->9.0 too.
Thanks,
>
> return 0;
> }
> @@ -1659,6 +1660,7 @@ static Property virtio_gpu_properties[] = {
> DEFINE_PROP_BIT("blob", VirtIOGPU, parent_obj.conf.flags,
> VIRTIO_GPU_FLAG_BLOB_ENABLED, false),
> DEFINE_PROP_SIZE("hostmem", VirtIOGPU, parent_obj.conf.hostmem, 0),
> + DEFINE_PROP_UINT8("x-vmstate-version", VirtIOGPU, vmstate_version, 1),
> DEFINE_PROP_END_OF_LIST(),
> };
>
> --
> 2.41.0.28.gd7d8841f67
>
--
Peter Xu
next prev parent reply other threads:[~2024-05-14 4:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-13 7:19 [PATCH v2 0/4] Fix "virtio-gpu: fix scanout migration post-load" marcandre.lureau
2024-05-13 7:19 ` [PATCH v2 1/4] migration: add "exists" info to load-state-field trace marcandre.lureau
2024-05-13 7:19 ` [PATCH v2 2/4] migration: fix a typo marcandre.lureau
2024-05-13 22:27 ` Fabiano Rosas
2024-05-14 4:29 ` Peter Xu
2024-05-13 7:19 ` [PATCH v2 3/4] virtio-gpu: add x-vmstate-version marcandre.lureau
2024-05-14 4:29 ` Peter Xu [this message]
2024-05-14 7:25 ` Marc-André Lureau
2024-05-14 13:06 ` Peter Xu
2024-05-13 7:19 ` [PATCH v2 4/4] virtio-gpu: fix v2 migration marcandre.lureau
2024-05-13 12:55 ` [PATCH v2 0/4] Fix "virtio-gpu: fix scanout migration post-load" Fiona Ebner
2024-05-13 13:21 ` Marc-André Lureau
2024-05-13 13:44 ` Fiona Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZkLojVI4ZAKANIBr@x1n \
--to=peterx@redhat.com \
--cc=eduardo@habkost.net \
--cc=farosas@suse.de \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=wangyanan55@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).