Re: [PATCH v4 05/11] migration: Make qemu_get_buffer_at() thread-safe

Juraj Marcin <[email protected]>
Newsgroups gmane.comp.emulators.qemu
Message-ID <annp0wm5l_5Fu21F@fedora>
On 2026-08-01 08:06, Aadeshveer Singh wrote:
> Remove the internal QEMUFile error state modification from
> qemu_get_buffer_at(). This function is called by two functions, both of
> which already check for unexpected return values and handle their own
> error reporting.
> 
> Removing this shared state modification makes qemu_get_buffer_at()
> strictly thread-safe for concurrent disk reads, serving as a
> preparatory change for the upcoming fast snapshot load feature.
> 
> Removed local error by passing errp to improve on error handling,
> consequently also change caller to use error_prevent and not error_setg.
> 
> Set errp in case of f->last_error as function should set errp in case it
> fails, and caller can simply use error_prepend without checking errp in
> case of error.
> 
> Signed-off-by: Aadeshveer Singh <[email protected]>
> ---
>  migration/qemu-file.c | 11 +++++------
>  migration/qemu-file.h |  4 ++--
>  migration/ram.c       |  6 +++---
>  3 files changed, 10 insertions(+), 11 deletions(-)

Reviewed-by: Juraj Marcin <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.