]> git.ipfire.org Git - thirdparty/qemu.git/commit
migration: simplify error reporting after channel read
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 1 Aug 2025 17:02:11 +0000 (18:02 +0100)
committerPeter Xu <peterx@redhat.com>
Fri, 3 Oct 2025 13:48:02 +0000 (09:48 -0400)
commita5bc1ccca9596ecbf57b05bed10bd39e8854e475
treecc71ddbee528ca1d966eb48a1be47f61a37d8739
parent300a87c502c4ba7ffc7720d8f3583e3d1a68348a
migration: simplify error reporting after channel read

The code handling the return value of qio_channel_read proceses
len == 0 (EOF) separately from len < 1  (error), but in both
cases ends up calling qemu_file_set_error_obj() with -EIO as the
errno. This logic can be merged into one codepath to simplify it.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Prasad Pandit <pjp@fedoraproject.org>
Link: https://lore.kernel.org/r/20250801170212.54409-2-berrange@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
migration/qemu-file.c