From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45559) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d32HJ-0001Bs-Jd for qemu-devel@nongnu.org; Tue, 25 Apr 2017 11:21:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d32HG-0008Uy-Dv for qemu-devel@nongnu.org; Tue, 25 Apr 2017 11:21:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55326) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d32HG-0008Ue-6y for qemu-devel@nongnu.org; Tue, 25 Apr 2017 11:21:18 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 351477E9CB for ; Tue, 25 Apr 2017 15:21:17 +0000 (UTC) References: <20170425102446.4008-1-quintela@redhat.com> <20170425102446.4008-7-quintela@redhat.com> From: Laurent Vivier Message-ID: <486c3746-e254-677d-7709-54670eafa6b0@redhat.com> Date: Tue, 25 Apr 2017 17:21:13 +0200 MIME-Version: 1.0 In-Reply-To: <20170425102446.4008-7-quintela@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 6/6] migration: Pass Error ** argument to {save, load}_vmstate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela , qemu-devel@nongnu.org Cc: dgilbert@redhat.com, peterx@redhat.com On 25/04/2017 12:24, Juan Quintela wrote: > This way we use the "normal" way of printing errors for hmp commands. > > -- > Paolo suggestion "Suggested-by" tag? > > Signed-off-by: Juan Quintela > --- > hmp.c | 9 +++++++-- > include/sysemu/sysemu.h | 4 ++-- > migration/savevm.c | 51 ++++++++++++++++++++++++------------------------ > replay/replay-snapshot.c | 6 ++++-- > vl.c | 4 +++- > 5 files changed, 41 insertions(+), 33 deletions(-) > ... > diff --git a/replay/replay-snapshot.c b/replay/replay-snapshot.c > index 8cced46..fdc4353 100644 > --- a/replay/replay-snapshot.c > +++ b/replay/replay-snapshot.c > @@ -62,14 +62,16 @@ void replay_vmstate_register(void) > > void replay_vmstate_init(void) > { > + Error *err = NULL; > + > if (replay_snapshot) { > if (replay_mode == REPLAY_MODE_RECORD) { > - if (save_vmstate(replay_snapshot) != 0) { > + if (save_vmstate(replay_snapshot, &err) != 0) { > error_report("Could not create snapshot for icount record"); > exit(1); > } > } else if (replay_mode == REPLAY_MODE_PLAY) { > - if (load_vmstate(replay_snapshot) != 0) { > + if (load_vmstate(replay_snapshot, &err) != 0) { > error_report("Could not load snapshot for icount replay"); > exit(1); > } You can use "&error_fatal" in these cases. Thanks, Laurent