From nobody Sat May 18 10:07:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1684327224; cv=none; d=zohomail.com; s=zohoarc; b=NEf4qH1R0F3Mn3nte6lJaWBhwRUMJ/YDzJFCMmcRwiMbON4zhcGQekzeGnFAbKrQnIeVvmFJ+2xkGyn5mfMeuSt7H/Ab6VdeKhCvximvaWSgUxExxP4vMmAQeHE7bOHGIu4h2EKgrCRxuknJ5vx+FJr573aW8T6mjVnSuyQ/I3c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684327224; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qmNKOzCEih1cUmj+W6WaTzBuYOWTTnQ0arLgcpBXT1k=; b=THSZwR6t5RYaSjKp5Cr9wyAvw40Rg50D7sXcRyx6VEPWXfiu0kMU6RtgLPvhHUv7hkoNddduDwTmcA8KGv8xCWQrjEdAf6EbiY9FyzAyDE8oxGI2rzZBSRBi6/4GFcZFZf5zLtegC/gikaAfbfuagXreXa+QVxJB2dRRTpmHx0U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684327224103713.1085103242302; Wed, 17 May 2023 05:40:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzGQV-0006dM-J3; Wed, 17 May 2023 08:38:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzGQT-0006ci-Hg for qemu-devel@nongnu.org; Wed, 17 May 2023 08:38:41 -0400 Received: from forwardcorp1c.mail.yandex.net ([2a02:6b8:c03:500:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzGQR-00019d-Py for qemu-devel@nongnu.org; Wed, 17 May 2023 08:38:41 -0400 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c14:151e:0:640:1960:0]) by forwardcorp1c.mail.yandex.net (Yandex) with ESMTP id BF3FC5E7F1; Wed, 17 May 2023 15:38:32 +0300 (MSK) Received: from vsementsov-nix.yandex.net (unknown [2a02:6b8:8f:4:7a31:c1ff:fef2:bf07]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id KcbvG13OqeA0-Kg48OSgG; Wed, 17 May 2023 15:38:31 +0300 Precedence: bulk X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1684327111; bh=qmNKOzCEih1cUmj+W6WaTzBuYOWTTnQ0arLgcpBXT1k=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=OB/n0N2Zwi2G/ABhJCRESN+AGC8TU5Jpxc+FEew3tqqGUToeRLk+LGWliFuc8Jv5t 69C4LH3Lm9t7bUo2AlmEjgJoNXP/Cvxk4zck63IFSFxhFVxjRvVCeyQ2pRNH1Rxkpr gmiETeg4ZWw9r9BubweJQHGFTv5mJDFzdHuhUubE= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, leobras@redhat.com, peterx@redhat.com, quintela@redhat.com, vsementsov@yandex-team.ru, yc-core@yandex-team.ru Subject: [PATCH 1/5] runstate: add runstate_get() Date: Wed, 17 May 2023 15:37:48 +0300 Message-Id: <20230517123752.21615-2-vsementsov@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230517123752.21615-1-vsementsov@yandex-team.ru> References: <20230517123752.21615-1-vsementsov@yandex-team.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a02:6b8:c03:500:1:45:d181:df01; envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1c.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1684327225684100001 Content-Type: text/plain; charset="utf-8" It's necessary to restore the state after failed/cancelled migration in further commit. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Juan Quintela --- include/sysemu/runstate.h | 1 + softmmu/runstate.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/sysemu/runstate.h b/include/sysemu/runstate.h index f3ed52548e..85f5d9a419 100644 --- a/include/sysemu/runstate.h +++ b/include/sysemu/runstate.h @@ -6,6 +6,7 @@ =20 bool runstate_check(RunState state); void runstate_set(RunState new_state); +RunState runstate_get(void); bool runstate_is_running(void); bool runstate_needs_reset(void); bool runstate_store(char *str, size_t size); diff --git a/softmmu/runstate.c b/softmmu/runstate.c index 2f2396c819..1e6f0bcecc 100644 --- a/softmmu/runstate.c +++ b/softmmu/runstate.c @@ -221,6 +221,11 @@ void runstate_set(RunState new_state) current_run_state =3D new_state; } =20 +RunState runstate_get(void) +{ + return current_run_state; +} + bool runstate_is_running(void) { return runstate_check(RUN_STATE_RUNNING); --=20 2.34.1 From nobody Sat May 18 10:07:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1684327232; cv=none; d=zohomail.com; s=zohoarc; b=QlH1c/iBBFD9gc4zHOmEW6kzvAFF6+3BpVOR5Fl5mwwwfYvpf/+US9SDwBkEy5XqeBTfZbvhsz+4DvU6v8VoDmsXxGilq0x0TcHzIgPBUBJIOTgv7H8mrurRNqSI9Qwawaq1iBZas8xjV78PkfDk9c5IuLkEYfzcSQHGNPb2Y08= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684327232; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5/3JCpOGZMdbTePdLb5WsIsKbqTR8LjuYOU/wmufghs=; b=ePkUHul3W4tlQaxB7fD8qGaPg/Ec0QCzLFdObYQSYwUoPJ+sI2MHJbKxNlRu4Lnlz4zzAAgamuJxFKtJf2VGuQLkeLy/4780VYmEb2uJFZh3CH9+zVBCxZcEyZQ/je0vKt7MjGWXrFodtbUwJUJ6ls+jbvb7CGdWqShDFH9B5Dg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684327232035383.99655930139204; Wed, 17 May 2023 05:40:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzGQV-0006dV-KG; Wed, 17 May 2023 08:38:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzGQT-0006cp-QA for qemu-devel@nongnu.org; Wed, 17 May 2023 08:38:41 -0400 Received: from forwardcorp1c.mail.yandex.net ([2a02:6b8:c03:500:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzGQR-00019r-LZ for qemu-devel@nongnu.org; Wed, 17 May 2023 08:38:41 -0400 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c14:151e:0:640:1960:0]) by forwardcorp1c.mail.yandex.net (Yandex) with ESMTP id B205E5ED1E; Wed, 17 May 2023 15:38:33 +0300 (MSK) Received: from vsementsov-nix.yandex.net (unknown [2a02:6b8:8f:4:7a31:c1ff:fef2:bf07]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id KcbvG13OqeA0-G3PHp3O5; Wed, 17 May 2023 15:38:32 +0300 Precedence: bulk X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1684327112; bh=5/3JCpOGZMdbTePdLb5WsIsKbqTR8LjuYOU/wmufghs=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=oj7v3FbNBrJ4W0u0bii8gLyUvAs7AACsaRr2WEpDL6RodjHkSJnrUs234yxLRrZHW 4yaXwmK528xJUB0mlQpZM725Ek2ANveF2vZG2s/KRBpFwHIMkIXhn7A/GIbwklW2xU 8bokjF02Bn7DUixry8EAfOY/j++HDWOIGNaYH7EY= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, leobras@redhat.com, peterx@redhat.com, quintela@redhat.com, vsementsov@yandex-team.ru, yc-core@yandex-team.ru Subject: [PATCH 2/5] migration: never fail in global_state_store() Date: Wed, 17 May 2023 15:37:49 +0300 Message-Id: <20230517123752.21615-3-vsementsov@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230517123752.21615-1-vsementsov@yandex-team.ru> References: <20230517123752.21615-1-vsementsov@yandex-team.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a02:6b8:c03:500:1:45:d181:df01; envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1c.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1684327238003100001 Content-Type: text/plain; charset="utf-8" Actually global_state_store() can never fail. Let's get rid of extra error paths. To make things clear, use new runstate_get() and use same approach for global_state_store() and global_state_store_running(). Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Juan Quintela --- include/migration/global_state.h | 2 +- migration/global_state.c | 23 ++++++++--------- migration/migration.c | 43 +++++++++++++++----------------- migration/savevm.c | 6 +---- 4 files changed, 33 insertions(+), 41 deletions(-) diff --git a/include/migration/global_state.h b/include/migration/global_st= ate.h index 945eb35d5b..d7c2cd3216 100644 --- a/include/migration/global_state.h +++ b/include/migration/global_state.h @@ -16,7 +16,7 @@ #include "qapi/qapi-types-run-state.h" =20 void register_global_state(void); -int global_state_store(void); +void global_state_store(void); void global_state_store_running(void); bool global_state_received(void); RunState global_state_get_runstate(void); diff --git a/migration/global_state.c b/migration/global_state.c index a33947ca32..4e2a9d8ec0 100644 --- a/migration/global_state.c +++ b/migration/global_state.c @@ -29,23 +29,22 @@ typedef struct { =20 static GlobalState global_state; =20 -int global_state_store(void) +static void global_state_do_store(RunState state) { - if (!runstate_store((char *)global_state.runstate, - sizeof(global_state.runstate))) { - error_report("runstate name too big: %s", global_state.runstate); - trace_migrate_state_too_big(); - return -EINVAL; - } - return 0; + const char *state_str =3D RunState_str(state); + assert(strlen(state_str) < sizeof(global_state.runstate)); + strpadcpy((char *)global_state.runstate, sizeof(global_state.runstate), + state_str, '\0'); +} + +void global_state_store(void) +{ + global_state_do_store(runstate_get()); } =20 void global_state_store_running(void) { - const char *state =3D RunState_str(RUN_STATE_RUNNING); - assert(strlen(state) < sizeof(global_state.runstate)); - strpadcpy((char *)global_state.runstate, sizeof(global_state.runstate), - state, '\0'); + global_state_do_store(RUN_STATE_RUNNING); } =20 bool global_state_received(void) diff --git a/migration/migration.c b/migration/migration.c index 439e8651df..b42d028191 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2313,27 +2313,26 @@ static void migration_completion(MigrationState *s) s->downtime_start =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME); qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER, NULL); s->vm_was_running =3D runstate_is_running(); - ret =3D global_state_store(); - - if (!ret) { - ret =3D vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); - trace_migration_completion_vm_stop(ret); - if (ret >=3D 0) { - ret =3D migration_maybe_pause(s, ¤t_active_state, - MIGRATION_STATUS_DEVICE); - } - if (ret >=3D 0) { - /* - * Inactivate disks except in COLO, and track that we - * have done so in order to remember to reactivate - * them if migration fails or is cancelled. - */ - s->block_inactive =3D !migrate_colo(); - qemu_file_set_rate_limit(s->to_dst_file, INT64_MAX); - ret =3D qemu_savevm_state_complete_precopy(s->to_dst_file,= false, - s->block_inactive= ); - } + global_state_store(); + + ret =3D vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); + trace_migration_completion_vm_stop(ret); + if (ret >=3D 0) { + ret =3D migration_maybe_pause(s, ¤t_active_state, + MIGRATION_STATUS_DEVICE); + } + if (ret >=3D 0) { + /* + * Inactivate disks except in COLO, and track that we + * have done so in order to remember to reactivate + * them if migration fails or is cancelled. + */ + s->block_inactive =3D !migrate_colo(); + qemu_file_set_rate_limit(s->to_dst_file, INT64_MAX); + ret =3D qemu_savevm_state_complete_precopy(s->to_dst_file, fal= se, + s->block_inactive); } + qemu_mutex_unlock_iothread(); =20 if (ret < 0) { @@ -3120,9 +3119,7 @@ static void *bg_migration_thread(void *opaque) qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER, NULL); s->vm_was_running =3D runstate_is_running(); =20 - if (global_state_store()) { - goto fail; - } + global_state_store(); /* Forcibly stop VM before saving state of vCPUs and devices */ if (vm_stop_force_state(RUN_STATE_PAUSED)) { goto fail; diff --git a/migration/savevm.c b/migration/savevm.c index 032044b1d5..778030d087 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2919,11 +2919,7 @@ bool save_snapshot(const char *name, bool overwrite,= const char *vmstate, =20 saved_vm_running =3D runstate_is_running(); =20 - ret =3D global_state_store(); - if (ret) { - error_setg(errp, "Error saving global state"); - return false; - } + global_state_store(); vm_stop(RUN_STATE_SAVE_VM); =20 bdrv_drain_all_begin(); --=20 2.34.1 From nobody Sat May 18 10:07:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1684327178; cv=none; d=zohomail.com; s=zohoarc; b=WZzYna44eZ7sU621VrTfj2WyQJGVSCubrxQPbDNj4LfUevk5w5dB/Wao7eSFumN9x8Df6x/sSHIWW2n9oNSVRrqI99WUUZmSn9i2yIOC3YwB56WtH0pivZMYZOGUSbUY0+Jz0xSuF6hxrwSI5CzznzBjkh7Ac92jv+MLXeZrVoU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684327178; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ArVNJz7ZX2mr/jkQnAXAfsxs+7pzUdSIeePAHjivkVg=; b=KeyYXEofyXHG+Bbix+GWZNoe3kH/DaRQHZLAZzpCZMumI532oA11nBa0VAnoWlGbaZ2eQ6lszubar8H2+AQIBl7bFlxC6gHmt5/Hf2qdsXbe21wI32JaoUT3TefngW7KdrPN2cl75WVBMSpypHADKOgGLAQVculiY9m79iHuYrs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 168432717810642.50958195141834; Wed, 17 May 2023 05:39:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzGQW-0006dy-7X; Wed, 17 May 2023 08:38:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzGQU-0006cz-RT for qemu-devel@nongnu.org; Wed, 17 May 2023 08:38:42 -0400 Received: from forwardcorp1c.mail.yandex.net ([2a02:6b8:c03:500:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzGQS-0001A1-Os for qemu-devel@nongnu.org; Wed, 17 May 2023 08:38:42 -0400 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c14:151e:0:640:1960:0]) by forwardcorp1c.mail.yandex.net (Yandex) with ESMTP id 8102B5F044; Wed, 17 May 2023 15:38:34 +0300 (MSK) Received: from vsementsov-nix.yandex.net (unknown [2a02:6b8:8f:4:7a31:c1ff:fef2:bf07]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id KcbvG13OqeA0-QR9b8jEW; Wed, 17 May 2023 15:38:33 +0300 Precedence: bulk X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1684327113; bh=ArVNJz7ZX2mr/jkQnAXAfsxs+7pzUdSIeePAHjivkVg=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=y7m3zLWnsNc5DlM99In0vHnsvGH6SZetP6VjsgVTGI06w1toLy7su+M6Qk71DD0i6 KjuGPbOTfYdAfsoctdoCIihHxrRxrdrtMAOO+kd9sa8MSn/4ZLwotpuwWHtLYnrZvG 43FxQx/AehmIdGVt0u+QX6JES/D/Tuq9IQHw6Knc= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, leobras@redhat.com, peterx@redhat.com, quintela@redhat.com, vsementsov@yandex-team.ru, yc-core@yandex-team.ru Subject: [PATCH 3/5] runstate: drop unused runstate_store() Date: Wed, 17 May 2023 15:37:50 +0300 Message-Id: <20230517123752.21615-4-vsementsov@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230517123752.21615-1-vsementsov@yandex-team.ru> References: <20230517123752.21615-1-vsementsov@yandex-team.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a02:6b8:c03:500:1:45:d181:df01; envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1c.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1684327179456100005 Content-Type: text/plain; charset="utf-8" The function is unused since previous commit. Drop it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Juan Quintela --- include/sysemu/runstate.h | 1 - softmmu/runstate.c | 12 ------------ 2 files changed, 13 deletions(-) diff --git a/include/sysemu/runstate.h b/include/sysemu/runstate.h index 85f5d9a419..7beb29c2e2 100644 --- a/include/sysemu/runstate.h +++ b/include/sysemu/runstate.h @@ -9,7 +9,6 @@ void runstate_set(RunState new_state); RunState runstate_get(void); bool runstate_is_running(void); bool runstate_needs_reset(void); -bool runstate_store(char *str, size_t size); =20 typedef void VMChangeStateHandler(void *opaque, bool running, RunState sta= te); =20 diff --git a/softmmu/runstate.c b/softmmu/runstate.c index 1e6f0bcecc..0370230a5e 100644 --- a/softmmu/runstate.c +++ b/softmmu/runstate.c @@ -175,18 +175,6 @@ bool runstate_check(RunState state) return current_run_state =3D=3D state; } =20 -bool runstate_store(char *str, size_t size) -{ - const char *state =3D RunState_str(current_run_state); - size_t len =3D strlen(state) + 1; - - if (len > size) { - return false; - } - memcpy(str, state, len); - return true; -} - static void runstate_init(void) { const RunStateTransition *p; --=20 2.34.1 From nobody Sat May 18 10:07:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1684327225; cv=none; d=zohomail.com; s=zohoarc; b=BozGrKA/r2Ucp3fuE8dHZEaAj1sTT3F06x/MgCQK8PB0i/D8vFgR4PMzFDDA23LRfUacxzOXolKSzEFm/emrbh9HVGH7Hd4u8tJsgPZ6LGIsNErqsxAT9e7GJl4o88zPg2NpRyR6AfQLoeDn2C49dm37hg5BfLdCWV6ea1gE4Cw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684327225; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Fo/EWCGQSlUr4DO8LrrOj/QlVEYudvQ+nSMzOkacUDc=; b=SLZSZu/Bf7dJ1eDjIVyHpBNBM90V+oxKqtOvpZG8UwkUFm41f1snCpLJ2gSbamrCpPd5tWIPOF8gzQqR6B1S7i/tRj9Xzb3zPaiHuSS0CyLNbpIDtZHY1C+xi34sNxeQteSrP9f8/LD5zw+FgzfhZUKUPyjjQIQxqwsoZFHKHRw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684327225264212.19013228845415; Wed, 17 May 2023 05:40:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzGQW-0006eM-PP; Wed, 17 May 2023 08:38:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzGQV-0006dE-44 for qemu-devel@nongnu.org; Wed, 17 May 2023 08:38:43 -0400 Received: from forwardcorp1c.mail.yandex.net ([2a02:6b8:c03:500:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzGQT-0001AD-CJ for qemu-devel@nongnu.org; Wed, 17 May 2023 08:38:42 -0400 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c14:151e:0:640:1960:0]) by forwardcorp1c.mail.yandex.net (Yandex) with ESMTP id 6264D5F025; Wed, 17 May 2023 15:38:35 +0300 (MSK) Received: from vsementsov-nix.yandex.net (unknown [2a02:6b8:8f:4:7a31:c1ff:fef2:bf07]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id KcbvG13OqeA0-AULsnu2a; Wed, 17 May 2023 15:38:34 +0300 Precedence: bulk X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1684327114; bh=Fo/EWCGQSlUr4DO8LrrOj/QlVEYudvQ+nSMzOkacUDc=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=RIyUTS2r0L7OigEnEvdlVlJUsb5d0qfLS5pbX8vy20bS1JJY3NAgwsyi4md+wILzk lU+sQ5MwKG/QoC8moH5TrYfWjFARuZ2tLMPM0y3cXRFmhbDVYb+ACT9UhXRR7fh6WG ZAI/H2ZmjhRVatyVVXu7F18R1G//Jg6eY48m4v9g= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, leobras@redhat.com, peterx@redhat.com, quintela@redhat.com, vsementsov@yandex-team.ru, yc-core@yandex-team.ru Subject: [PATCH 4/5] migration: switch from .vm_was_running to .vm_old_state Date: Wed, 17 May 2023 15:37:51 +0300 Message-Id: <20230517123752.21615-5-vsementsov@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230517123752.21615-1-vsementsov@yandex-team.ru> References: <20230517123752.21615-1-vsementsov@yandex-team.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a02:6b8:c03:500:1:45:d181:df01; envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1c.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1684327227266100007 Content-Type: text/plain; charset="utf-8" No logic change here, only refactoring. That's a preparation for next commit where we finally restore the stopped vm state on migration failure or cancellation. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Juan Quintela --- migration/migration.c | 11 ++++++----- migration/migration.h | 9 ++++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index b42d028191..4ccb9f9f3b 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1422,7 +1422,7 @@ void migrate_init(MigrationState *s) =20 s->start_time =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME); s->total_time =3D 0; - s->vm_was_running =3D false; + s->vm_old_state =3D -1; s->iteration_initial_bytes =3D 0; s->threshold_size =3D 0; } @@ -2312,7 +2312,8 @@ static void migration_completion(MigrationState *s) qemu_mutex_lock_iothread(); s->downtime_start =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME); qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER, NULL); - s->vm_was_running =3D runstate_is_running(); + + s->vm_old_state =3D runstate_get(); global_state_store(); =20 ret =3D vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); @@ -2792,12 +2793,12 @@ static void migration_iteration_finish(MigrationSta= te *s) case MIGRATION_STATUS_COLO: assert(migrate_colo()); migrate_start_colo_process(s); - s->vm_was_running =3D true; + s->vm_old_state =3D RUN_STATE_RUNNING; /* Fallthrough */ case MIGRATION_STATUS_FAILED: case MIGRATION_STATUS_CANCELLED: case MIGRATION_STATUS_CANCELLING: - if (s->vm_was_running) { + if (s->vm_old_state =3D=3D RUN_STATE_RUNNING) { if (!runstate_check(RUN_STATE_SHUTDOWN)) { vm_start(); } @@ -3117,7 +3118,7 @@ static void *bg_migration_thread(void *opaque) * transition in vm_stop_force_state() we need to wakeup it up. */ qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER, NULL); - s->vm_was_running =3D runstate_is_running(); + s->vm_old_state =3D runstate_get(); =20 global_state_store(); /* Forcibly stop VM before saving state of vCPUs and devices */ diff --git a/migration/migration.h b/migration/migration.h index 7721c7658b..a786778c9d 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -25,6 +25,7 @@ #include "net/announce.h" #include "qom/object.h" #include "postcopy-ram.h" +#include "sysemu/runstate.h" =20 struct PostcopyBlocktimeContext; =20 @@ -310,12 +311,14 @@ struct MigrationState { int64_t expected_downtime; bool capabilities[MIGRATION_CAPABILITY__MAX]; int64_t setup_time; + /* - * Whether guest was running when we enter the completion stage. + * State before stopping the vm by vm_stop_force_state(). * If migration is interrupted by any reason, we need to continue - * running the guest on source. + * running the guest on source if it was running or restore its stopped + * state. */ - bool vm_was_running; + RunState vm_old_state; =20 /* Flag set once the migration has been asked to enter postcopy */ bool start_postcopy; --=20 2.34.1 From nobody Sat May 18 10:07:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1684327178; cv=none; d=zohomail.com; s=zohoarc; b=CIO2wEX0iHAdBFEPSVXqZsrfj/h/HSF0bAlIsD8TXwYefzkPPv6SlMVZkDPmsU57LRj5PqUotUQG+d7hCkKQbZgm+kJxgbyByOvHukmJLuh8+/J+OSS0VfbWYtFnN2HsJUPtcHQ9LFt5ffoJHDI5dRU/qrGp2NjvTv6W4gCGxR8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684327178; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ViHCCEuzBqPFruSUxRv3sDA4dNpVzVufT2ps8lQXDjg=; b=HisA+6lX1oxqGj9j43Mzsip29mgd2b7o/ZtbsJRUQ/qudcBuliKTgmCy3O+FBpj/+fXn5UGbhi1TgzfpmBRRLTdqu723mFUA7bbkk1nAlW8HCFtIHo78lFO2Z/andRqsmouXmPrk8HJSHY49iw0znKXNwg1rdaogRltzDEYoDbM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684327178214303.0449809693988; Wed, 17 May 2023 05:39:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzGQY-0006fG-E9; Wed, 17 May 2023 08:38:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzGQW-0006dz-AF for qemu-devel@nongnu.org; Wed, 17 May 2023 08:38:44 -0400 Received: from forwardcorp1c.mail.yandex.net ([2a02:6b8:c03:500:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzGQT-0001AJ-VU for qemu-devel@nongnu.org; Wed, 17 May 2023 08:38:44 -0400 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c14:151e:0:640:1960:0]) by forwardcorp1c.mail.yandex.net (Yandex) with ESMTP id 4B48B5F121; Wed, 17 May 2023 15:38:36 +0300 (MSK) Received: from vsementsov-nix.yandex.net (unknown [2a02:6b8:8f:4:7a31:c1ff:fef2:bf07]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id KcbvG13OqeA0-154XgN5u; Wed, 17 May 2023 15:38:35 +0300 Precedence: bulk X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1684327115; bh=ViHCCEuzBqPFruSUxRv3sDA4dNpVzVufT2ps8lQXDjg=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=aB0zv8oCKmwYASz7Lr31oAfQriwFstfV6x3DNc1r+WklaI4hbc8qCDwtc+/4O7agz +oZ7bO7DTAllWsipVDzAItUQrp8DDqrKRqJVMzhIB0Rzjd6AcI9+xvrKK1VrUAxOht O8ov4ZTlwBTS+RJjOHfd2pIFk06MNfoDApstQnkA= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, leobras@redhat.com, peterx@redhat.com, quintela@redhat.com, vsementsov@yandex-team.ru, yc-core@yandex-team.ru Subject: [PATCH 5/5] migration: restore vmstate on migration failure Date: Wed, 17 May 2023 15:37:52 +0300 Message-Id: <20230517123752.21615-6-vsementsov@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230517123752.21615-1-vsementsov@yandex-team.ru> References: <20230517123752.21615-1-vsementsov@yandex-team.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a02:6b8:c03:500:1:45:d181:df01; envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1c.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1684327179037100001 Content-Type: text/plain; charset="utf-8" 1. Otherwise failed migration just drops guest-panicked state, which is not good for management software. 2. We do keep different paused states like guest-panicked during migration with help of global_state state. 3. We do restore running state on source when migration is cancelled or failed. 4. "postmigrate" state is documented as "guest is paused following a successful 'migrate'", so originally it's only for successful path and we never documented current behavior. Let's restore paused states like guest-panicked in case of cancel or fail too. Allow same transitions like for inmigrate state. This commit changes the behavior that was introduced by commit 42da5550d6 "migration: set state to post-migrate on failure" and provides a bit different fix on related https://bugzilla.redhat.com/show_bug.cgi?id=3D1355683 Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Juan Quintela --- migration/migration.c | 2 +- softmmu/runstate.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 4ccb9f9f3b..951897554f 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2804,7 +2804,7 @@ static void migration_iteration_finish(MigrationState= *s) } } else { if (runstate_check(RUN_STATE_FINISH_MIGRATE)) { - runstate_set(RUN_STATE_POSTMIGRATE); + runstate_set(s->vm_old_state); } } break; diff --git a/softmmu/runstate.c b/softmmu/runstate.c index 0370230a5e..1957caf73f 100644 --- a/softmmu/runstate.c +++ b/softmmu/runstate.c @@ -121,7 +121,13 @@ static const RunStateTransition runstate_transitions_d= ef[] =3D { { RUN_STATE_FINISH_MIGRATE, RUN_STATE_PAUSED }, { RUN_STATE_FINISH_MIGRATE, RUN_STATE_POSTMIGRATE }, { RUN_STATE_FINISH_MIGRATE, RUN_STATE_PRELAUNCH }, - { RUN_STATE_FINISH_MIGRATE, RUN_STATE_COLO}, + { RUN_STATE_FINISH_MIGRATE, RUN_STATE_COLO }, + { RUN_STATE_FINISH_MIGRATE, RUN_STATE_INTERNAL_ERROR }, + { RUN_STATE_FINISH_MIGRATE, RUN_STATE_IO_ERROR }, + { RUN_STATE_FINISH_MIGRATE, RUN_STATE_SHUTDOWN }, + { RUN_STATE_FINISH_MIGRATE, RUN_STATE_SUSPENDED }, + { RUN_STATE_FINISH_MIGRATE, RUN_STATE_WATCHDOG }, + { RUN_STATE_FINISH_MIGRATE, RUN_STATE_GUEST_PANICKED }, =20 { RUN_STATE_RESTORE_VM, RUN_STATE_RUNNING }, { RUN_STATE_RESTORE_VM, RUN_STATE_PRELAUNCH }, --=20 2.34.1