[PATCH v3 17/17] migration/snapshot: Postcopy load implemented

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin It is a modified load part from previous patch. Implemented new rp listen thread for snapshot-tool. Also implemented functions for starting postcopy. This mode can be turned on by specifying --postcopy flag. Signed-off-by: Nikita Lapshin --- include/qemu-snapshot.h

[PATCH v3 16/17] migration/snapshot: Precopy load implemented

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin Load snapshot from qcow2 file. This part also work only with ram part and send vmstate part as it was saved previously without parsing. Here also migration code was reused but now it is savevm part. Tool replace ram handlers as it did before in tool save part but now

[PATCH v3 15/17] migration/snapshot: Save part implement

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin Snapshot save are done in two stages. First tool save vmstate part. It must be guaranteed that tool will get vmstate part only. This is because tool won't parse this stream and will just save it non-modified. Second stage is ram sending. Also it must be guarantee that ram

[PATCH v3 13/17] migration/snapshot: Block layer support in qemu-snapshot

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin This commit enables few functions to simplify block layer work for qemu-snapshot tool. Signed-off-by: Nikita Lapshin --- include/qemu-snapshot.h | 3 + migration/meson.build| 1 + migration/qemu-snapshot-io.c | 112 +++ 3

[PATCH v3 09/17] migration/snapshot: Introduce qemu-snapshot tool

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin Execution environment, command-line argument parsing, usage/version info etc. Signed-off-by: Nikita Lapshin --- include/qemu-snapshot.h | 65 ++ migration/qemu-snapshot.c | 57 + qemu-snapshot.c | 433 ++ 3 files

[PATCH v3 12/17] migration/snapshot: Move RAM_SAVE_FLAG_xxx defines to migration/ram.h

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin Move RAM_SAVE_FLAG_xxx defines from migration/ram.c to migration/ram.h Signed-off-by: Nikita Lapshin --- migration/ram.c | 16 migration/ram.h | 16 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/migration/ram.c b

[PATCH v3 11/17] migration/qemu-file: Fix qemu_ftell() for non-writable file

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin qemu_ftell() will return wrong value for non-writable QEMUFile. This happens due to call qemu_fflush() inside qemu_ftell(), this function won't flush if file is readable. Signed-off-by: Nikita Lapshin --- migration/qemu-file.c | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH v3 06/17] migration: Add RAM part of migration stream

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin 'ram' parameter enable RAM sections in migration stream. If it isn't specified it will be skipped. Signed-off-by: Nikita Lapshin --- migration/migration.c | 17 - migration/migration.h | 1 + migration/ram.c | 6 ++ 3 files changed, 23

[PATCH v3 02/17] migration: should_skip() implemented

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin For next changes it is convenient to make all decisions about sections skipping in one function. Signed-off-by: Nikita Lapshin --- migration/savevm.c | 54 -- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git

[PATCH v3 08/17] migration: Test for RAM and vmstate parts

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin All other parts works just like existed capabilities. Thus there is no need to make new tests. Though RAM and vmstate are new so here is new test for that parts. Signed-off-by: Nikita Lapshin --- .../tests/migrate-ram-stream-content-test | 96

[PATCH v3 01/17] migration: Implemented new parameter stream_content

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin This new optional parameter contains inormation about migration stream parts to be sent (such as RAM, block, bitmap). This looks better than using capabilities to solve problem of dividing migration stream. Signed-off-by: Nikita Lapshin --- migration/migration.c | 47

[PATCH v3 14/17] migration/snpashot: Implement API for RAMBlock

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin Implemented RAMBlock is used for managing ram block from VM. This structure is close to existing RAMBlock in migration but has few differences. May be it should be replaced with existing RAMBlock it can lead to lots of reuses. Signed-off-by: Nikita Lapshin --- migration

[PATCH v3 07/17] migration: analyze-migration script changed

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin This script is used for RAM capabilities test. But it cannot work in case of no vm description in migration stream. So new flag is added to allow work this script with ram-only migration stream. Signed-off-by: Nikita Lapshin --- scripts/analyze-migration.py | 19

[PATCH 5/8] migration: Add block part of migration stream

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin This patch enables and disable block in migration stream. Signed-off-by: Nikita Lapshin --- migration/migration.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index ad789915ce..d81f3c6891 100644

[PATCH v3 10/17] migration/snapshot: Build changes for qemu-snapshot-tool

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin Tool uses part of migration code thus new lib with stubs for migration code is added here. Signed-off-by: Nikita Lapshin --- meson.build | 18 ++ migration/meson.build | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git

[PATCH v3 05/17] migration: Add block part of migration stream

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin This patch enables and disable block in migration stream. Signed-off-by: Nikita Lapshin --- migration/migration.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index ad789915ce..d81f3c6891 100644

[PATCH 8/8] migration: Test for RAM and vmstate parts

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin All other parts works just like existed capabilities. Thus there is no need to make new tests. Though RAM and vmstate are new so here is new test for that parts. Signed-off-by: Nikita Lapshin --- .../tests/migrate-ram-stream-content-test | 96

[PATCH v3 04/17] migration: Add dirty-bitmaps part of migration stream

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin This patch enables and disable dirty-bitmaps in migration stream. Signed-off-by: Nikita Lapshin --- migration/migration.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index bbf9b6aad1..ad789915ce

[PATCH v3 00/17] migration/snapshot: External snapshot utility

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin Changes v2 -> v3 * Refactored tool code to decrease duplications of migration code. * Used sequential migration for saving which means that vmstate will be send first and only after that ram part will be sent. For this purpose stream-content-list paramter was u

[PATCH 1/8] migration: Implemented new parameter stream_content

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin This new optional parameter contains inormation about migration stream parts to be sent (such as RAM, block, bitmap). This looks better than using capabilities to solve problem of dividing migration stream. Signed-off-by: Nikita Lapshin --- migration/migration.c | 47

[PATCH v3 03/17] migration: Add vmstate part of migration stream

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin Now we can disable and enable vmstate part by stream_content parameter. Signed-off-by: Nikita Lapshin --- migration/migration.c | 10 -- migration/savevm.c| 15 +++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/migration

[PATCH 5/8] Add block part of migration stream

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin This patch enables and disable block in migration stream. Signed-off-by: Nikita Lapshin --- migration/migration.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index ad789915ce..d81f3c6891 100644

[PATCH 4/8] igration: Add dirty-bitmaps part of migration stream

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin This patch enables and disable dirty-bitmaps in migration stream. Signed-off-by: Nikita Lapshin --- migration/migration.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index bbf9b6aad1..ad789915ce

[PATCH 0/8] New parameter for migration stream

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin We want to implement exteranl bg-snapshot tool for saving RAM. For this it is important to be able manage migration stream because tool has no idea about non-RAM part and how to parse it. This paramter provides gurantee about migration content. Now there are 4 parts

[PATCH 6/8] migration: Add RAM part of migration stream

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin 'ram' parameter enable RAM sections in migration stream. If it isn't specified it will be skipped. Signed-off-by: Nikita Lapshin --- migration/migration.c | 17 - migration/migration.h | 1 + migration/ram.c | 6 ++ 3 files changed, 23

[PATCH 2/8] migration: should_skip() implemented

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin For next changes it is convenient to make all decisions about sections skipping in one function. Signed-off-by: Nikita Lapshin --- migration/savevm.c | 54 -- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git

[PATCH 4/8] migration: Add dirty-bitmaps part of migration stream

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin This patch enables and disable dirty-bitmaps in migration stream. Signed-off-by: Nikita Lapshin --- migration/migration.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index bbf9b6aad1..ad789915ce

[PATCH 7/8] migration: analyze-migration script changed

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin This script is used for RAM capabilities test. But it cannot work in case of no vm description in migration stream. So new flag is added to allow work this script with ram-only migration stream. Signed-off-by: Nikita Lapshin --- scripts/analyze-migration.py | 19

[PATCH 3/8] migration: Add vmstate part of migration stream

2022-06-16 Thread nikita . lapshin
From: Nikita Lapshin Now we can disable and enable vmstate part by stream_content parameter. Signed-off-by: Nikita Lapshin --- migration/migration.c | 10 -- migration/savevm.c| 15 +++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/migration

Re: [PATCH v1 7/8] migration: analyze-migration script changed

2022-03-23 Thread Nikita Lapshin
On 3/23/22 16:57, Vladimir Sementsov-Ogievskiy wrote: 23.03.2022 13:53, Nikita Lapshin wrote: From: Nikita Lapshin This script is used for RAM capabilities test. But it cannot work in case of no vm description in migration stream. So new flag is added to allow work this script with ram-only

[PATCH 6/6] migration: Test for ram capabilities

2021-12-24 Thread Nikita Lapshin
Use scripts/analyze-migration.py to split migration stream into sections and analyze its output. Signed-off-by: Nikita Lapshin --- .../tests/migrate-ram-capabilities-test | 96 +++ .../tests/migrate-ram-capabilities-test.out | 5 + 2 files changed, 101 insertions

[PATCH 4/6] migration: Add ram-only capability

2021-12-24 Thread Nikita Lapshin
If this capability is enabled migration stream will have RAM section only. Signed-off-by: Nikita Lapshin --- migration/migration.c | 20 +++- migration/migration.h | 1 + migration/savevm.c| 11 ++- qapi/migration.json | 7 +-- 4 files changed, 35 insertions

[PATCH 5/6] migration: analyze-migration script changed

2021-12-24 Thread Nikita Lapshin
This script is used for RAM capabilities test. But it cannot work in case of no vm description in migration stream. So new flag is added to allow work this script with ram-only migration stream. Signed-off-by: Nikita Lapshin --- scripts/analyze-migration.py | 19 --- 1 file

[PATCH 1/6] migration: is_ram changed to is_iterable

2021-12-24 Thread Nikita Lapshin
For new migration capabilities upcoming we need to use something like is_ram for this purpose. This member of struction is true not only for RAM so it should be renamed. Signed-off-by: Nikita Lapshin --- migration/savevm.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff

[PATCH 3/6] migration: Add no-ram capability

2021-12-24 Thread Nikita Lapshin
This capability disable RAM section in migration stream. Signed-off-by: Nikita Lapshin --- migration/migration.c | 9 + migration/migration.h | 1 + migration/ram.c | 6 ++ qapi/migration.json | 8 +--- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git

[PATCH 2/6] migration: should_skip() implemented

2021-12-24 Thread Nikita Lapshin
For next changes it is convenient to make all decisions about sections skipping in one function. Signed-off-by: Nikita Lapshin --- migration/savevm.c | 42 -- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/migration/savevm.c b/migration

[PATCH 0/6] migration: Add 'no-ram' and 'ram-only' cpabilities

2021-12-24 Thread Nikita Lapshin
allow to send only RAM part or non-RAM part so tool can save non-RAM part without special handlers. RAM will be saved with special handlers for postcopy load. Nikita Lapshin (6): migration: is_ram changed to is_iterable migration: should_skip() implemented migration: Add no-ram capability