From patchwork Fri Oct 19 14:45:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 192731 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C78152C008F for ; Sat, 20 Oct 2012 01:46:25 +1100 (EST) Received: from localhost ([::1]:51738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPDqC-0003cU-0X for incoming@patchwork.ozlabs.org; Fri, 19 Oct 2012 10:46:24 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPDpi-0002iu-Ci for qemu-devel@nongnu.org; Fri, 19 Oct 2012 10:46:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TPDpg-0004AL-KO for qemu-devel@nongnu.org; Fri, 19 Oct 2012 10:45:54 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:46492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPDpg-00049Y-Dl for qemu-devel@nongnu.org; Fri, 19 Oct 2012 10:45:52 -0400 Received: by mail-pa0-f45.google.com with SMTP id fb10so414741pad.4 for ; Fri, 19 Oct 2012 07:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=RbmUeEyncMP1D3MS33VvcQSdJ/EmFDnzbdMA+aO/jwc=; b=GAQbmiYfI1mvF/w57khfqOyXhmGjePqenmEf6KCYi6WepAnH85CkNt5o5vYkfRAPTe AUC2x7OY/jFp+NbhfqyMDkvbkTTqwmebZ6pAzQJyTaGcWTdHZ+TPql6nWkBwy5k9nrhU VmuS5VfgBqhOHu/u5l4FjGlh5wFkbo3IaVwNuDu3M8LxcJIi38K2PqZ1GC5WVfWl4JTe xwrJl7DqzvebZud8Q9xE21ah+IODbkhz2acedenLRGSZpASBI7IuyfqG2bOmWJ7brDHm nmg1+55GUYp8NvH3F5xDQR9XUXfOOc571LUiFDC8DaOOMMqzD59vzwl6qaFgYBbYtZU6 WOjw== Received: by 10.68.220.2 with SMTP id ps2mr6439009pbc.61.1350657951525; Fri, 19 Oct 2012 07:45:51 -0700 (PDT) Received: from yakj.usersys.redhat.com (93-34-169-1.ip50.fastwebnet.it. [93.34.169.1]) by mx.google.com with ESMTPS id iq3sm1339636pbc.5.2012.10.19.07.45.48 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 19 Oct 2012 07:45:50 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 19 Oct 2012 16:45:24 +0200 Message-Id: <1350657924-10624-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.12.1 In-Reply-To: <1350657924-10624-1-git-send-email-pbonzini@redhat.com> References: <1350657924-10624-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.220.45 Cc: lcapitulino@redhat.com Subject: [Qemu-devel] [PATCH v2 2/2] migration: go to paused state after finishing incoming migration with -S 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 At the end of migration the machine has started already, and cannot be destroyed without losing the guest's data. Hence, prelaunch is the wrong state. Go to the paused state instead. QEMU would reach that state anyway (after running the guest for the blink of an eye) if the "stop" command had been received after the start of migration. Signed-off-by: Paolo Bonzini --- migration.c | 2 +- vl.c | 2 +- 2 file modificati, 2 inserzioni(+), 2 rimozioni(-) diff --git a/migration.c b/migration.c index 32d43e7..72abd3c 100644 --- a/migration.c +++ b/migration.c @@ -108,7 +108,7 @@ static void process_incoming_migration_co(void *opaque) if (autostart) { vm_start(); } else { - runstate_set(RUN_STATE_PRELAUNCH); + runstate_set(RUN_STATE_PAUSED); } } diff --git a/vl.c b/vl.c index 5b357a3..8b1e0b2 100644 --- a/vl.c +++ b/vl.c @@ -341,7 +341,7 @@ static const RunStateTransition runstate_transitions_def[] = { { RUN_STATE_DEBUG, RUN_STATE_RUNNING }, { RUN_STATE_INMIGRATE, RUN_STATE_RUNNING }, - { RUN_STATE_INMIGRATE, RUN_STATE_PRELAUNCH }, + { RUN_STATE_INMIGRATE, RUN_STATE_PAUSED }, { RUN_STATE_INTERNAL_ERROR, RUN_STATE_PAUSED }, { RUN_STATE_INTERNAL_ERROR, RUN_STATE_FINISH_MIGRATE },