diff options
author | David Hildenbrand <david@redhat.com> | 2023-09-26 20:57:29 +0200 |
---|---|---|
committer | David Hildenbrand <david@redhat.com> | 2023-10-12 14:15:22 +0200 |
commit | 766aa0a654d887ad8fed2f116c84a89e20102c14 (patch) | |
tree | 291cac1b0357ffb9fc0bd73223ff669c83899289 /stubs | |
parent | f9716f4b0d6eaee5d0b1ccf428a102e0c148fa30 (diff) |
memory-device,vhost: Support memory devices that dynamically consume memslots
We want to support memory devices that have a dynamically managed memory
region container as device memory region. This device memory region maps
multiple RAM memory subregions (e.g., aliases to the same RAM memory
region), whereby these subregions can be (un)mapped on demand.
Each RAM subregion will consume a memslot in KVM and vhost, resulting in
such a new device consuming memslots dynamically, and initially usually
0. We already track the number of used vs. required memslots for all
memslots. From that, we can derive the number of reserved memslots that
must not be used otherwise.
The target use case is virtio-mem and the hyper-v balloon, which will
dynamically map aliases to RAM memory region into their device memory
region container.
Properly document what's supported and what's not and extend the vhost
memslot check accordingly.
Message-ID: <20230926185738.277351-10-david@redhat.com>
Reviewed-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Diffstat (limited to 'stubs')
-rw-r--r-- | stubs/memory_device.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/stubs/memory_device.c b/stubs/memory_device.c index e75cac62dc..318a5d4187 100644 --- a/stubs/memory_device.c +++ b/stubs/memory_device.c @@ -10,3 +10,8 @@ uint64_t get_plugged_memory_size(void) { return (uint64_t)-1; } + +unsigned int memory_devices_get_reserved_memslots(void) +{ + return 0; +} |