From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFI8h-0002sf-Aj for qemu-devel@nongnu.org; Wed, 15 Jul 2015 04:34:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFI8c-0005aB-8e for qemu-devel@nongnu.org; Wed, 15 Jul 2015 04:34:03 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:42872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFI8c-0005Zf-0G for qemu-devel@nongnu.org; Wed, 15 Jul 2015 04:33:58 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 15 Jul 2015 09:33:55 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id D4772219004D for ; Wed, 15 Jul 2015 09:33:28 +0100 (BST) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t6F8Xp7X30802036 for ; Wed, 15 Jul 2015 08:33:51 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t6F8XpuH006477 for ; Wed, 15 Jul 2015 02:33:51 -0600 Message-ID: <55A61AEE.70903@de.ibm.com> Date: Wed, 15 Jul 2015 10:33:50 +0200 From: Christian Borntraeger MIME-Version: 1.0 References: <1436946982-24643-1-git-send-email-quintela@redhat.com> <20150715081815.GA2251@work-vm> In-Reply-To: <20150715081815.GA2251@work-vm> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] migration: We also want to store the global state for savevm List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" , Juan Quintela Cc: amit.shah@redhat.com, qemu-devel@nongnu.org Am 15.07.2015 um 10:18 schrieb Dr. David Alan Gilbert: > * Juan Quintela (quintela@redhat.com) wrote: >> Previous commit only stored a valid state for migration. It stored the >> empty string for savevm. Now, we are also storing the current state for >> savevm. >> >> Signed-off-by: Juan Quintela > > Reviewed-by: Dr. David Alan Gilbert > > Looks OK to me; Christian - does it fix it for you? This patch seems to work ok. > > Dave > >> --- >> include/migration/migration.h | 1 + >> migration/migration.c | 2 +- >> migration/savevm.c | 6 ++++++ >> 3 files changed, 8 insertions(+), 1 deletion(-) >> >> diff --git a/include/migration/migration.h b/include/migration/migration.h >> index b2711ef..a2f8ed0 100644 >> --- a/include/migration/migration.h >> +++ b/include/migration/migration.h >> @@ -202,4 +202,5 @@ void savevm_skip_section_footers(void); >> void register_global_state(void); >> void global_state_set_optional(void); >> void savevm_skip_configuration(void); >> +int global_state_store(void); >> #endif >> diff --git a/migration/migration.c b/migration/migration.c >> index ba82ff6..86ca099 100644 >> --- a/migration/migration.c >> +++ b/migration/migration.c >> @@ -110,7 +110,7 @@ typedef struct { >> >> static GlobalState global_state; >> >> -static int global_state_store(void) >> +int global_state_store(void) >> { >> if (!runstate_store((char *)global_state.runstate, >> sizeof(global_state.runstate))) { >> diff --git a/migration/savevm.c b/migration/savevm.c >> index 86735fc..81dbe58 100644 >> --- a/migration/savevm.c >> +++ b/migration/savevm.c >> @@ -1315,6 +1315,12 @@ void hmp_savevm(Monitor *mon, const QDict *qdict) >> } >> >> saved_vm_running = runstate_is_running(); >> + >> + ret = global_state_store(); >> + if (ret) { >> + monitor_printf(mon, "Error saving global state\n"); >> + return; >> + } >> vm_stop(RUN_STATE_SAVE_VM); >> >> memset(sn, 0, sizeof(*sn)); >> -- >> 2.4.3 >> > -- > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK >