From patchwork Fri Feb 22 16:36:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 222653 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 7527C2C0094 for ; Sat, 23 Feb 2013 08:03:28 +1100 (EST) Received: from localhost ([::1]:54979 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8vdB-0005CS-Q5 for incoming@patchwork.ozlabs.org; Fri, 22 Feb 2013 11:37:53 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8vcV-0003qf-Ty for qemu-devel@nongnu.org; Fri, 22 Feb 2013 11:37:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8vcT-0006fF-TV for qemu-devel@nongnu.org; Fri, 22 Feb 2013 11:37:11 -0500 Received: from mail-vb0-f46.google.com ([209.85.212.46]:38854) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8vcT-0006f5-Nf for qemu-devel@nongnu.org; Fri, 22 Feb 2013 11:37:09 -0500 Received: by mail-vb0-f46.google.com with SMTP id b13so502689vby.19 for ; Fri, 22 Feb 2013 08:37:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=IY97afDAAv6JaXtf3ScwhMMo79Qjw2u3hgj8vgJallc=; b=r1xzgefWJg1ti6cLnXGiSTW8ckDPlnZ+UddijzQi+H7NAWf83+hcxnQmgBS/tmE1va C4jxOUYEGhg3rHKRUAXy6N15rA3i1xZimn/Odc9gUgPM9wpYSo2TXbZJhjNVbj6vvOpY 8ioPXGKVkIpdqEy9g4B53lJAu2cZfN4KkRv7ZmRJFCHeIuUEUP0IpdtwlxrOhSP/498u Is4JtqaglY4ZCd1q4BLWvIzrDcN1k2hnJPBf1n9+xw3yfJo/6Kb9T03Eg63qroFhUzWy aS77Amsl+If7zQTg2j7hrM1D3SUU85mdcCMvqmOkRHb+DTn10d3mqsErGJRNq24GzzQi TGNg== X-Received: by 10.220.239.14 with SMTP id ku14mr3316290vcb.57.1361551024012; Fri, 22 Feb 2013 08:37:04 -0800 (PST) Received: from yakj.usersys.redhat.com (93-34-179-137.ip50.fastwebnet.it. [93.34.179.137]) by mx.google.com with ESMTPS id tp10sm4291733vec.1.2013.02.22.08.37.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 22 Feb 2013 08:37:01 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 22 Feb 2013 17:36:08 +0100 Message-Id: <1361551008-12430-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1361551008-12430-1-git-send-email-pbonzini@redhat.com> References: <1361551008-12430-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.212.46 Cc: owasserm@redhat.com, quintela@redhat.com Subject: [Qemu-devel] [PATCH 02/42] migration: always use vm_stop_force_state 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 vm_stop_force_state does: if (runstate_is_running()) { vm_stop(state); } else { runstate_set(state); } migration.c does: if (runstate_is_running()) { vm_stop(state); } else { vm_stop_force_state(state); } The code run is the same even if we always use vm_stop_force_state in migration.c. Reviewed-by: Orit Wasserman Reviewed-by: Juan Quintela Signed-off-by: Paolo Bonzini --- migration.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/migration.c b/migration.c index ba8b647..65e8583 100644 --- a/migration.c +++ b/migration.c @@ -699,11 +699,7 @@ static void *buffered_file_thread(void *opaque) DPRINTF("done iterating\n"); start_time = qemu_get_clock_ms(rt_clock); qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER); - if (old_vm_running) { - vm_stop(RUN_STATE_FINISH_MIGRATE); - } else { - vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); - } + vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); ret = qemu_savevm_state_complete(s->file); if (ret < 0) { qemu_mutex_unlock_iothread();