Re: [PATCH] physmem: fix qemu_ram_alloc_from_fd size calculation

2025-01-02 Thread Steven Sistare
On 1/2/2025 4:14 PM, Peter Xu wrote: On Thu, Jan 02, 2025 at 12:34:50PM -0800, Steve Sistare wrote: qemu_ram_alloc_from_fd allocates space if file_size == 0. If non-zero, it uses the existing space and verifies it is large enough, but the verification was broken when the offset parameter was in

Re: [PATCH] physmem: fix qemu_ram_alloc_from_fd size calculation

2025-01-02 Thread Peter Xu
On Thu, Jan 02, 2025 at 12:34:50PM -0800, Steve Sistare wrote: > qemu_ram_alloc_from_fd allocates space if file_size == 0. If non-zero, > it uses the existing space and verifies it is large enough, but the > verification was broken when the offset parameter was introduced. As > a result, a file s

[PATCH] physmem: fix qemu_ram_alloc_from_fd size calculation

2025-01-02 Thread Steve Sistare
qemu_ram_alloc_from_fd allocates space if file_size == 0. If non-zero, it uses the existing space and verifies it is large enough, but the verification was broken when the offset parameter was introduced. As a result, a file smaller than offset passes the verification and causes errors later. Fi