From: Vladimir Sementsov-Ogievskiy <v.sementsov-og@mail.ru>
To: Nikita Lapshin <nikita.lapshin@openvz.org>, qemu-devel@nongnu.org
Cc: den@openvz.org, Nikita Lapshin <nikita.lapshin@virtuozzo.com>
Subject: Re: [PATCH v1 3/8] migration: Add vmstate part of migration stream
Date: Wed, 23 Mar 2022 17:07:48 +0300 [thread overview]
Message-ID: <fc33d11e-b8f7-5e26-9448-fa6adea5b6a8@mail.ru> (raw)
In-Reply-To: <f03bf2db-a424-17e2-38f1-1608c004c0e4@openvz.org>
23.03.2022 16:21, Nikita Lapshin wrote:
>
> On 3/23/22 15:49, Vladimir Sementsov-Ogievskiy wrote:
>
>> 23.03.2022 15:40, Vladimir Sementsov-Ogievskiy wrote:
>>> 23.03.2022 13:53, Nikita Lapshin wrote:
>>>> From: Nikita Lapshin<nikita.lapshin@virtuozzo.com>
>>>> Now we can disable and enable vmstate part by stream_content parameter.
>>>> Signed-off-by: Nikita Lapshin<nikita.lapshin@openvz.org>
>>>> ---
>>>> migration/migration.c | 10 ++++++++--
>>>> migration/savevm.c | 13 +++++++++++++
>>>> 2 files changed, 21 insertions(+), 2 deletions(-)
>>>> diff --git a/migration/migration.c b/migration/migration.c
>>>> index 4adcc87d1d..bbf9b6aad1 100644
>>>> --- a/migration/migration.c
>>>> +++ b/migration/migration.c
>>>> @@ -1334,9 +1334,15 @@ void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params,
>>>> }
>>>> }
>>>> -static bool check_stream_parts(strList *stream_content_list)
>>>> +static bool check_stream_parts(strList *stream_list)
>>>> {
>>>> - /* To be implemented in ext commits */
>>>> + for (; stream_list; stream_list = stream_list->next) {
>>>> + if (!strcmp(stream_list->value, "vmstate")) {
>>>> + continue;
>>>> + }
>>>> +
>>>> + return false;
>>>> + }
>>>> return true;
>>>> }
>>> When you move to enum for list elements in QAPI, this thing would be checked automatically, you will not have to check it by hand.
>>>> diff --git a/migration/savevm.c b/migration/savevm.c
>>>> index c68f187ef7..8f35c0c81e 100644
>>>> --- a/migration/savevm.c
>>>> +++ b/migration/savevm.c
>>>> @@ -949,6 +949,19 @@ static bool should_skip(SaveStateEntry *se)
>>>> return true;
>>>> }
>>>> + /*
>>>> + * Assume that any SaveStateEntry with non-null vmsd is
>>>> + * part of vmstate.
>>>> + * Vmstate is included by default so firstly check if
>>>> + * stream-content-list is enabled.
>>>> + */
>>>> +
>>>> + if (se->vmsd &&
>>>> + migrate_get_current()->parameters.has_stream_content_list &&
>>>> + !migrate_find_stream_content("vmstate")) {
>>> And in migrate_find_stream_content you do
>>> if (!s->parameters.has_stream_content_list) {
>>> return false;
>>> }
>>> Seems better to do
>>> if (!s->parameters.has_stream_content_list) {
>>> return true;
>>> }
>>> in migrate_find_stream_content(), and rename it to something like should_migrate_content() or just migrate_content().
>>> Then here you don't need to check .has_stream_content_list.
>> Hmm, but that will work bad with dirty-bitmaps, as they are disabled by default.
>> So, this actually means that we have different default for different contents:
>> ram and and other device states are enabled by default, dirty-bitmaps are disabled by defaults. We can honestly realize these defaults in migrate_content().
>
> Yes, I agree that this logic looks quite strange. May be explicit checks can help.
I think, checking for deprecated capabilites should be in same function migrate_content() too.
>
>>>> + return true;
>>>> + }
>>>> +
>>>> return false;
>>>> }
>>
--
Best regards,
Vladimir
next prev parent reply other threads:[~2022-03-23 14:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220323105400.17649-1-nikita.lapshin@openvz.org>
[not found] ` <20220323105400.17649-2-nikita.lapshin@openvz.org>
2022-03-23 12:28 ` [PATCH v1 1/8] migration: Implemented new parameter stream_content Vladimir Sementsov-Ogievskiy
[not found] ` <20220323105400.17649-3-nikita.lapshin@openvz.org>
2022-03-23 12:34 ` [PATCH v1 2/8] migration: should_skip() implemented Vladimir Sementsov-Ogievskiy
[not found] ` <20220323105400.17649-4-nikita.lapshin@openvz.org>
2022-03-23 12:40 ` [PATCH v1 3/8] migration: Add vmstate part of migration stream Vladimir Sementsov-Ogievskiy
2022-03-23 12:49 ` Vladimir Sementsov-Ogievskiy
[not found] ` <f03bf2db-a424-17e2-38f1-1608c004c0e4@openvz.org>
2022-03-23 14:07 ` Vladimir Sementsov-Ogievskiy [this message]
[not found] ` <20220323105400.17649-5-nikita.lapshin@openvz.org>
2022-03-23 12:49 ` [PATCH v1 4/8] migration: Add dirty-bitmaps " Vladimir Sementsov-Ogievskiy
[not found] ` <20220323105400.17649-6-nikita.lapshin@openvz.org>
2022-03-23 12:50 ` [PATCH v1 5/8] migration: Add block " Vladimir Sementsov-Ogievskiy
[not found] ` <20220323105400.17649-7-nikita.lapshin@openvz.org>
2022-03-23 13:52 ` [PATCH v1 6/8] migration: Add RAM " Vladimir Sementsov-Ogievskiy
[not found] ` <20220323105400.17649-8-nikita.lapshin@openvz.org>
2022-03-23 13:57 ` [PATCH v1 7/8] migration: analyze-migration script changed Vladimir Sementsov-Ogievskiy
2022-03-23 14:38 ` Nikita Lapshin
[not found] ` <20220323105400.17649-9-nikita.lapshin@openvz.org>
2022-03-23 14:05 ` [PATCH v1 8/8] migration: Test for RAM and vmstate parts 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=fc33d11e-b8f7-5e26-9448-fa6adea5b6a8@mail.ru \
--to=v.sementsov-og@mail.ru \
--cc=den@openvz.org \
--cc=nikita.lapshin@openvz.org \
--cc=nikita.lapshin@virtuozzo.com \
--cc=qemu-devel@nongnu.org \
/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).