From: Juan Quintela <quintela@redhat.com>
To: "Zhang, Chen" <chen.zhang@intel.com>
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"lukasstraub2@web.de" <lukasstraub2@web.de>,
Peter Xu <peterx@redhat.com>,
Leonardo Bras <leobras@redhat.com>
Subject: Re: [PATCH v4 09/10] migration: disallow change capabilities in COLO state
Date: Tue, 09 May 2023 20:22:55 +0200 [thread overview]
Message-ID: <87v8h1bc00.fsf@secure.mitica> (raw)
In-Reply-To: <MWHPR11MB0031697E5E975426340909BD9B6D9@MWHPR11MB0031.namprd11.prod.outlook.com> (Chen Zhang's message of "Thu, 4 May 2023 09:03:37 +0000")
"Zhang, Chen" <chen.zhang@intel.com> wrote:
>> -----Original Message-----
>> From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
>> Sent: Thursday, May 4, 2023 4:23 PM
>> To: Zhang, Chen <chen.zhang@intel.com>; qemu-devel@nongnu.org
>> Cc: lukasstraub2@web.de; quintela@redhat.com; Peter Xu
>> <peterx@redhat.com>; Leonardo Bras <leobras@redhat.com>
>> Subject: Re: [PATCH v4 09/10] migration: disallow change capabilities in COLO
>> state
>>
>> On 04.05.23 11:09, Zhang, Chen wrote:
>> >
>> >
>> >> -----Original Message-----
>> >> From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
>> >> Sent: Saturday, April 29, 2023 3:49 AM
>> >> To: qemu-devel@nongnu.org
>> >> Cc: lukasstraub2@web.de; quintela@redhat.com; Zhang, Chen
>> >> <chen.zhang@intel.com>; vsementsov@yandex-team.ru; Peter Xu
>> >> <peterx@redhat.com>; Leonardo Bras <leobras@redhat.com>
>> >> Subject: [PATCH v4 09/10] migration: disallow change capabilities in
>> >> COLO state
>> >>
>> >> COLO is not listed as running state in migrate_is_running(), so, it's
>> >> theoretically possible to disable colo capability in COLO state and
>> >> the unexpected error in migration_iteration_finish() is reachable.
>> >>
>> >> Let's disallow that in qmp_migrate_set_capabilities. Than the error
>> >> becomes absolutely unreachable: we can get into COLO state only with
>> >> enabled capability and can't disable it while we are in COLO state.
>> >> So substitute the error by simple assertion.
>> >>
>> >> Signed-off-by: Vladimir Sementsov-Ogievskiy
>> >> <vsementsov@yandex-team.ru>
>> >> ---
>> >> migration/migration.c | 5 +----
>> >> migration/options.c | 2 +-
>> >> 2 files changed, 2 insertions(+), 5 deletions(-)
>> >>
>> >> diff --git a/migration/migration.c b/migration/migration.c index
>> >> 0d912ee0d7..8c5bbf3e94 100644
>> >> --- a/migration/migration.c
>> >> +++ b/migration/migration.c
>> >> @@ -2751,10 +2751,7 @@ static void
>> >> migration_iteration_finish(MigrationState *s)
>> >> runstate_set(RUN_STATE_POSTMIGRATE);
>> >> break;
>> >> case MIGRATION_STATUS_COLO:
>> >> - if (!migrate_colo()) {
>> >> - error_report("%s: critical error: calling COLO code without "
>> >> - "COLO enabled", __func__);
>> >> - }
>> >> + assert(migrate_colo());
>> >> migrate_start_colo_process(s);
>> >> s->vm_was_running = true;
>> >> /* Fallthrough */
>> >> diff --git a/migration/options.c b/migration/options.c index
>> >> 865a0214d8..f461d02eeb 100644
>> >> --- a/migration/options.c
>> >> +++ b/migration/options.c
>> >> @@ -598,7 +598,7 @@ void
>> >> qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params,
>> >> MigrationCapabilityStatusList *cap;
>> >> bool new_caps[MIGRATION_CAPABILITY__MAX];
>> >>
>> >> - if (migration_is_running(s->state)) {
>> >> + if (migration_is_running(s->state) || migration_in_colo_state())
>> >> + {
>> >
>> > Make the "MIGRATION_STATUS_COLO" into the " migration_is_running()"
>> is a better way?
>>
>> I wasn't sure that that's correct.. migration_is_running() is used in several
>> places, to do so, I'd have to analyze them all.
>
> Actually, when running in the "MIGRATION_STATUS_COLO" means QEMU can not
> do a normal migration at the same time.
> Juan have any comments here?
My understanding of colo is pretty limited, but my mind explodes just
trying to think how many things we would have to check/do to do a
migration while in colo state.
So I guess you are right that we can't be in both at the same time.
Later, Juan.
next prev parent reply other threads:[~2023-05-09 18:23 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-28 19:49 [PATCH v4 00/10] COLO: improve build options Vladimir Sementsov-Ogievskiy
2023-04-28 19:49 ` [PATCH v4 01/10] block/meson.build: prefer positive condition for replication Vladimir Sementsov-Ogievskiy
2023-05-04 7:31 ` Zhang, Chen
2023-04-28 19:49 ` [PATCH v4 02/10] colo: make colo_checkpoint_notify static and provide simpler API Vladimir Sementsov-Ogievskiy
2023-05-02 18:24 ` Juan Quintela
2023-05-02 20:58 ` Peter Xu
2023-05-04 7:35 ` Zhang, Chen
2023-04-28 19:49 ` [PATCH v4 03/10] build: move COLO under CONFIG_REPLICATION Vladimir Sementsov-Ogievskiy
2023-05-02 16:41 ` Peter Xu
2023-05-03 22:43 ` Vladimir Sementsov-Ogievskiy
2023-05-09 18:17 ` Juan Quintela
2023-04-28 19:49 ` [PATCH v4 04/10] configure: add --disable-colo-proxy option Vladimir Sementsov-Ogievskiy
2023-05-04 7:45 ` Zhang, Chen
2023-05-09 18:42 ` Juan Quintela
2023-05-10 11:36 ` Vladimir Sementsov-Ogievskiy
2023-05-10 12:18 ` Juan Quintela
2023-05-10 12:48 ` Vladimir Sementsov-Ogievskiy
2023-05-10 13:48 ` Juan Quintela
2023-04-28 19:49 ` [PATCH v4 05/10] migration: drop colo_incoming_thread from MigrationIncomingState Vladimir Sementsov-Ogievskiy
2023-05-02 16:43 ` Peter Xu
2023-05-02 18:19 ` Juan Quintela
2023-05-04 7:46 ` Zhang, Chen
2023-04-28 19:49 ` [PATCH v4 06/10] migration: process_incoming_migration_co: simplify code flow around ret Vladimir Sementsov-Ogievskiy
2023-05-02 16:52 ` Peter Xu
2023-05-02 18:20 ` Juan Quintela
2023-05-04 7:48 ` Zhang, Chen
2023-04-28 19:49 ` [PATCH v4 07/10] migration: split migration_incoming_co Vladimir Sementsov-Ogievskiy
2023-05-02 20:48 ` Peter Xu
2023-05-03 22:51 ` Vladimir Sementsov-Ogievskiy
2023-05-04 7:51 ` Zhang, Chen
2023-04-28 19:49 ` [PATCH v4 08/10] migration: process_incoming_migration_co(): move colo part to colo Vladimir Sementsov-Ogievskiy
2023-05-02 20:54 ` Peter Xu
2023-05-03 9:15 ` Vladimir Sementsov-Ogievskiy
2023-04-28 19:49 ` [PATCH v4 09/10] migration: disallow change capabilities in COLO state Vladimir Sementsov-Ogievskiy
2023-05-02 20:57 ` Peter Xu
2023-05-04 8:09 ` Zhang, Chen
2023-05-04 8:23 ` Vladimir Sementsov-Ogievskiy
2023-05-04 9:03 ` Zhang, Chen
2023-05-09 18:22 ` Juan Quintela [this message]
2023-05-09 18:46 ` Juan Quintela
2023-04-28 19:49 ` [PATCH v4 10/10] migration: block incoming colo when capability is disabled Vladimir Sementsov-Ogievskiy
2023-05-02 20:57 ` Peter Xu
2023-05-04 9:25 ` Zhang, Chen
2023-05-04 22:10 ` Lukas Straub
2023-05-04 22:30 ` Vladimir Sementsov-Ogievskiy
2023-05-04 22:46 ` Lukas Straub
2023-05-05 7:51 ` Zhang, Chen
2023-05-09 18:23 ` Juan Quintela
2023-05-05 7:56 ` [PATCH v4 00/10] COLO: improve build options Zhang, Chen
2023-05-05 8:21 ` Vladimir Sementsov-Ogievskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v8h1bc00.fsf@secure.mitica \
--to=quintela@redhat.com \
--cc=chen.zhang@intel.com \
--cc=leobras@redhat.com \
--cc=lukasstraub2@web.de \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@yandex-team.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).