Message ID | 20230822114504.239505-9-david@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | memory-backend-file related improvements and VM templating support | expand |
Hello, At 2023-08-22 19:44:56, "David Hildenbrand" <david@redhat.com> wrote: >"-mem-path" corresponds to "memory-backend-file,share=off" and, >therefore, creates a private COW mapping of the file. For multi-proces >QEMU, we need proper shared file-backed memory. > >Let's make that clearer. > >Signed-off-by: David Hildenbrand <david@redhat.com> >--- > docs/devel/multi-process.rst | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/docs/devel/multi-process.rst b/docs/devel/multi-process.rst >index e4801751f2..4ef539c0b0 100644 >--- a/docs/devel/multi-process.rst >+++ b/docs/devel/multi-process.rst >@@ -409,8 +409,9 @@ the initial messages sent to the emulation process is a guest memory > table. Each entry in this table consists of a file descriptor and size > that the emulation process can ``mmap()`` to directly access guest > memory, similar to ``vhost_user_set_mem_table()``. Note guest memory >-must be backed by file descriptors, such as when QEMU is given the >-*-mem-path* command line option. >+must be backed by shared file-backed memory, for example, using >+*-object memory-backend-file,share=on* and setting that memory backend >+as RAM for the machine. > > IOMMU operations > ^^^^^^^^^^^^^^^^ About "-mem-path" and "-object memory-backend-file". I have mentioned a error message suggestion, maybe you can consider it? The error message related to "-object memory-backend-file,id=pc.ram" is confusing, as is shown below: (https://lore.kernel.org/all/2337d9f.16d6.189e8682901.Coremail.logoerthiner1@163.com/) > > Wait ... I thought it should not work but it did work today. How bad am I at reading > the correct part of documentation ... > > '-machine q35 -m 512M' is equivalent to '-object > memory-backend-file,id=pc.ram,size=512M > -machine q35,memory-backend=pc.ram', > the latter works, and the two mentioned setup can be > migrated from one to another. > > What I was consistently trying was '-object > memory-backend-file,id=pc.ram,size=512M -machine q35', and qemu raises an error > for this in a recent update: > > ``` > qemu-system-x86_64: object name 'pc.ram' is reserved for the default RAM backend, it can't be used for any other purposes. Change the object's 'id' to something else > ``` > > This error is misleading. Actually in this case, the error report message should be more > close to: > ``` > object name 'pc.ram' is reserved for the default RAM backend, it can't > be used for any other purposes. Change the object's 'id' to something > else, or append "memory-backend=pc.ram" to -machine arguments > ``` > > (I suggest rewriting the error message like this string because of the confusion just now) > > > Even though the default memory backend name is pc.ram, the > '-machine q35,memory-backend=pc.ram' part explicitly marks that qemu > uses a memory backend named pc.ram, rather than rely on default. > > It seems that if it "rely on default" and memory-backend-file has an id > of "pc.ram" (in x86_64 of course), it will fail. > > Great. Now I will consider using a "-object > memory-backend-file,id=pc.ram,size=512M > -machine q35,memory-backend=pc.ram" -- Regards, logoerthiner
On 22.08.23 15:21, ThinerLogoer wrote: > Hello, > > At 2023-08-22 19:44:56, "David Hildenbrand" <david@redhat.com> wrote: >> "-mem-path" corresponds to "memory-backend-file,share=off" and, >> therefore, creates a private COW mapping of the file. For multi-proces >> QEMU, we need proper shared file-backed memory. >> >> Let's make that clearer. >> >> Signed-off-by: David Hildenbrand <david@redhat.com> >> --- >> docs/devel/multi-process.rst | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/docs/devel/multi-process.rst b/docs/devel/multi-process.rst >> index e4801751f2..4ef539c0b0 100644 >> --- a/docs/devel/multi-process.rst >> +++ b/docs/devel/multi-process.rst >> @@ -409,8 +409,9 @@ the initial messages sent to the emulation process is a guest memory >> table. Each entry in this table consists of a file descriptor and size >> that the emulation process can ``mmap()`` to directly access guest >> memory, similar to ``vhost_user_set_mem_table()``. Note guest memory >> -must be backed by file descriptors, such as when QEMU is given the >> -*-mem-path* command line option. >> +must be backed by shared file-backed memory, for example, using >> +*-object memory-backend-file,share=on* and setting that memory backend >> +as RAM for the machine. >> >> IOMMU operations >> ^^^^^^^^^^^^^^^^ > > About "-mem-path" and "-object memory-backend-file". > > I have mentioned a error message suggestion, maybe you can consider it? The > error message related to "-object memory-backend-file,id=pc.ram" is confusing, > as is shown below: (https://lore.kernel.org/all/2337d9f.16d6.189e8682901.Coremail.logoerthiner1@163.com/) Oh, I missed that. Let me see if I can clarify that! Thanks!
diff --git a/docs/devel/multi-process.rst b/docs/devel/multi-process.rst index e4801751f2..4ef539c0b0 100644 --- a/docs/devel/multi-process.rst +++ b/docs/devel/multi-process.rst @@ -409,8 +409,9 @@ the initial messages sent to the emulation process is a guest memory table. Each entry in this table consists of a file descriptor and size that the emulation process can ``mmap()`` to directly access guest memory, similar to ``vhost_user_set_mem_table()``. Note guest memory -must be backed by file descriptors, such as when QEMU is given the -*-mem-path* command line option. +must be backed by shared file-backed memory, for example, using +*-object memory-backend-file,share=on* and setting that memory backend +as RAM for the machine. IOMMU operations ^^^^^^^^^^^^^^^^
"-mem-path" corresponds to "memory-backend-file,share=off" and, therefore, creates a private COW mapping of the file. For multi-proces QEMU, we need proper shared file-backed memory. Let's make that clearer. Signed-off-by: David Hildenbrand <david@redhat.com> --- docs/devel/multi-process.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)