On Mon, 23 Mar 2026 18:37:10 +1100
David Gibson
The read_all_buf() and write_all_buf() functions in util.c are primarily used for serialising data structures to a stream during migraiton. We're going to have further use for such serialisation when we add dynamic configuration updates, where we'll want to share the code with the client program.
Nit, but I'd like to make sure we're not missing anything before applying this: the "hidden sizeof()" variants seem to be gone now (thanks), but then we should drop this last sentence, unless I'm missing something. Another nit below:
[...]
+++ b/serialise.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later + * Copyright Red Hat + * Author: David Gibson
+ */ + +#ifndef SERIALISE_H +#define SERIALISE_H + +#include + +int read_all_buf(int fd, void *buf, size_t len); +int write_all_buf(int fd, const void *buf, size_t len); + +#endif /* _SERIALISE_H */
This is SERIALISE_H, not _SERIALISE_H. -- Stefano