On Thu, Jul 17, 2025 at 06:07:27AM +0530, Arun Menon wrote: > This is an incremental step in converting vmstate loading > code to report error via Error objects instead of directly > printing it to console/monitor. > It is ensured that vmstate_load() must report an error > in errp, in case of failure. > > Signed-off-by: Arun Menon <arme...@redhat.com> > --- > migration/savevm.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/migration/savevm.c b/migration/savevm.c > index > 3ccbc724eb808db09b77088a858ecc7f06b21155..1c1a46e4a01f812b559c451d278916426aa1cf40 > 100644 > --- a/migration/savevm.c > +++ b/migration/savevm.c > @@ -963,14 +963,14 @@ void vmstate_unregister(VMStateIf *obj, const > VMStateDescription *vmsd, > } > } > > -static int vmstate_load(QEMUFile *f, SaveStateEntry *se) > +static int vmstate_load(QEMUFile *f, SaveStateEntry *se, Error **errp) > { > trace_vmstate_load(se->idstr, se->vmsd ? se->vmsd->name : "(old)"); > if (!se->vmsd) { /* Old style */ > return se->ops->load_state(f, se->opaque, se->load_version_id);
This method can return a failure code, so we need error_setg() here surely ? (and later augment/replace 'load_state' with a variant that has an "errp" parameter) > } > return vmstate_load_state(f, se->vmsd, se->opaque, se->load_version_id, > - NULL); > + errp); > } > With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|