From patchwork Fri Dec 31 05:59:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Chen" X-Patchwork-Id: 1574296 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=e4Z/RC2l; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JQFH92W99z9s3q for ; Fri, 31 Dec 2021 17:14:59 +1100 (AEDT) Received: from localhost ([::1]:33018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3BBo-0003Po-2z for incoming@patchwork.ozlabs.org; Fri, 31 Dec 2021 01:14:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3B7S-0003N9-A8 for qemu-devel@nongnu.org; Fri, 31 Dec 2021 01:10:29 -0500 Received: from mga05.intel.com ([192.55.52.43]:3743) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3B7Q-0008Hw-1I for qemu-devel@nongnu.org; Fri, 31 Dec 2021 01:10:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1640931024; x=1672467024; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7qP1tIM4rhCOqOJDe77opsBZ8kwlldx4EwRWQw1/79k=; b=e4Z/RC2lm5C7IGiIFZ7eKg0TJuyVHgaJGQcTfyRrBXEUVXI8LUUCrrUn w4gBuiKC8/3Yo/Tori0P7Nv/f25lMap4NLjA5o8NJ2LJWijPZ1eRtkG/E esROHyyTaqoaKVBxm8KRY6r04xecJGx+wXyOnxkncboEN+lzWvOtdW24w 8r8fCS8kQNzUkEveW9f+/yfh0oicrPtZ4zdB19uFy35skP77OpPtZawO3 hUhGxwrTvFu8jNgT+4qrAXwKDx8D04zY2R2Krct6xoZchsBO68hKIn9vj iG6nJ0mZ/01Qsg0TL3xYs4lnnp7RL2l3Od+AEmfR4/zpLbl3FjnvYg7CH Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10213"; a="328110759" X-IronPort-AV: E=Sophos;i="5.88,250,1635231600"; d="scan'208";a="328110759" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2021 22:10:20 -0800 X-IronPort-AV: E=Sophos;i="5.88,250,1635231600"; d="scan'208";a="470867789" Received: from unknown (HELO localhost.localdomain) ([10.239.13.19]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2021 22:10:18 -0800 From: Zhang Chen To: "Dr. David Alan Gilbert" , Juan Quintela , qemu-dev Subject: [PATCH 1/3] migration/migration.c: Add missed default error handler for migration state Date: Fri, 31 Dec 2021 13:59:33 +0800 Message-Id: <20211231055935.1878503-2-chen.zhang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211231055935.1878503-1-chen.zhang@intel.com> References: <20211231055935.1878503-1-chen.zhang@intel.com> MIME-Version: 1.0 Received-SPF: pass client-ip=192.55.52.43; envelope-from=chen.zhang@intel.com; helo=mga05.intel.com X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Chen Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" In the migration_completion() no other status is expected, for example MIGRATION_STATUS_CANCELLING, MIGRATION_STATUS_CANCELLED, etc. Signed-off-by: Zhang Chen Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela --- migration/migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index 0652165610..2afa77da03 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -3205,7 +3205,7 @@ static void migration_completion(MigrationState *s) qemu_mutex_unlock_iothread(); trace_migration_completion_postcopy_end_after_complete(); - } else if (s->state == MIGRATION_STATUS_CANCELLING) { + } else { goto fail; } From patchwork Fri Dec 31 05:59:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Chen" X-Patchwork-Id: 1574299 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=jNsXL3XQ; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JQFZt1ZrCz9s3q for ; Fri, 31 Dec 2021 17:28:36 +1100 (AEDT) Received: from localhost ([::1]:44638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3BOy-0003Td-Rl for incoming@patchwork.ozlabs.org; Fri, 31 Dec 2021 01:28:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3B7T-0003NC-Bl for qemu-devel@nongnu.org; Fri, 31 Dec 2021 01:10:29 -0500 Received: from mga05.intel.com ([192.55.52.43]:3745) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3B7Q-0008IE-RZ for qemu-devel@nongnu.org; Fri, 31 Dec 2021 01:10:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1640931024; x=1672467024; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WlKrbpM0Mweq/okCiNR1t37y/Tzpv8jgr5VO4f8zCSA=; b=jNsXL3XQsG2lZhzZMO+PSbB6UospPfT4rX3QmAeXbIz39rK/PPud54w2 a6NySfam3FJXzpdYbefEgf9sT4UC/63Ag4Fhu9ClNyFth8Zd3jawUT/FU O4VNAohYZqK6V1SNTsW6R0WDWayn8KHqeEt8wtQLCvxGMl5VfADS5B799 ouobTHey4yPzoxUot6E683z4/8hZQh7caYmWRJb9FOgqRsVdOqosWZGwH TiTKXfLPI0L8zl+cU1TGonfeKbgDo4gJ22LDzTEy0Udp5L9uZptDyLnvt QmHXwnwoAKWB8U2MvZ3talO5vphH3GlykCefhE+caTUWzQx7JplviW8BY Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10213"; a="328110762" X-IronPort-AV: E=Sophos;i="5.88,250,1635231600"; d="scan'208";a="328110762" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2021 22:10:21 -0800 X-IronPort-AV: E=Sophos;i="5.88,250,1635231600"; d="scan'208";a="470867800" Received: from unknown (HELO localhost.localdomain) ([10.239.13.19]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2021 22:10:20 -0800 From: Zhang Chen To: "Dr. David Alan Gilbert" , Juan Quintela , qemu-dev Subject: [PATCH 2/3] migration/migration.c: Avoid COLO boot in postcopy migration Date: Fri, 31 Dec 2021 13:59:34 +0800 Message-Id: <20211231055935.1878503-3-chen.zhang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211231055935.1878503-1-chen.zhang@intel.com> References: <20211231055935.1878503-1-chen.zhang@intel.com> MIME-Version: 1.0 Received-SPF: pass client-ip=192.55.52.43; envelope-from=chen.zhang@intel.com; helo=mga05.intel.com X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Chen Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" COLO dose not support postcopy migration and remove the Fixme. Signed-off-by: Zhang Chen Reviewed-by: Juan Quintela --- migration/migration.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 2afa77da03..3fac9c67ca 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -3230,7 +3230,11 @@ static void migration_completion(MigrationState *s) goto fail_invalidate; } - if (!migrate_colo_enabled()) { + if (migrate_colo_enabled() && s->state == MIGRATION_STATUS_ACTIVE) { + /* COLO dose not support postcopy */ + migrate_set_state(&s->state, MIGRATION_STATUS_ACTIVE, + MIGRATION_STATUS_COLO); + } else { migrate_set_state(&s->state, current_active_state, MIGRATION_STATUS_COMPLETED); } @@ -3621,10 +3625,6 @@ static void migration_iteration_finish(MigrationState *s) "COLO enabled", __func__); } migrate_start_colo_process(s); - /* - * Fixme: we will run VM in COLO no matter its old running state. - * After exited COLO, we will keep running. - */ /* Fallthrough */ case MIGRATION_STATUS_ACTIVE: /* From patchwork Fri Dec 31 05:59:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Chen" X-Patchwork-Id: 1574298 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=oHDk42SZ; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JQFS0596nz9s3q for ; Fri, 31 Dec 2021 17:22:38 +1100 (AEDT) Received: from localhost ([::1]:39906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3BJD-0008SY-4o for incoming@patchwork.ozlabs.org; Fri, 31 Dec 2021 01:22:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3B7V-0003NI-MN for qemu-devel@nongnu.org; Fri, 31 Dec 2021 01:10:31 -0500 Received: from mga05.intel.com ([192.55.52.43]:3743) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3B7S-0008Hw-Mb for qemu-devel@nongnu.org; Fri, 31 Dec 2021 01:10:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1640931026; x=1672467026; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jDBQXCJr6mRM51CY171mIjAONQezSBEhlvTSUD3CMC8=; b=oHDk42SZcD+GiK4grelCVlAMGvHqIDpO2Ow1rpJ28AgRDLKRRkuZsR7k gK4NApVqGttfx3zkJASibyzGclCrrv/w7TQrXD8ofTuRGla9QsOkLosa9 jVI2xSehtMsADGBQFLfasXQHu+mkmP3P6/18BF4dAmZsjI4Oa4H/UOs0q VxZ9BUSDt6IpUz2QPM+K8GVizCiIqcb0F8Gxc3lLoyzfXEJ2RUrDjvEoK Q/3w/lyJqU6CUk75IWWj/Yjw6UTIAo8SyhPR9Kp4kk0dYL3w77k5Te4+w 0ooFhaPseMeO/nievh9GS2fYs2CgI6H3hyRCpRzkEVKGpXQP0S4xKHLkn Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10213"; a="328110766" X-IronPort-AV: E=Sophos;i="5.88,250,1635231600"; d="scan'208";a="328110766" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2021 22:10:23 -0800 X-IronPort-AV: E=Sophos;i="5.88,250,1635231600"; d="scan'208";a="470867810" Received: from unknown (HELO localhost.localdomain) ([10.239.13.19]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2021 22:10:22 -0800 From: Zhang Chen To: "Dr. David Alan Gilbert" , Juan Quintela , qemu-dev Subject: [PATCH 3/3] migration/migration.c: Remove the MIGRATION_STATUS_ACTIVE when migration finished Date: Fri, 31 Dec 2021 13:59:35 +0800 Message-Id: <20211231055935.1878503-4-chen.zhang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211231055935.1878503-1-chen.zhang@intel.com> References: <20211231055935.1878503-1-chen.zhang@intel.com> MIME-Version: 1.0 Received-SPF: pass client-ip=192.55.52.43; envelope-from=chen.zhang@intel.com; helo=mga05.intel.com X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Chen Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The MIGRATION_STATUS_ACTIVE indicates that migration is running. Remove it to be handled by the default operation, It should be part of the unknown ending states. Signed-off-by: Zhang Chen Reviewed-by: Juan Quintela --- migration/migration.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 3fac9c67ca..21e1498f46 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -3625,12 +3625,6 @@ static void migration_iteration_finish(MigrationState *s) "COLO enabled", __func__); } migrate_start_colo_process(s); - /* Fallthrough */ - case MIGRATION_STATUS_ACTIVE: - /* - * We should really assert here, but since it's during - * migration, let's try to reduce the usage of assertions. - */ s->vm_was_running = true; /* Fallthrough */ case MIGRATION_STATUS_FAILED: