From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USDeN-0002pE-0a for qemu-devel@nongnu.org; Tue, 16 Apr 2013 17:42:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USDeL-0005jm-PY for qemu-devel@nongnu.org; Tue, 16 Apr 2013 17:42:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65484) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USDeL-0005jg-HF for qemu-devel@nongnu.org; Tue, 16 Apr 2013 17:42:49 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3GLgluD025521 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 16 Apr 2013 17:42:48 -0400 Message-ID: <516DC5D7.70907@redhat.com> Date: Tue, 16 Apr 2013 15:42:47 -0600 From: Eric Blake MIME-Version: 1.0 References: <36cf3cc0fded13e1fe2a55561b57de523de89000.1366127809.git.phrdina@redhat.com> In-Reply-To: <36cf3cc0fded13e1fe2a55561b57de523de89000.1366127809.git.phrdina@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2WGLULNWXEKBRXDKNJTMK" Subject: Re: [Qemu-devel] [PATCH 06/11] savevm: update error reporting for qemu_loadvm_state() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Hrdina Cc: lcapitulino@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2WGLULNWXEKBRXDKNJTMK Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 04/16/2013 10:05 AM, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- > include/sysemu/sysemu.h | 2 +- > migration.c | 9 +++---- > savevm.c | 64 ++++++++++++++++++++++++-----------------= -------- > 3 files changed, 37 insertions(+), 38 deletions(-) >=20 > +++ b/migration.c > @@ -93,12 +93,13 @@ void qemu_start_incoming_migration(const char *uri,= Error **errp) > static void process_incoming_migration_co(void *opaque) > { > QEMUFile *f =3D opaque; > - int ret; > + Error *local_err =3D NULL; > =20 > - ret =3D qemu_loadvm_state(f); > + qemu_loadvm_state(f, &local_err); > qemu_fclose(f); > - if (ret < 0) { > - fprintf(stderr, "load of migration failed\n"); > + if (error_is_set(&local_err)) { > + fprintf(stderr, "%s\n", error_get_pretty(local_err)); > + error_free(local_err); > exit(0); Pre-existing, but WHY are we exiting with successful status even when incoming migration failed? This feels SOOOO wrong. Exiting non-zero would at least give management apps like libvirt a reason to inspect the output for the error message. > v =3D qemu_get_be32(f); > if (v =3D=3D QEMU_VM_FILE_VERSION_COMPAT) { > - fprintf(stderr, "SaveVM v2 format is obsolete and don't work a= nymore\n"); > - return -ENOTSUP; > + error_setg(errp, "saveVM v2 format is obsolete and don't work = anymore"); As long as you are touching this, fix the grammar: s/don't/doesn't/ As my findings were pre-existing problems: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2WGLULNWXEKBRXDKNJTMK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRbcXXAAoJEKeha0olJ0Nq3l0H/Ro/ZS9t6fZwvcXh7pTG15DT ZuHgvTrWxJ4yy8uBP5W1kaV/+zybfy8R9vckQj9YjEi/c++wSghB+dsb/jZnOu3S q72+ZMjWdJ7q9Op/HQt8AD1RUy2k44dbtOw3aUYTdzQRhg+eo+n5RiRCkOCqtEaV +RrnBh5e1imuxapfVBO8OjoTwBl0Kk3orFwpPyM/3wkcVmxYjHA+pLJC/Y0BatDI XaHbrMR8YaBxmxQaE7IBFIUj9UkrCb4JerNJp+T0gulpXiG0++ToDlCUTDOmW3yW csMs2/nXXRZqaY7BJSjq4T+1VtvysqfAoKAN1z9/UIyh69aEffo59LmjsZR2I9k= =NXrv -----END PGP SIGNATURE----- ------enig2WGLULNWXEKBRXDKNJTMK--