qemufile: Always return a verbose error
commitf4b897f4854c579cedc4d5ebb6db16c03a1eaeb1
authorPeter Xu <peterx@redhat.com>
Wed, 4 Oct 2023 22:02:35 +0000 (4 18:02 -0400)
committerJuan Quintela <quintela@redhat.com>
Wed, 11 Oct 2023 09:17:05 +0000 (11 11:17 +0200)
treeaab717c4bf86a5cf63ab3af66ebd5a81bb82b9dd
parent2b2f6f411efa83c70409fa6de2e61ec28221c757
qemufile: Always return a verbose error

There're a lot of cases where we only have an errno set in last_error but
without a detailed error description.  When this happens, try to generate
an error contains the errno as a descriptive error.

This will be helpful in cases where one relies on the Error*.  E.g.,
migration state only caches Error* in MigrationState.error.  With this,
we'll display correct error messages in e.g. query-migrate when the error
was only set by qemu_file_set_error().

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231004220240.167175-6-peterx@redhat.com>
migration/qemu-file.c