From patchwork Tue Sep 6 13:14:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 113554 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 22680B6F70 for ; Tue, 6 Sep 2011 23:15:21 +1000 (EST) Received: from localhost ([::1]:59954 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0vUj-0003Rg-D5 for incoming@patchwork.ozlabs.org; Tue, 06 Sep 2011 09:15:17 -0400 Received: from eggs.gnu.org ([140.186.70.92]:38460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0vUC-0002g4-MG for qemu-devel@nongnu.org; Tue, 06 Sep 2011 09:14:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R0vUB-0001Td-Hd for qemu-devel@nongnu.org; Tue, 06 Sep 2011 09:14:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0vUB-0001TV-Ab for qemu-devel@nongnu.org; Tue, 06 Sep 2011 09:14:43 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p86DEgfr025378 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 6 Sep 2011 09:14:42 -0400 Received: from localhost (ovpn-113-32.phx2.redhat.com [10.3.113.32]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p86DEf5K012424; Tue, 6 Sep 2011 09:14:42 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Tue, 6 Sep 2011 10:14:24 -0300 Message-Id: <1315314868-24770-6-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1315314868-24770-1-git-send-email-lcapitulino@redhat.com> References: <1315314868-24770-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 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 5/9] 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 3f979ad..afe858c 100644 --- a/monitor.c +++ b/monitor.c @@ -1311,7 +1311,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 fe3628a..4cee50e 100644 --- a/vl.c +++ b/vl.c @@ -187,7 +187,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; @@ -3115,7 +3114,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;