From patchwork Fri Feb 15 17:46:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 220834 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 52F9D2C007B for ; Sat, 16 Feb 2013 06:28:37 +1100 (EST) Received: from localhost ([::1]:52306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6POM-0006ID-Ka for incoming@patchwork.ozlabs.org; Fri, 15 Feb 2013 12:48:10 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6PNk-0004dB-Rk for qemu-devel@nongnu.org; Fri, 15 Feb 2013 12:47:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U6PNe-00048T-In for qemu-devel@nongnu.org; Fri, 15 Feb 2013 12:47:32 -0500 Received: from mail-ve0-f174.google.com ([209.85.128.174]:35905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6PNe-00048A-CY for qemu-devel@nongnu.org; Fri, 15 Feb 2013 12:47:26 -0500 Received: by mail-ve0-f174.google.com with SMTP id pb11so3329589veb.33 for ; Fri, 15 Feb 2013 09:47:26 -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=5xkv6kYUxMFU87a1D89CCmBWlkX8XFNzSMAF+jGPKF0=; b=Kd+BTKgO/eKdp+i8rsY43fK/FWJUkVHf43YcEe9qIshCRunIWQ4hHUQ3OvMzgK5QO6 hjDR8W9roW2Uc5EKTec47sw1NQFhDxJG80SbDiB5yKl2/ApVbWEO9e+ObMtCSUZTeP5t 0wkxWI2Wem0tx5fpdwX8hSKRxV175aJBtG7uCjhhonhsZGG+uJycyvC1Q4B8e3temAWt iY3cbzYBXRMSEfOQc5ygPpANslEI3fy9wSuvVf6ESfg2qScec3c+UqJVeJ/mdXEHNqa/ PSBFev1H9C1BAbphpLl9poZI+aII0OoAz/rdEr+wTo2KHeJBii2aBtv8QrkpbDtzJKqp kJpg== X-Received: by 10.52.92.199 with SMTP id co7mr3803019vdb.82.1360950445925; Fri, 15 Feb 2013 09:47:25 -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 yu12sm65402142vec.6.2013.02.15.09.47.23 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 15 Feb 2013 09:47:25 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 15 Feb 2013 18:46:34 +0100 Message-Id: <1360950433-17106-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1360950433-17106-1-git-send-email-pbonzini@redhat.com> References: <1360950433-17106-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.128.174 Cc: owasserm@redhat.com, chegu_vinod@hp.com, quintela@redhat.com Subject: [Qemu-devel] [PATCH 02/41] 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. Signed-off-by: Paolo Bonzini Reviewed-by: Orit Wasserman Reviewed-by: Juan Quintela --- migration.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/migration.c b/migration.c index 5414060..2b44268 100644 --- a/migration.c +++ b/migration.c @@ -698,11 +698,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();