This is the multifd save prototype in semi-functional state,
with both save and restore minimally functional.
There are still quite a few rough edges.
KNOWN ISSUES:
1) this applies only to virsh save and virsh restore for now
(no managed save etc).
2) the .pl scripts to generate the headers for the new APIs
do not reliably work for me, for the Restore case. I get:
src/remote/remote_daemon_dispatch_stubs.h:10080:9:
error: too few arguments to function ‘virDomainRestoreParametersFlags’
if (virDomainRestoreParametersFlags(params, nparams, args->flags) < 0)
To work around this I had to fixup the header manually to add the
conn parameter like this:
...(conn, params, nparams, args->flags) < 0)
3) error handling is not good yet, especially during resume,
errors may leave behind a qemu process and such.
May need some help find all of these cases...
...
changes from v3:
* reordered series to have all helper-related change at the start
* solved all reported issues from ninja test, including documentation
* fixed most broken migration capabilities code (still imperfect likely)
* added G_GNUC_UNUSED as needed
* after multifd restore, added what I think were the missing operations:
qemuProcessRefreshState(),
qemuProcessStartCPUs() - most importantly,
virDomainObjSave()
The domain now starts running after restore without further encouragement
* removed the sleep(10) from the multifd-helper
changes from v2:
* added ability to restore the VM from disk using multifd
* fixed the multifd-helper to work in both directions,
assuming the need to listen for save, and connect for restore.
* fixed a large number of bugs, and probably introduced some :-)
Thanks for your thoughts,
Claudio
*** BLURB HERE ***
Claudio Fontana (20):
iohelper: introduce new struct to carry copy operation parameters
iohelper: refactor copy operation as a separate function
iohelper: move runIO function to a separate module
runio: add arguments to extend use beyond just stdin and stdout
multifd-helper: new helper for parallel save/restore
libvirt: introduce virDomainSaveParametersFlags public API
libvirt: introduce virDomainRestoreParametersFlags public API
remote: Add RPC support for the virDomainSaveParametersFlags API
remote: Add RPC support for the virDomainRestoreParametersFlags API
qemu: add a stub for virDomainSaveParametersFlags API
qemu: add a stub for virDomainRestoreParametersFlags API
qemu: saveimage: introduce virQEMUSaveFd
qemu: wire up saveimage code with the multifd helper
qemu: capabilities: add multifd to the probed migration capabilities
qemu: implement qemuMigrationSrcToFilesMultiFd
qemu: add parameter to qemuMigrationDstRun to skip waiting
qemu: implement qemuSaveImageLoadMultiFd
tools: add parallel parameter to virsh save command
tools: add parallel parameter to virsh restore command
qemu: add migration parameter multifd-compression
docs/manpages/virsh.rst | 34 +-
include/libvirt/libvirt-domain.h | 49 ++
po/POTFILES.in | 2 +
src/driver-hypervisor.h | 14 +
src/libvirt-domain.c | 99 ++++
src/libvirt_private.syms | 1 +
src/libvirt_public.syms | 6 +
src/qemu/qemu_capabilities.c | 6 +
src/qemu/qemu_capabilities.h | 4 +
src/qemu/qemu_driver.c | 239 +++++++--
src/qemu/qemu_migration.c | 155 ++++--
src/qemu/qemu_migration.h | 16 +-
src/qemu/qemu_migration_params.c | 71 ++-
src/qemu/qemu_migration_params.h | 15 +
src/qemu/qemu_process.c | 3 +-
src/qemu/qemu_process.h | 5 +-
src/qemu/qemu_saveimage.c | 496 ++++++++++++++----
src/qemu/qemu_saveimage.h | 49 +-
src/qemu/qemu_snapshot.c | 6 +-
src/remote/remote_driver.c | 2 +
src/remote/remote_protocol.x | 29 +-
src/remote_protocol-structs | 17 +
src/util/iohelper.c | 150 +-----
src/util/meson.build | 15 +
src/util/multifd-helper.c | 250 +++++++++
src/util/runio.c | 214 ++++++++
src/util/runio.h | 38 ++
src/util/virthread.c | 5 +
src/util/virthread.h | 1 +
.../caps_4.0.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 1 +
.../caps_4.0.0.riscv32.xml | 1 +
.../caps_4.0.0.riscv64.xml | 1 +
.../qemucapabilitiesdata/caps_4.0.0.s390x.xml | 1 +
.../caps_4.0.0.x86_64.xml | 1 +
.../caps_4.1.0.x86_64.xml | 1 +
.../caps_4.2.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_4.2.0.ppc64.xml | 1 +
.../qemucapabilitiesdata/caps_4.2.0.s390x.xml | 1 +
.../caps_4.2.0.x86_64.xml | 1 +
.../caps_5.0.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 2 +
.../caps_5.0.0.riscv64.xml | 2 +
.../caps_5.0.0.x86_64.xml | 2 +
.../qemucapabilitiesdata/caps_5.1.0.sparc.xml | 2 +
.../caps_5.1.0.x86_64.xml | 2 +
.../caps_5.2.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 2 +
.../caps_5.2.0.riscv64.xml | 2 +
.../qemucapabilitiesdata/caps_5.2.0.s390x.xml | 2 +
.../caps_5.2.0.x86_64.xml | 2 +
.../caps_6.0.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_6.0.0.s390x.xml | 2 +
.../caps_6.0.0.x86_64.xml | 2 +
.../caps_6.1.0.x86_64.xml | 2 +
.../caps_6.2.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_6.2.0.ppc64.xml | 2 +
.../caps_6.2.0.x86_64.xml | 2 +
.../caps_7.0.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_7.0.0.ppc64.xml | 2 +
.../caps_7.0.0.x86_64.xml | 2 +
tools/virsh-domain.c | 96 +++-
62 files changed, 1713 insertions(+), 427 deletions(-)
create mode 100644 src/util/multifd-helper.c
create mode 100644 src/util/runio.c
create mode 100644 src/util/runio.h
--
2.34.1