Received: from eggs.gnu.org ([2001:4830:134:3::10]:54331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zydal-0006DI-03 for qemu-devel@nongnu.org; Tue, 17 Nov 2015 05:34:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zydah-0000kD-Ng for qemu-devel@nongnu.org; Tue, 17 Nov 2015 05:34:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42917) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zydah-0000k9-IV for qemu-devel@nongnu.org; Tue, 17 Nov 2015 05:34:23 -0500 From: Markus Armbruster References: <1447687950-29350-1-git-send-email-den@openvz.org> <1447687950-29350-5-git-send-email-den@openvz.org> Date: Tue, 17 Nov 2015 11:34:21 +0100 In-Reply-To: <1447687950-29350-5-git-send-email-den@openvz.org> (Denis V. Lunev's message of "Mon, 16 Nov 2015 18:32:29 +0300") Message-ID: <87y4dwykwi.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 4/5] migration: improve error reporting for hmp_loadvm List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" Cc: Amit Shah , qemu-devel@nongnu.org, Juan Quintela "Denis V. Lunev" writes: > The patch adds Error ** parameter to load_vmstate call and fills error > inside. The caller after that properly reports error either through > monitor or via local stderr facility during VM start. > > This helper will be usefull too for qmp_load_vmstate implementation. > > Signed-off-by: Denis V. Lunev > CC: Juan Quintela > CC: Amit Shah > CC: Markus Armbruster > CC: Eric Blake > --- > include/sysemu/sysemu.h | 2 +- > migration/savevm.c | 25 +++++++++++++------------ > monitor.c | 7 ++++++- > vl.c | 5 ++++- > 4 files changed, 24 insertions(+), 15 deletions(-) > > diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h > index 3bb8897..d9ccf45 100644 > --- a/include/sysemu/sysemu.h > +++ b/include/sysemu/sysemu.h > @@ -78,7 +78,7 @@ void qemu_remove_exit_notifier(Notifier *notify); > void qemu_add_machine_init_done_notifier(Notifier *notify); > > void hmp_savevm(Monitor *mon, const QDict *qdict); > -int load_vmstate(const char *name); > +int load_vmstate(const char *name, Error **errp); > void hmp_delvm(Monitor *mon, const QDict *qdict); > void hmp_info_snapshots(Monitor *mon, const QDict *qdict); > > diff --git a/migration/savevm.c b/migration/savevm.c > index 90b6850..08c6c65 100644 > --- a/migration/savevm.c > +++ b/migration/savevm.c > @@ -2042,7 +2042,7 @@ void qmp_xen_save_devices_state(const char *filename, Error **errp) > } > } > > -int load_vmstate(const char *name) > +int load_vmstate(const char *name, Error **errp) > { > BlockDriverState *bs, *bs_vm_state; > QEMUSnapshotInfo sn; > @@ -2051,20 +2051,20 @@ int load_vmstate(const char *name) > AioContext *aio_context; > > if (!bdrv_all_can_snapshot(&bs)) { > - error_report("Device '%s' is writable but does not support snapshots.", > - bdrv_get_device_name(bs)); > + error_setg(errp, "Device '%s' is writable but does not support " > + "snapshots.", bdrv_get_device_name(bs)); Since you're touching this already, please drop the period. I'd prefer breaking lines between arguments instead of in the middle of an argument: error_setg(errp, "Device '%s' is writable but does not support snapshots", bdrv_get_device_name(bs)); I'll continue to review when I have something that applies. [...]