From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBqwY-0003Tc-08 for qemu-devel@nongnu.org; Wed, 23 Dec 2015 16:27:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBqwU-00085q-Pd for qemu-devel@nongnu.org; Wed, 23 Dec 2015 16:27:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34625) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBqwU-00085k-Hp for qemu-devel@nongnu.org; Wed, 23 Dec 2015 16:27:30 -0500 References: <1449240275-26196-1-git-send-email-den@openvz.org> <1449240275-26196-2-git-send-email-den@openvz.org> From: Eric Blake Message-ID: <567B11BA.4090901@redhat.com> Date: Wed, 23 Dec 2015 14:27:22 -0700 MIME-Version: 1.0 In-Reply-To: <1449240275-26196-2-git-send-email-den@openvz.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ntODHKtXQSMlshrbHegbUfC7Wemr1oXBI" Subject: Re: [Qemu-devel] [PATCH 1/5] migration: split hmp_savevm to do_savevm and hmp_savevm wrapper List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" Cc: Amit Shah , Markus Armbruster , qemu-devel@nongnu.org, quintela@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ntODHKtXQSMlshrbHegbUfC7Wemr1oXBI Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/04/2015 07:44 AM, Denis V. Lunev wrote: > This would be useful in the next step when QMP version of this call wil= l > be introduced. >=20 > Signed-off-by: Denis V. Lunev > Reviewed-by: Juan Quintela > CC: Amit Shah > CC: Markus Armbruster > CC: Eric Blake > --- > migration/savevm.c | 38 +++++++++++++++++++++++--------------- > 1 file changed, 23 insertions(+), 15 deletions(-) >=20 > @@ -1915,28 +1915,27 @@ void hmp_savevm(Monitor *mon, const QDict *qdic= t) > uint64_t vm_state_size; > qemu_timeval tv; > struct tm tm; > - const char *name =3D qdict_get_try_str(qdict, "name"); > Error *local_err =3D NULL; > AioContext *aio_context; > =20 > if (!bdrv_all_can_snapshot(&bs)) { > - monitor_printf(mon, "Device '%s' is writable but does not " > - "support snapshots.\n", bdrv_get_device_name(bs= )); > + error_setg(errp, > + "Device '%s' is writable but does not support snaps= hots.", No trailing '.' in error_setg() calls. > + bdrv_get_device_name(bs)); > return; > } > =20 > /* Delete old snapshots of the same name */ > if (name && bdrv_all_delete_snapshot(name, &bs1, &local_err) < 0) = { > - monitor_printf(mon, > - "Error while deleting snapshot on device '%s': = %s\n", > - bdrv_get_device_name(bs1), error_get_pretty(loc= al_err)); > + error_setg(errp, "Error while deleting snapshot on device '%s'= : %s", > + bdrv_get_device_name(bs1), error_get_pretty(local_e= rr)); Markus' series to add a prefixing notation would be better to use here (although I didn't check if he caught this one in that series already): https://lists.gnu.org/archive/html/qemu-devel/2015-12/msg03495.html > =20 > +void hmp_savevm(Monitor *mon, const QDict *qdict) > +{ > + Error *local_err =3D NULL; > + > + do_savevm(qdict_get_try_str(qdict, "name"), &local_err); > + > + if (local_err !=3D NULL) { I would have just written 'if (local_err) {'; but that's minor style. Looks like a clean refactoring, other than the nit about the trailing '.', so with that fixed: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ntODHKtXQSMlshrbHegbUfC7Wemr1oXBI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWexG6AAoJEKeha0olJ0NqxRQIAIYKIQfdAdGXEU9uUGTFowIl CMxn/SIKmVdT9/uJBDoR191GVQRaT01nFtHPJTPV/9j2yX8dTh5DRLJtUFQIBXCS AEpDytxe8OolmkAIxcHVtiZgL8Okokx9EFoG2YsLj85WZr7uVSisftQAbKmmbWYX PayPYO85ELy/CnIZLyEY31WElMpTa4visLT3AaIhFztbT7zYZza99XiNf69pNrol t6jKatJcgH+8ogAgvakEfY0f6i/V+2W1b/kGSJWAaUN8+ctxgbDwKCQ9zV/F+mv6 RUHCL1qS9BD3Jz4aVQ+C8gn01DsCehHq+QT2y/0nXNFSUpV8yXmbqsWJBobZcq8= =iGHN -----END PGP SIGNATURE----- --ntODHKtXQSMlshrbHegbUfC7Wemr1oXBI--