At 2023-08-08 03:07:31, "David Hildenbrand" <da...@redhat.com> wrote: >Patch #1 is the result of the discussion of: > "[PATCH v2] softmmu/physmem: try opening file readonly before failure > in file_ram_open" [1] > >Instead of handling it inside file_ram_open(), handle it in the caller >and only fallback to readonly in a MAP_PRIVATE mapping. > >Patch #2 refuses to create readonly files instead of creating a new file >and opening it writable. Patch #3 no longer returns >directories from file_ram_open(), resulting in a better error message when >trying to open a readonly file but specifying a directory. > >[1] https://lkml.kernel.org/r/20230726145912.88545-1-logoerthin...@163.com > >Cc: Paolo Bonzini <pbonz...@redhat.com> >Cc: Peter Xu <pet...@redhat.com> >Cc: Igor Mammedov <imamm...@redhat.com> >Cc: Thiner Logoer <logoerthin...@163.com> >Cc: "Philippe Mathieu-Daudé" <phi...@linaro.org> > >David Hildenbrand (2): > softmmu/physmem: fail creation of new files in file_ram_open() with > readonly=true > softmmu/physmem: never return directories from file_ram_open() > >Thiner Logoer (1): > softmmu/physmem: fallback to opening guest RAM file as readonly in a > MAP_PRIVATE mapping > > softmmu/physmem.c | 52 +++++++++++++++++++++++++++++++++++++++-------- > 1 file changed, 44 insertions(+), 8 deletions(-) > >-- >2.41.0
I have tested the patch on my compilation environment. These patches does not have problem on my setup. Great job on handling more cases about file opening here! -- Regards, logoerthiner