]> git.proxmox.com Git - mirror_qemu.git/commit
virtio-mem: Fail if a memory backend with "prealloc=on" is specified
authorDavid Hildenbrand <david@redhat.com>
Tue, 17 Jan 2023 11:22:47 +0000 (12:22 +0100)
committerJuan Quintela <quintela@redhat.com>
Mon, 6 Feb 2023 18:22:56 +0000 (19:22 +0100)
commitce1761f0f9f0dde30a56cdcff68c034874fb91a0
tree83d89c9e084cdef0b7ec09ccbc7b88992a0a3caa
parent80fe315c384153af957ee94d43d08b90ad1d5ef7
virtio-mem: Fail if a memory backend with "prealloc=on" is specified

"prealloc=on" for the memory backend does not work as expected, as
virtio-mem will simply discard all preallocated memory immediately again.
In the best case, it's an expensive NOP. In the worst case, it's an
unexpected allocation error.

Instead, "prealloc=on" should be specified for the virtio-mem device only,
such that virtio-mem will try preallocating memory before plugging
memory dynamically to the guest. Fail if such a memory backend is
provided.

Tested-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>S
Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
hw/virtio/virtio-mem.c