[libvirt RFCv8 17/27] qemu: implement qemuSaveImageLoadMultiFd

2022-05-07 Thread Claudio Fontana
use multifd to restore parallel saves. Signed-off-by: Claudio Fontana --- src/qemu/qemu_driver.c| 10 +++- src/qemu/qemu_migration.c | 2 +- src/qemu/qemu_migration.h | 6 ++ src/qemu/qemu_saveimage.c | 119 +- src/qemu/qemu_saveimage.h | 8 ++- 5 f

[libvirt RFCv8 23/27] qemu: saveimage: add stub support for multifd compression parameter

2022-05-07 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- src/qemu/qemu_driver.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 864825960d..4374728112 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2812,6 +2812,7 @@ qe

[libvirt RFCv8 22/27] qemu: saveimage: add parallel compression argument to ImageCreate

2022-05-07 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- src/qemu/qemu_driver.c| 11 ++- src/qemu/qemu_saveimage.c | 1 + src/qemu/qemu_saveimage.h | 1 + src/qemu/qemu_snapshot.c | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c inde

[libvirt RFCv8 26/27] qemu: saveimage: restore compressed parallel images

2022-05-07 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- src/qemu/qemu_saveimage.c | 17 + 1 file changed, 17 insertions(+) diff --git a/src/qemu/qemu_saveimage.c b/src/qemu/qemu_saveimage.c index df273eba66..eed52140ed 100644 --- a/src/qemu/qemu_saveimage.c +++ b/src/qemu/qemu_saveimage.c @@ -649,6 +

[libvirt RFCv8 25/27] qemu: saveimage: implement multifd-compression in parallel save

2022-05-07 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- src/qemu/qemu_migration.c | 17 + src/qemu/qemu_migration.h | 2 +- src/qemu/qemu_saveimage.c | 19 ++- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index

[libvirt RFCv8 20/27] qemu: add migration parameter multifd-compression

2022-05-07 Thread Claudio Fontana
add it to both capabilities and migration parameters Signed-off-by: Claudio Fontana --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_migration_params.c | 2 ++ src/qemu/qemu_migration_params.h

[libvirt RFCv8 18/27] tools: add parallel parameter to virsh save command

2022-05-07 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- docs/manpages/virsh.rst | 23 +-- tools/virsh-domain.c| 24 ++-- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index e73e590754..e9012b85d1 100644 ---

[libvirt RFCv8 21/27] libvirt: add new VIR_SAVE_PARAM_PARALLEL_COMPRESSION

2022-05-07 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- include/libvirt/libvirt-domain.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index 8bedeaff30..7628968e46 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt

[libvirt RFCv8 27/27] tools: add parallel-compression parameter to virsh save command

2022-05-07 Thread Claudio Fontana
this completes the save side of the parallel compression support. Signed-off-by: Claudio Fontana --- docs/manpages/virsh.rst | 4 tools/virsh-domain.c| 12 2 files changed, 16 insertions(+) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index dee748d870..5

[libvirt RFCv8 19/27] tools: add parallel parameter to virsh restore command

2022-05-07 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- docs/manpages/virsh.rst | 12 ++-- tools/virsh-domain.c| 10 +- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index e9012b85d1..dee748d870 100644 --- a/docs/manpages/virsh.rs

[libvirt RFCv8 24/27] qemu: migration: expose qemuMigrationParamsSetString

2022-05-07 Thread Claudio Fontana
change from static to external linkage, and move the function close to the other similar ones, near qemuMigrationParamsSetULL. Signed-off-by: Claudio Fontana --- src/qemu/qemu_migration_params.c | 47 +++- src/qemu/qemu_migration_params.h | 5 2 files changed, 2

[libvirt RFCv8 14/27] qemu: migration_params: add APIs to set Int and Cap

2022-05-07 Thread Claudio Fontana
similarly to qemuMigrationParamsSetULL, we need to be able to set fields from qemu_saveimage. Signed-off-by: Claudio Fontana --- src/qemu/qemu_migration_params.c | 22 ++ src/qemu/qemu_migration_params.h | 9 + 2 files changed, 31 insertions(+) diff --git a/src/qemu

[libvirt RFCv8 13/27] qemu: saveimage: add multifd related fields to save format

2022-05-07 Thread Claudio Fontana
add both multifd compression and number of multifd channels fields in the same commit, in order to change the format to version 3 in one go. Signed-off-by: Claudio Fontana --- src/qemu/qemu_saveimage.c | 19 ++- src/qemu/qemu_saveimage.h | 8 +--- 2 files changed, 23 inserti

[libvirt RFCv8 10/27] qemu: saveimage: add virQEMUSaveFd APIs for multifd

2022-05-07 Thread Claudio Fontana
add APIs to Create, Close and Free MultiFD files to associate with multifd channels. Signed-off-by: Claudio Fontana --- src/qemu/qemu_saveimage.c | 97 +++ src/qemu/qemu_saveimage.h | 11 + 2 files changed, 108 insertions(+) diff --git a/src/qemu/qemu_sav

[libvirt RFCv8 03/27] tools: prepare cmdRestore to use parameters

2022-05-07 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- tools/virsh-domain.c | 32 ++-- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index a3b0749fa9..2d90fba9b7 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -

[libvirt RFCv8 00/27] multifd save restore prototype

2022-05-07 Thread Claudio Fontana
This is v8 of the multifd save prototype, which fixes a few bugs, adds a few more code splits, and records the number of channels as well as the compression algorithm, so the restore command is more user-friendly. It is now possible to just say: virsh save mydomain /mnt/saves/mysave --parallel v

[libvirt RFCv8 16/27] qemu: add parameter to qemuMigrationDstRun to skip waiting

2022-05-07 Thread Claudio Fontana
The distinction on whether to wait for the migration completion or not was made on the async job type, but with the future addition of multifd migration from files, we need a way to avoid waiting, so we can prepare multifd migration parameters before starting the transfers. Adapt all callers. Si

[libvirt RFCv8 01/27] multifd-helper: new helper for parallel save/restore

2022-05-07 Thread Claudio Fontana
For the save direction, this helper listens on a unix socket which QEMU connects to for multifd migration to files. For the restore direction, this helper connects to a unix socket QEMU listens at for multifd migration from files. The file descriptors are passed as command line parameters. Signe

[libvirt RFCv8 11/27] qemu: saveimage: wire up saveimage code with the multifd helper

2022-05-07 Thread Claudio Fontana
use the multifd helper and the new virQEMUSaveFd APIs for multifd. Signed-off-by: Claudio Fontana --- src/qemu/qemu_saveimage.c | 42 --- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_saveimage.c b/src/qemu/qemu_saveimage.c index

[libvirt RFCv8 15/27] qemu: migration: implement qemuMigrationSrcToFilesMultiFd

2022-05-07 Thread Claudio Fontana
implement a function similar to qemuMigrationSrcToFile that migrates to multiple files using QEMU multifd. Signed-off-by: Claudio Fontana --- src/qemu/qemu_migration.c | 131 +- src/qemu/qemu_migration.h | 7 ++ src/qemu/qemu_saveimage.c | 9 ++- 3 files c

[libvirt RFCv8 04/27] libvirt: add new VIR_DOMAIN_SAVE_PARALLEL flag and parameter

2022-05-07 Thread Claudio Fontana
in order to enable parallel save functionality, we will need an opportune new flag and a parameter to specify the number of extra connections to use. Signed-off-by: Claudio Fontana --- include/libvirt/libvirt-domain.h | 18 ++ 1 file changed, 18 insertions(+) diff --git a/includ

[libvirt RFCv8 12/27] qemu: capabilities: add multifd to the probed migration capabilities

2022-05-07 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- src/qemu/qemu_capabilities.c | 4 src/qemu/qemu_capabilities.h | 3 +++ tests/qemucapabilitiesdata/caps_4.0.0.aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/ca

[libvirt RFCv8 06/27] qemu: add stub support for VIR_DOMAIN_SAVE_PARALLEL in restore

2022-05-07 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- src/qemu/qemu_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 78cc0cef4f..ce399cd197 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5834,7 +5834,8 @@ qemuD

[libvirt RFCv8 08/27] qemu: saveimage: convert qemuSaveImageCreate to use virQEMUSaveFd

2022-05-07 Thread Claudio Fontana
now that we introduced virQEMUSaveFd, use it in the creation of a new save image. Signed-off-by: Claudio Fontana --- src/qemu/qemu_saveimage.c | 54 +++ 1 file changed, 15 insertions(+), 39 deletions(-) diff --git a/src/qemu/qemu_saveimage.c b/src/qemu/qemu_s

[libvirt RFCv8 02/27] tools: prepare doSave to use parameters

2022-05-07 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- tools/virsh-domain.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index ba492e807e..a3b0749fa9 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -4203,6 +42

[libvirt RFCv8 07/27] qemu: saveimage: introduce virQEMUSaveFd

2022-05-07 Thread Claudio Fontana
use this data type to encapsulate the pathname, file descriptor, wrapper, and need to unlink. This will make management of the resources associated with an FD used for QEMU save/restore much easier, reducing the amount of explicit cleanup required. Signed-off-by: Claudio Fontana --- src/qemu/qe

[libvirt RFCv8 09/27] qemu: saveimage: convert qemuSaveImageOpen to use virQEMUSaveFd

2022-05-07 Thread Claudio Fontana
all the logic to open a fd, create a wrapper etc, is boilerplate code that is best reused, so change the Open function to take an existing already initialized virQEMUSaveFd. Adapt all callers of qemuSaveImageOpen. Signed-off-by: Claudio Fontana --- src/qemu/qemu_driver.c| 101 ++

[libvirt RFCv8 05/27] qemu: add stub support for VIR_DOMAIN_SAVE_PARALLEL in save

2022-05-07 Thread Claudio Fontana
and its companion param VIR_SAVE_PARAM_PARALLEL_CONNECTIONS Signed-off-by: Claudio Fontana --- src/qemu/qemu_driver.c| 17 +++-- src/qemu/qemu_saveimage.c | 1 + src/qemu/qemu_saveimage.h | 1 + src/qemu/qemu_snapshot.c | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-

Re: [libvirt RFCv7 22/40] qemu: saveimage: convert qemuSaveImageOpen to use virQEMUSaveFd

2022-05-07 Thread Claudio Fontana
On 5/6/22 3:11 PM, Claudio Fontana wrote: > all the logic to open a fd, create a wrapper etc, is boilerplate > code that is best reused, so change the Open function to take > an existing already initialized virQEMUSaveFd. > > Adapt all callers of qemuSaveImageOpen. > > Signed-off-by: Claudio Font

[PATCH 2/3] domain_conf: introduce virDomainPostParseDataDefEmulator type

2022-05-07 Thread zhangjl02
From: zhangjl02 Add virDomainPostParseDataDefEmulator typedef. Add a definition callback into _virDomainDefParserConfig. Signed-off-by: zhangjl02 --- src/conf/domain_conf.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 88a411d00c..8

[PATCH 1/3] qemu_domain: introduce qemuDomainPostParseDataDefEmulator

2022-05-07 Thread zhangjl02
From: zhangjl02 qemuDomainPostParseDataDefEmulator will try to get default emulator based on guest's arch from capabilities, and replace the emulator in definition. Signed-off-by: zhangjl02 --- src/qemu/qemu_domain.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/src/q

[PATCH 3/3] domain_conf: set default emulator into def if it fails to alloc

2022-05-07 Thread zhangjl02
From: zhangjl02 When emulator is not found on host, domainPostParseDataAlloc will return 1, and the domain will fail to start. Call domainPostParseDataDefEmulator to replace emulator with the default one of guest's arch, and try to alloc again after domainPostParseDataAlloc's failure. This will i

[PATCH 0/3] Add a retry procedure after failing to do post parsing

2022-05-07 Thread zhangjl02
Get default emulator based on guest's arch, and replace it in domain's definition after domainPostParseDataAlloc's failure, then alloc again. This will solve the migration problem because of qemu emulator location error, especially, from host with to host without qemu-kvm. This commit will also all