aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2023-07-06 09:56:09 +0200
committerDavid Hildenbrand <david@redhat.com>2023-07-12 09:25:37 +0200
commitb01fd4b67a8fdf5a9ecf4ad5b49b70d52424f0f7 (patch)
treea09ea108464cf36872c1da1b823c7851a1c76c88 /include
parentf161c88a03c646ee308653d3ea99318901093309 (diff)
downloadqemu-b01fd4b67a8fdf5a9ecf4ad5b49b70d52424f0f7.zip
qemu-b01fd4b67a8fdf5a9ecf4ad5b49b70d52424f0f7.tar.gz
qemu-b01fd4b67a8fdf5a9ecf4ad5b49b70d52424f0f7.tar.bz2
virtio-mem: Support "x-ignore-shared" migration
To achieve desired "x-ignore-shared" functionality, we should not discard all RAM when realizing the device and not mess with preallocation/postcopy when loading device state. In essence, we should not touch RAM content. As "x-ignore-shared" gets set after realizing the device, we cannot rely on that. Let's simply skip discarding of RAM on incoming migration. Note that virtio_mem_post_load() will call virtio_mem_restore_unplugged() -- unless "x-ignore-shared" is set. So once migration finished we'll have a consistent state. The initial system reset will also not discard any RAM, because virtio_mem_unplug_all() will not call virtio_mem_unplug_all() when no memory is plugged (which is the case before loading the device state). Note that something like VM templating -- see commit b17fbbe55cba ("migration: allow private destination ram with x-ignore-shared") -- is currently incompatible with virtio-mem and ram_block_discard_range() will warn in case a private file mapping is supplied by virtio-mem. For VM templating with virtio-mem, it makes more sense to either (a) Create the template without the virtio-mem device and hotplug a virtio-mem device to the new VM instances using proper own memory backend. (b) Use a virtio-mem device that doesn't provide any memory in the template (requested-size=0) and use private anonymous memory. Message-ID: <20230706075612.67404-5-david@redhat.com> Tested-by: Mario Casquero <mcasquer@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David Hildenbrand <david@redhat.com>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions