On 30.07.25 16:38, Jan Beulich wrote:
On 30.07.2025 14:22, Juergen Gross wrote:
Mini-OS doesn't support using mmap() for accessing a file. In order
to support reading the live update state from a 9pfs based file, use
fread() instead of mmap().

While adding the offset member to lu_state, change the type of "size"
to size_t in order to avoid problems with state exceeding 4GB.

Signed-off-by: Juergen Gross <jgr...@suse.com>
Reviewed-by: Jason Andryuk <jason.andr...@amd.com>
---
V2:
- move to start of series
V3:
- change offset to off64_t and size to size_t (Andrew Cooper)

Wasn't that meant to also cover ...

--- a/tools/xenstored/lu.c
+++ b/tools/xenstored/lu.c
@@ -27,9 +27,11 @@ struct live_update *lu_status;
struct lu_dump_state {
        void *buf;
-       unsigned int size;
-       int fd;
+       unsigned int buf_size;

... this field?

As this buffer is for a single state record only, an unsigned int is
always enough. The record header is using uint32_t for the record length.


Juergen

Attachment: OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to