On 03/22/2013 07:16 AM, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina <phrd...@redhat.com> > ---
The commit message could usefully explain _why_ it is okay to collapse all error values into one. As written, the code appears accurate; and the lone caller (do_savevm) handles the new semantics. But this goes back to my question in 9/10 - why not use errp as the witness, and return void, instead of duplicating information? > savevm.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/savevm.c b/savevm.c > index 45d1b09..2e5f029 100644 > --- a/savevm.c > +++ b/savevm.c > @@ -1805,7 +1805,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp) > }; > > if (qemu_savevm_state_blocked(errp)) { > - return -EINVAL; > + return -1; > } > > qemu_mutex_unlock_iothread(); > @@ -1826,7 +1826,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp) > if (ret != 0) { > qemu_savevm_state_cancel(); > } > - return ret; > + return ret == 0 ? 0 : -1; > } > > static int qemu_save_device_state(QEMUFile *f) > -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature