qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] migration: Only pass negative values to qemu_file_set_error()
@ 2023-07-06 19:51 Fabiano Rosas
  2023-07-06 19:52 ` [PATCH 1/2] target/arm: Return negative value on power state migration error Fabiano Rosas
  2023-07-06 19:52 ` [PATCH 2/2] migration: Make it clear that qemu_file_set_error() needs a negative value Fabiano Rosas
  0 siblings, 2 replies; 5+ messages in thread
From: Fabiano Rosas @ 2023-07-06 19:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: Juan Quintela

qemu_file_set_error() sets f->last_error, which is later used by
functions in qemu-file.c to return the error to callers.

The following functions expect f->last_error to be -errno:

qemu_file_get_error_obj()
qemu_file_get_error()
qemu_fclose()

Make sure qemu_file_set_error() always receives a negative number and
document the assumption.

Fabiano Rosas (2):
  target/arm: Return negative value on power state migration error
  migration: Make it clear that qemu_file_set_error() needs a negative
    value

 migration/qemu-file.c | 2 ++
 migration/savevm.c    | 6 +++---
 target/arm/machine.c  | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

-- 
2.35.3



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-13 13:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-06 19:51 [PATCH 0/2] migration: Only pass negative values to qemu_file_set_error() Fabiano Rosas
2023-07-06 19:52 ` [PATCH 1/2] target/arm: Return negative value on power state migration error Fabiano Rosas
2023-07-06 19:52 ` [PATCH 2/2] migration: Make it clear that qemu_file_set_error() needs a negative value Fabiano Rosas
2023-07-13 11:23   ` Peter Maydell
2023-07-13 13:18     ` Fabiano Rosas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).