Arun Menon <arme...@redhat.com> writes: > This commit removes the redundant vmstate_save_state_with_err() > function. > > Previously, commit 969298f9d7 introduced vmstate_save_state_with_err() > to handle error propagation, while vmstate_save_state() existed for > non-error scenarios. > This is because there were code paths where vmstate_save_state_v() > (called internally by vmstate_save_state) did not explicitly set > errors on failure. > > This change unifies error handling by > - updating vmstate_save_state() to accept an Error **errp argument. > - vmstate_save_state_v() ensures errors are set directly within the errp > object, eliminating the need for two separate functions. > > All calls to vmstate_save_state_with_err() are replaced with > vmstate_save_state(). This simplifies the API and improves code > maintainability. > > vmstate_save_state() that only calls vmstate_save_state_v(), > by inference, also has errors set in errp in case of failure. > The errors are reported using warn_report_err(). > If we want the function to exit on error, then &error_fatal is > passed. > > Signed-off-by: Arun Menon <arme...@redhat.com>
Reviewed-by: Fabiano Rosas <faro...@suse.de>