On 7/16/2024 5:19 AM, Igor Mammedov wrote:
On Sun, 30 Jun 2024 12:40:24 -0700
Steve Sistare <steven.sistare@oracle.com> wrote:
Allocate anonymous memory using mmap MAP_ANON or memfd_create depending
on the value of the anon-alloc machine property. This affects
memory-backend-ram objects, guest RAM created with the global -m option
but without an associated memory-backend object and without the -mem-path
option
nowadays, all machines were converted to use memory backend for VM RAM.
so -m option implicitly creates memory-backend object,
which will be either MEMORY_BACKEND_FILE if -mem-path present
or MEMORY_BACKEND_RAM otherwise.
Yes. I dropped an an important adjective, "implicit".
"guest RAM created with the global -m option but without an explicit
associated
memory-backend object and without the -mem-path option"
To access the same memory in the old and new QEMU processes, the memory
must be mapped shared. Therefore, the implementation always sets
RAM_SHARED if alloc-anon=memfd, except for memory-backend-ram, where the
user must explicitly specify the share option. In lieu of defining a new
so statement at the top that memory-backend-ram is affected is not
really valid?
memory-backend-ram is affected by alloc-anon. But in addition, the user must
explicitly add the "share" option. I don't implicitly set share in this case,
because I would be overriding the user's specification of the memory object's
property,
which would be private if omitted.