From patchwork Thu Sep 1 18:12:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 112950 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4DFC6B6F8A for ; Fri, 2 Sep 2011 04:12:51 +1000 (EST) Received: from localhost ([::1]:45441 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzBku-00086H-Dp for incoming@patchwork.ozlabs.org; Thu, 01 Sep 2011 14:12:48 -0400 Received: from eggs.gnu.org ([140.186.70.92]:57357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzBke-0007sJ-KN for qemu-devel@nongnu.org; Thu, 01 Sep 2011 14:12:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QzBkd-00085f-1V for qemu-devel@nongnu.org; Thu, 01 Sep 2011 14:12:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13179) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzBkc-00085R-Nz for qemu-devel@nongnu.org; Thu, 01 Sep 2011 14:12:30 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p81ICTJb008029 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 1 Sep 2011 14:12:29 -0400 Received: from localhost (ovpn-113-117.phx2.redhat.com [10.3.113.117]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p81ICS8F006948; Thu, 1 Sep 2011 14:12:29 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Thu, 1 Sep 2011 15:12:14 -0300 Message-Id: <1314900738-30164-5-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1314900738-30164-1-git-send-email-lcapitulino@redhat.com> References: <1314900738-30164-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, amit.shah@redhat.com, aliguori@us.ibm.com, armbru@redhat.com, jan.kiszka@siemens.com Subject: [Qemu-devel] [PATCH 4/8] Drop the incoming_expected global variable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Test against RSTATE_IN_MIGRATE instead. Please, note that the RSTATE_IN_MIGRATE state is only set when all the initial VM setup is done, while 'incoming_expected' was set right in the beginning when parsing command-line options. Shouldn't be a problem as far as I could check. Signed-off-by: Luiz Capitulino --- migration.c | 2 -- monitor.c | 2 +- vl.c | 2 -- 3 files changed, 1 insertions(+), 5 deletions(-) diff --git a/migration.c b/migration.c index f2499cf..a63e2a2 100644 --- a/migration.c +++ b/migration.c @@ -70,8 +70,6 @@ void process_incoming_migration(QEMUFile *f) qemu_announce_self(); DPRINTF("successfully loaded vm state\n"); - incoming_expected = false; - if (autostart) { vm_start(); } else { diff --git a/monitor.c b/monitor.c index 4fb10a0..4612c89 100644 --- a/monitor.c +++ b/monitor.c @@ -1309,7 +1309,7 @@ static int do_cont(Monitor *mon, const QDict *qdict, QObject **ret_data) { struct bdrv_iterate_context context = { mon, 0 }; - if (incoming_expected) { + if (runstate_check(RSTATE_IN_MIGRATE)) { qerror_report(QERR_MIGRATION_EXPECTED); return -1; } diff --git a/vl.c b/vl.c index 59f71fc..e9d57d0 100644 --- a/vl.c +++ b/vl.c @@ -185,7 +185,6 @@ int nb_nics; NICInfo nd_table[MAX_NICS]; int vm_running; int autostart; -int incoming_expected; /* Started with -incoming and waiting for incoming */ static int rtc_utc = 1; static int rtc_date_offset = -1; /* -1 means no change */ QEMUClock *rtc_clock; @@ -2911,7 +2910,6 @@ int main(int argc, char **argv, char **envp) break; case QEMU_OPTION_incoming: incoming = optarg; - incoming_expected = true; break; case QEMU_OPTION_nodefaults: default_serial = 0;