[PATCH 13/16] news: qemu: Add support for NFS disk protocol

2022-05-10 Thread Han Han
Signed-off-by: Han Han --- NEWS.rst | 4 1 file changed, 4 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index f27e8bb22d..34934b42f3 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -1020,6 +1020,10 @@ v7.0.0 (2021-01-15) The cpu model Snowridge is supported since QEMU 4.1. + * qemu:

[PATCH 03/16] news: cpu_map: Add EPYC-Rome cpu model

2022-05-10 Thread Han Han
Signed-off-by: Han Han --- NEWS.rst | 4 1 file changed, 4 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 68e89e0fc8..115114789d 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -1192,6 +1192,10 @@ v6.9.0 (2020-11-02) using . The node device APIs also now list and provide XML

[PATCH 00/16] New update from 6.9 to 7.8

2022-05-10 Thread Han Han
Han Han (16): news: make SEV attrs 'cbitpos' & 'reducedPhysBits' optional news: support device stats collection for SR-IOV VF hostdev news: cpu_map: Add EPYC-Rome cpu model news: cpu: Support for XML validation in cpu comparison news: logging: allow max_len=0 to disable log rollover

[PATCH 01/16] news: make SEV attrs 'cbitpos' & 'reducedPhysBits' optional

2022-05-10 Thread Han Han
Signed-off-by: Han Han --- NEWS.rst | 7 +++ 1 file changed, 7 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 7903449f9b..b17d6f58ec 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -1192,6 +1192,13 @@ v6.9.0 (2020-11-02) using . The node device APIs also now list and provide XML

[PATCH 11/16] news: qemu: support kvm-poll-control performance hint

2022-05-10 Thread Han Han
Signed-off-by: Han Han --- NEWS.rst | 5 + 1 file changed, 5 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 3a19ac1d43..008601c0f5 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -1137,6 +1137,11 @@ v6.10.0 (2020-12-01) mode of files and directories, respectively, when using

[PATCH 10/16] news: Introduce "migrate_tls_force" to qemu.conf

2022-05-10 Thread Han Han
Signed-off-by: Han Han --- NEWS.rst | 6 ++ 1 file changed, 6 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 92cb7ea1de..3a19ac1d43 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -1106,6 +1106,12 @@ v6.10.0 (2020-12-01) option is missing are now '1'. This ensures that only legitimate

[PATCH 14/16] news: Support vhostuser in virsh attach-interface since v7.7.0

2022-05-10 Thread Han Han
Signed-off-by: Han Han --- NEWS.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 34934b42f3..aa0eaa7d9a 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -541,6 +541,8 @@ v7.7.0 (2021-09-01) forbidden for older qemus which don't support the update API as the guest

[PATCH 15/16] news: Add queue_size option to virtio disk

2022-05-10 Thread Han Han
Signed-off-by: Han Han --- NEWS.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index aa0eaa7d9a..f8c4b5d3f8 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -470,6 +470,9 @@ v7.8.0 (2021-10-01) active. This information can also be retrieved with the new virsh command

[PATCH 16/16] news: Validation flags for creating net, nwfilter-binding, net port

2022-05-10 Thread Han Han
Signed-off-by: Han Han --- NEWS.rst | 12 1 file changed, 12 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index f8c4b5d3f8..5bc1eda149 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -474,6 +474,18 @@ v7.8.0 (2021-10-01) Implement the queue-size from QEMU to adjust the virtio disk

[PATCH 12/16] news: cpu_map: Add Snowridge cpu model

2022-05-10 Thread Han Han
Signed-off-by: Han Han --- NEWS.rst | 4 1 file changed, 4 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 008601c0f5..f27e8bb22d 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -1016,6 +1016,10 @@ v7.0.0 (2021-01-15) powered off or undefined. Add per-TPM emulator option

[PATCH 09/16] news: qemu: Add 'fmode' and 'dmode' options for 9pfs

2022-05-10 Thread Han Han
Signed-off-by: Han Han --- NEWS.rst | 7 +++ 1 file changed, 7 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 879e2d5f61..92cb7ea1de 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -1124,6 +1124,13 @@ v6.10.0 (2020-12-01) ``virDomainSetVcpus()``, and ``virDomainSetVcpusFlags()`` APIs

[PATCH 08/16] news: qemu: virtiofs can be used without NUMA nodes

2022-05-10 Thread Han Han
Signed-off-by: Han Han --- NEWS.rst | 5 + 1 file changed, 5 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index e00e4e173d..879e2d5f61 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -1233,6 +1233,11 @@ v6.9.0 (2020-11-02) avoid needless cost of host CPU cycles and improve the performance of

[PATCH 07/16] news: qemu: Introduce virtio free page reporting feature

2022-05-10 Thread Han Han
Signed-off-by: Han Han --- NEWS.rst | 7 +++ 1 file changed, 7 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index a474a25cba..e00e4e173d 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -1204,6 +1204,13 @@ v6.9.0 (2020-11-02) virsh, use the option ``--validate`` for sub-commmand

[PATCH 06/16] news: qemu: Set noqueue qdisc for TAP devices

2022-05-10 Thread Han Han
Signed-off-by: Han Han --- NEWS.rst | 6 ++ 1 file changed, 6 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 9be6888277..a474a25cba 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -1220,6 +1220,12 @@ v6.9.0 (2020-11-02) Set ``max_len=0`` in ``virtlogd.conf`` to disable log rollover.

[PATCH 05/16] news: logging: allow max_len=0 to disable log rollover

2022-05-10 Thread Han Han
Signed-off-by: Han Han --- NEWS.rst | 4 1 file changed, 4 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 1d6447a324..9be6888277 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -1216,6 +1216,10 @@ v6.9.0 (2020-11-02) For SR-IOV VF hostdev, now libvirt supports to retrieve device traffic

[PATCH 04/16] news: cpu: Support for XML validation in cpu comparison

2022-05-10 Thread Han Han
Signed-off-by: Han Han --- NEWS.rst | 8 1 file changed, 8 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 115114789d..1d6447a324 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -1196,6 +1196,14 @@ v6.9.0 (2020-11-02) The EPYC-Rome is supported in QEMU since ``v5.0.0``. + * cpu:

[PATCH 02/16] news: support device stats collection for SR-IOV VF hostdev

2022-05-10 Thread Han Han
Signed-off-by: Han Han --- NEWS.rst | 5 + 1 file changed, 5 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index b17d6f58ec..68e89e0fc8 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -1199,6 +1199,11 @@ v6.9.0 (2020-11-02) Libvirt probes the underlying platform in order to fill in these SEV

Re: [libvirt RFCv8 00/27] multifd save restore prototype

2022-05-10 Thread Daniel P . Berrangé
On Sat, May 07, 2022 at 03:42:53PM +0200, Claudio Fontana wrote: > 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

[libvirt PATCH v3 2/6] conf: switch to virXMLProp* functions

2022-05-10 Thread Jonathon Jongsma
In virDomainVideoModelDefParseXML(), use the virXMLProp* functions rather than reimplementing them with virXPath* functions. Signed-off-by: Jonathon Jongsma --- src/conf/domain_conf.c | 78 +- 1 file changed, 23 insertions(+), 55 deletions(-) diff --git

[libvirt PATCH v3 6/6] qemu: Implement 'blob' support for virtio gpu

2022-05-10 Thread Jonathon Jongsma
This can improve performance for some guests since it reduces copying of display data between host and guest. Requires udmabuf on the host. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_cgroup.c| 22 ++ src/qemu/qemu_command.c | 3 ++

[libvirt PATCH v3 4/6] conf: add support for 'blob' in virtio video device

2022-05-10 Thread Jonathon Jongsma
Add the ability to enable blob resources for the virtio video device. This will accelerate the display path due to less or no copying of pixel data. Blob resource support can be enabled with e.g.: Some additional background information about blob resources:

[libvirt PATCH v3 3/6] conf: use enum variable for video type

2022-05-10 Thread Jonathon Jongsma
Rather than storing the video type as an integer, use the proper enum type within the struct. Signed-off-by: Jonathon Jongsma --- src/conf/domain_conf.c | 4 +--- src/conf/domain_conf.h | 2 +- src/libxl/libxl_conf.c | 10 ++ src/libxl/libxl_domain.c | 11

[libvirt PATCH v3 0/6] Add support for 'blob' to virtio video device

2022-05-10 Thread Jonathon Jongsma
Add support to libvirt for the 'blob' option for virtio video devices in qemu. Also do a little preparatory refactoring of the video device xml parsing code. I sent this series out a couple months ago but didn't get any review. Sending out again after rebasing to current master branch. changes

[libvirt PATCH v3 5/6] qemu: Add capability for virtio-gpu.blob

2022-05-10 Thread Jonathon Jongsma
Capability to determine whether this qemu supports the 'blob' option for virtio-gpu. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml | 1 +

[libvirt PATCH v3 1/6] conf: Refactor video model parsing

2022-05-10 Thread Jonathon Jongsma
Factor out a separate function to parse out the element for video devices. Signed-off-by: Jonathon Jongsma --- src/conf/domain_conf.c | 95 ++ 1 file changed, 59 insertions(+), 36 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c

[libvirt PATCH 68/80] qemu: Implement VIR_MIGRATE_POSTCOPY_RESUME for Prepare phase

2022-05-10 Thread Jiri Denemark
The QEMU process is already running, all we need to do is to call migrate-recover QMP command. Except for some checks and cookie handling, of course. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 99 +++ 1 file changed, 99 insertions(+) diff

[libvirt PATCH 72/80] qemu: Call qemuDomainCleanupAdd from qemuMigrationJobContinue

2022-05-10 Thread Jiri Denemark
Every single call to qemuMigrationJobContinue needs to register a cleanup callback in case the migrating domain dies between phases or when migration is paused due to a failure in postcopy mode. Let's integrate registering the callback in qemuMigrationJobContinue to make sure the current thread

[libvirt PATCH 52/80] virsh: Add --postcopy-resume option for migrate command

2022-05-10 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- docs/manpages/virsh.rst | 9 +++-- tools/virsh-domain.c| 8 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index e73e590754..e36d64c164 100644 --- a/docs/manpages/virsh.rst +++

[libvirt PATCH 75/80] Add virDomainAbortJobFlags public API

2022-05-10 Thread Jiri Denemark
The original virDomainAbortJob did not support flags. Signed-off-by: Jiri Denemark --- include/libvirt/libvirt-domain.h | 3 +++ src/driver-hypervisor.h | 5 src/libvirt-domain.c | 45 src/libvirt_public.syms | 1 +

[libvirt PATCH 56/80] qemu: Separate starting migration from qemuMigrationSrcRun

2022-05-10 Thread Jiri Denemark
qemuMigrationSrcRun does a lot of thing before and after telling QEMU to start the migration. Let's make the core reusable by moving it to a new qemuMigrationSrcStart function. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 118 +++--- 1 file

[libvirt PATCH 41/80] qemu: Ignore missing memory statistics in query-migrate

2022-05-10 Thread Jiri Denemark
We want to use query-migrate QMP command to check the current migration state when reconnecting to active domains, but the reply we get to this command may not contain any statistics at all if called on the destination host. Signed-off-by: Jiri Denemark --- src/qemu/qemu_monitor_json.c | 88

[libvirt PATCH 69/80] qemu: Implement VIR_MIGRATE_POSTCOPY_RESUME for Finish phase

2022-05-10 Thread Jiri Denemark
Everything was already done in the normal Finish phase and vCPUs are running. We just need to wait for all remaining data to be transferred. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 46 ++- 1 file changed, 40 insertions(+), 6 deletions(-)

[libvirt PATCH 70/80] qemu: Create completed jobData in qemuMigrationSrcComplete

2022-05-10 Thread Jiri Denemark
Normally the structure is created once the source reports completed migration, but with post-copy migration we can get here even after libvirt daemon was restarted. It doesn't make sense to preserve the structure in our status XML as we're going to rewrite almost all of it while refreshing the

[libvirt PATCH 67/80] qemu: Start a migration phase in qemuMigrationAnyConnectionClosed

2022-05-10 Thread Jiri Denemark
Non-postcopy case talks to QEMU monitor and thus needs to create a nested job. Since qemuMigrationAnyConnectionClosed is called in case there's no thread processing a migration API, we need to make the current thread a temporary owner of the migration job to avoid "This thread doesn't seem to be

[libvirt PATCH 77/80] Add VIR_DOMAIN_ABORT_JOB_POSTCOPY flag for virDomainAbortJobFlags

2022-05-10 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- include/libvirt/libvirt-domain.h | 16 src/libvirt-domain.c | 10 ++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index

[libvirt PATCH 74/80] qemu: Enable support for VIR_MIGRATE_POSTCOPY_RESUME

2022-05-10 Thread Jiri Denemark
Since all parts of post-copy recovery have been implemented now, it's time to enable the corresponding flag. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h index

[libvirt PATCH 73/80] qemu: Implement VIR_MIGRATE_POSTCOPY_RESUME for peer-to-peer migration

2022-05-10 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 53 ++- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index d7e8b9d1e4..24aa831c45 100644 --- a/src/qemu/qemu_migration.c +++

[libvirt PATCH 80/80] NEWS: Add support for post-copy recovery

2022-05-10 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- NEWS.rst | 5 + 1 file changed, 5 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 7903449f9b..bafc70ba90 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -17,6 +17,11 @@ v8.4.0 (unreleased) * **New features** + * qemu: Add support for post-copy recovery +

[libvirt PATCH 62/80] qemu: Simplify cleanup in qemuMigrationDstPrepareFresh

2022-05-10 Thread Jiri Denemark
Since most of the cleanup code was moved out of this function, we don't need to preserve the original error here. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/qemu/qemu_migration.c

[libvirt PATCH 61/80] qemu: Refactor qemuMigrationDstPrepareFresh

2022-05-10 Thread Jiri Denemark
Offline migration jumps over a big part of qemuMigrationDstPrepareFresh. Let's move that part into a new qemuMigrationDstPrepareActive function to make the code easier to follow. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 374 +- 1 file

[libvirt PATCH 71/80] qemu: Register qemuProcessCleanupMigrationJob after Begin phase

2022-05-10 Thread Jiri Denemark
The callback will properly cleanup non-p2p migration job in case the migrating domain dies between Begin and Perform while the client which controls the migration is not cooperating (normally the API for the next migration phase would handle this). The same situation can happen even after Prepare

[libvirt PATCH 12/80] qemu: Rename qemuDomainObjRestoreJob as qemuDomainObjPreserveJob

2022-05-10 Thread Jiri Denemark
It is used for saving job out of domain object. Just like virErrorPreserveLast is used for errors. Let's make the naming consistent as Restore would suggest different semantics. Signed-off-by: Jiri Denemark --- src/qemu/qemu_domainjob.c | 14 -- src/qemu/qemu_domainjob.h | 4 ++--

[libvirt PATCH 64/80] qemu: Rename qemuMigrationSrcCleanup

2022-05-10 Thread Jiri Denemark
The function is now called qemuMigrationAnyConnectionClosed to make it clear it is supposed to handle broken connection during migration. It will soon be used on both sides of migration so the "Src" part was changed to "Any" to avoid renaming the function twice in a row. The original *Cleanup

[libvirt PATCH 57/80] qemu: Add support for 'resume' parameter of migrate QMP command

2022-05-10 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c| 8 ++-- src/qemu/qemu_monitor.h | 1 + src/qemu/qemu_monitor_json.c | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index e1c67c51ec..30c8dbd954

[PATCH 36/37] qemuMonitorAddNetdev: Remove unneeded 'slirp' variables and useless debug

2022-05-10 Thread Peter Krempa
None of the callers now uses the slirp fd passing feature, so it can be removed. At this point even the VIR_DEBUG doesn't make sense as it would only log the pointer of 'props'. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 6 ++ src/qemu/qemu_monitor.c | 23

[PATCH 33/37] qemu: slirp: Call qemuSlirpOpen directly from qemuSlirpStart

2022-05-10 Thread Peter Krempa
No need to ask the callers to call this extra function. Signed-off-by: Peter Krempa --- src/qemu/qemu_extdevice.c | 9 - src/qemu/qemu_hotplug.c | 3 +-- src/qemu/qemu_slirp.c | 5 - src/qemu/qemu_slirp.h | 4 4 files changed, 5 insertions(+), 16 deletions(-) diff

[PATCH 28/37] qemuDomainAttachNetDevice: Remove unused 'tapfd' infrastructure

2022-05-10 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 29 ++--- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 9c6f9e673c..c3891ddca7 100644 --- a/src/qemu/qemu_hotplug.c +++

[PATCH 23/37] qemuBuildInterfaceCommandLine: Remove 'vhostfd' machinery

2022-05-10 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 20 +--- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 0b527784c5..d30c0de748 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@

[libvirt PATCH 39/80] qemu: Pass qemuDomainJobObj to qemuMigrationDstComplete

2022-05-10 Thread Jiri Denemark
When reconnecting to an active domains we need to use a different job structure than the one referenced from the VM object. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 11 ++- src/qemu/qemu_migration.h | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff

[libvirt PATCH 01/80] qemu: Add debug messages to job recovery code

2022-05-10 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/qemu/qemu_process.c | 13 + 1 file changed, 13 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index b0b00eb0a2..1925559fad 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3445,6 +3445,9 @@

[libvirt PATCH 65/80] qemu: Refactor qemuMigrationAnyConnectionClosed

2022-05-10 Thread Jiri Denemark
To prepare the code for handling incoming migration too. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 72 +-- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index

[libvirt PATCH 49/80] qemu: Do not set job owner in qemuMigrationJobSetPhase

2022-05-10 Thread Jiri Denemark
Both qemuMigrationJobSetPhase and qemuMigrationJobStartPhase were doing the same thing, which made little sense. Let's follow the difference between qemuDomainObjSetJobPhase and qemuDomainObjStartJobPhase and change job owner only in qemuMigrationJobStartPhase. Signed-off-by: Jiri Denemark ---

[libvirt PATCH 51/80] Introduce VIR_MIGRATE_POSTCOPY_RESUME flag

2022-05-10 Thread Jiri Denemark
This flag can be used to restart post-copy migration once it failed because of a broken connection. Signed-off-by: Jiri Denemark --- include/libvirt/libvirt-domain.h | 5 + src/libvirt-domain.c | 6 ++ 2 files changed, 11 insertions(+) diff --git

[PATCH 25/37] qemuMonitorAddNetdev: Remove 'vhostfd' machinery

2022-05-10 Thread Peter Krempa
All callers now pass NULL/0 as arguments for vhostfd passing so we can remove all the associated code. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 3 +-- src/qemu/qemu_monitor.c | 14 ++ src/qemu/qemu_monitor.h | 1 - 3 files changed, 3 insertions(+), 15 deletions(-)

[libvirt PATCH 40/80] qemu: Finish completed unattended migration

2022-05-10 Thread Jiri Denemark
So far migration could only be completed while a migration API was running and waiting for the migration to finish. In case such API could not be called (the connection that initiated the migration is broken) the migration would just be aborted or left in a "don't know what to do" state. But this

[PATCH 34/37] qemu: slirp: Pass FDs to qemu via qemuFDPass in the network private data

2022-05-10 Thread Peter Krempa
Populate the 'slirpfd' qemuFDPass structure inside the private data for passing the fd to qemu rather than using out-of-band variables. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 27 +-- src/qemu/qemu_command.h | 3 +-- src/qemu/qemu_hotplug.c | 9

[PATCH 29/37] qemuBuildNicDevProps: Remove unused 'tapfd' infrastructure

2022-05-10 Thread Peter Krempa
All callers pass NULL/0. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 9 - src/qemu/qemu_command.h | 2 -- src/qemu/qemu_hotplug.c | 1 - 3 files changed, 12 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a3b4b8c412..92b91b0a52 100644 ---

[libvirt PATCH 34/80] qemu: Separate cookie parsing for qemuMigrationDstFinishOffline

2022-05-10 Thread Jiri Denemark
To keep all cookie handling (parsing and formatting) in the same function. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index

[libvirt PATCH 19/80] qemu: Don't wait for migration job when migration is running

2022-05-10 Thread Jiri Denemark
Migration is a job which takes some time and if it succeeds, there's nothing to call another migration on. If a migration fails, it might make sense to rerun it with different arguments, but this would only be done once the first migration fails rather than while it is still running. If this was

[libvirt PATCH 46/80] qemu: Separate protocol checks from qemuMigrationJobSetPhase

2022-05-10 Thread Jiri Denemark
Into a new qemuMigrationCheckPhase helper, which can be reused in other places. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index

[PATCH 37/37] qemu: slirp: Remove unused 'qemuSlirpGetFD'

2022-05-10 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_slirp.c | 9 - src/qemu/qemu_slirp.h | 2 -- 2 files changed, 11 deletions(-) diff --git a/src/qemu/qemu_slirp.c b/src/qemu/qemu_slirp.c index b62934f292..618947b6c1 100644 --- a/src/qemu/qemu_slirp.c +++ b/src/qemu/qemu_slirp.c @@ -188,15

[PATCH 32/37] qemuSlirpStart: Simplify parameters

2022-05-10 Thread Peter Krempa
The 'driver' can be taken from the private data of 'vm' and 'slirp' can be taken from private data of 'net', both of which we need anyways. Additionally by checking whether slirp needs to be started inside the function we don't need to do this logic in the callers. Signed-off-by: Peter Krempa

[libvirt PATCH 16/80] qemu: Restore failed migration job on reconnect

2022-05-10 Thread Jiri Denemark
Since we keep the migration job active when post-copy migration fails, we need to restore it when reconnecting to running domains. Signed-off-by: Jiri Denemark --- src/qemu/qemu_process.c | 128 ++-- 1 file changed, 96 insertions(+), 32 deletions(-) diff

[libvirt PATCH 29/80] qemu: Make final part of migration Finish phase reusable

2022-05-10 Thread Jiri Denemark
By separating it into a dedicated qemuMigrationDstComplete function which can be later called in other places. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 99 ++- src/qemu/qemu_migration.h | 6 +++ 2 files changed, 63 insertions(+), 42

[PATCH 24/37] qemuBuildHostNetProps: Remove 'vhostfd' machinery

2022-05-10 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 11 --- src/qemu/qemu_command.h | 2 -- src/qemu/qemu_hotplug.c | 1 - 3 files changed, 14 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d30c0de748..d23baa54a2 100644 ---

[PATCH 35/37] qemuDomainAttachNetDevice: Clean up unneeded 'slirp' helper variables

2022-05-10 Thread Peter Krempa
We don't need 'slirpfdName' and 'slirpfd'. The 'slirp' local can be removed too as qemuSlirpStart is safe to be called if there's nothing to do. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git

[PATCH 30/37] qemuMonitorAddNetdev: Remove unused 'tapfd' infrastructure

2022-05-10 Thread Peter Krempa
All callers pass NULL/0. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 3 +-- src/qemu/qemu_monitor.c | 15 ++- src/qemu/qemu_monitor.h | 1 - 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index

[PATCH 31/37] qemuInterfacePrepareSlirp: Directly populate the 'slirp' variable in network private data

2022-05-10 Thread Peter Krempa
Both callers populate the variable when qemuInterfacePrepareSlirp returned 1. We can save the hassle in the callers by just doing it right away. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 8 +++- src/qemu/qemu_interface.c | 10 +- src/qemu/qemu_interface.h | 3 +--

[PATCH 26/37] qemu: Move opening of tap file descriptors for net devices into qemuBuildInterfaceConnect

2022-05-10 Thread Peter Krempa
Use the new infrastructure which stores the fds inside 'qemuFDPass' objects in the private data. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 82 - src/qemu/qemu_command.h | 1 + src/qemu/qemu_hotplug.c | 36 ++ 3 files

[PATCH 27/37] qemuBuildInterfaceCommandLine: Remove 'tapfd' infrastructure

2022-05-10 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 25 + 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 78baa840a8..a3b4b8c412 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c

[PATCH 22/37] qemuDomainAttachNetDevice: Remove 'vhostfd' machinery

2022-05-10 Thread Peter Krempa
Now all the helper variables and code are not needed. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 16 1 file changed, 16 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 2bede03e35..68e8030929 100644 --- a/src/qemu/qemu_hotplug.c

[PATCH 21/37] qemu: Move opening of vhost file descriptors for net devices into qemuBuildInterfaceConnect

2022-05-10 Thread Peter Krempa
Use the new infrastructure which stores the fds inside 'qemuFDPass' objects in the private data. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 31 +++-- src/qemu/qemu_hotplug.c | 28 ++- src/qemu/qemu_interface.c | 58

[PATCH 20/37] qemuInterfaceOpenVhostNet: Reformat error messages per new guidelines

2022-05-10 Thread Peter Krempa
Remove the linebreaks inside of error messages. Signed-off-by: Peter Krempa --- src/qemu/qemu_interface.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c index e5f4710988..e6a26e377f 100644 ---

[libvirt PATCH 53/80] qemu: Don't set VIR_MIGRATE_PAUSED for post-copy resume

2022-05-10 Thread Jiri Denemark
For historical reasons we automatically enabled VIR_MIGRATE_PAUSED flag when a migration was started for a paused domain. However, when resuming failed post-copy migration the domain on the source host will always be paused (as it is already running on the destination host). We must avoid enabling

[libvirt PATCH 23/80] qemu: Add support for postcopy-recover QEMU migration state

2022-05-10 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c| 1 + src/qemu/qemu_monitor.c | 2 +- src/qemu/qemu_monitor.h | 1 + src/qemu/qemu_monitor_json.c | 1 + src/qemu/qemu_process.c | 31 ++- 5 files changed, 34 insertions(+), 2

[libvirt PATCH 47/80] qemu: Make qemuMigrationCheckPhase failure fatal

2022-05-10 Thread Jiri Denemark
The check can reveal a serious bug in our migration code and we should not silently ignore it. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 58 --- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/src/qemu/qemu_migration.c

[libvirt PATCH 30/80] qemu: Drop obsolete comment in qemuMigrationDstFinish

2022-05-10 Thread Jiri Denemark
The comment about QEMU < 0.10.6 has been irrelevant for years. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 4 1 file changed, 4 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index a3d55c8e8b..a6c8e53ac5 100644 ---

[libvirt PATCH 76/80] qemu: Implement virDomainAbortJobFlags

2022-05-10 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/qemu/qemu_driver.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e268d3a478..efa6cbe14d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -12770,7

[libvirt PATCH 15/80] qemu: Abort failed post-copy when we haven't called Finish yet

2022-05-10 Thread Jiri Denemark
When migration fails after it already switched to post-copy phase on the source, but early enough that we haven't called Finish on the destination yet, we know the vCPUs were not started on the destination and the source host still has a complete state of the domain. Thus we can just ignore the

[libvirt PATCH 45/80] qemu: Add new migration phases for post-copy recovery

2022-05-10 Thread Jiri Denemark
When recovering from a failed post-copy migration, we need to go through all migration phases again, but don't need to repeat all the steps in each phase. Let's create a new set of migration phases dedicated to post-copy recovery so that we can easily distinguish between normal and recovery code.

[libvirt PATCH 37/80] qemu: Make final part of migration Confirm phase reusable

2022-05-10 Thread Jiri Denemark
By separating it into a dedicated qemuMigrationSrcComplete function which can be later called in other places. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 70 --- src/qemu/qemu_migration.h | 5 +++ 2 files changed, 48 insertions(+), 27

[libvirt PATCH 44/80] qemu: Introduce qemuMigrationSrcBeginXML helper

2022-05-10 Thread Jiri Denemark
Turn the final part of Begin phase formatting a domain XML for migration into a reusable helper. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 95 --- 1 file changed, 58 insertions(+), 37 deletions(-) diff --git a/src/qemu/qemu_migration.c

[libvirt PATCH 18/80] qemu: Drop forward declarations in migration code

2022-05-10 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 176 -- 1 file changed, 76 insertions(+), 100 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index e892a09885..63ebc15f65 100644 --- a/src/qemu/qemu_migration.c +++

[PATCH 19/37] qemuBuildNicDevProps: Don't pass 'vhostfdSize'

2022-05-10 Thread Peter Krempa
All callers effectively pass 'net->driver.virtio.queues'. In case of the code in 'qemu_hotplug.c' this value was set to '1' if it was 0 before. Since 'qemuBuildNicDevProps' only uses it if it's greater than 1 we can remove all the extra complexity. Signed-off-by: Peter Krempa ---

[libvirt PATCH 79/80] virsh: Add --postcopy option for domjobabort command

2022-05-10 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- docs/manpages/virsh.rst | 8 +++- tools/virsh-domain.c| 16 +++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index e36d64c164..1bb9044e0a 100644 ---

[libvirt PATCH 31/80] qemu: Preserve error in qemuMigrationDstFinish

2022-05-10 Thread Jiri Denemark
We want to prevent our error path that can potentially kill the domain on the destination host from overwriting an error reported earlier, but we were only doing so in one specific path when starting vCPUs fails. Let's do it in all paths. Signed-off-by: Jiri Denemark ---

[libvirt PATCH 33/80] qemu: Introduce qemuMigrationDstFinishOffline

2022-05-10 Thread Jiri Denemark
Refactors qemuMigrationDstFinish by moving some parts to a dedicated function for easier introduction of postcopy resume code without duplicating common parts of the Finish phase. The goal is to have the following call graph: - qemuMigrationDstFinish - qemuMigrationDstFinishOffline

[libvirt PATCH 26/80] qemu: Separate success and failure path in qemuMigrationDstFinish

2022-05-10 Thread Jiri Denemark
Most of the code in "endjob" label is executed only on failure. Let's duplicate the rest so that the label can be used only in error path making the success path easier to follow and refactor. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 45

[libvirt PATCH 60/80] qemu: Introduce qemuMigrationDstPrepareFresh

2022-05-10 Thread Jiri Denemark
Moves most of the code from qemuMigrationDstPrepareAny to a new qemuMigrationDstPrepareFresh so that qemuMigrationDstPrepareAny can be shared with post-copy resume. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 165 -- 1 file changed, 103

[libvirt PATCH 00/80] Add support for post-copy recovery

2022-05-10 Thread Jiri Denemark
This series implements a new VIR_MIGRATE_POSTCOPY_RESUME flag (virsh migrate --resume) for recovering from a failed post-copy migration. You can also fetch the series from my gitlab fork: git fetch https://gitlab.com/jirkade/libvirt.git post-copy-recovery Jiri Denemark (80): qemu: Add

[libvirt PATCH 66/80] qemu: Handle incoming migration in qemuMigrationAnyConnectionClosed

2022-05-10 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index c0ab59f688..c1a60c90ef 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@

[libvirt PATCH 78/80] qemu: Implement VIR_DOMAIN_ABORT_JOB_POSTCOPY flag

2022-05-10 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/qemu/qemu_driver.c | 43 +--- src/qemu/qemu_monitor.c | 9 src/qemu/qemu_monitor.h | 3 +++ src/qemu/qemu_monitor_json.c | 22 ++ src/qemu/qemu_monitor_json.h | 3 +++ 5 files

[libvirt PATCH 27/80] qemu: Rename "endjob" label in qemuMigrationDstFinish

2022-05-10 Thread Jiri Denemark
Let's call it "error" so that it's clear the label is only used in failure path. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c

[libvirt PATCH 59/80] qemu: Implement VIR_MIGRATE_POSTCOPY_RESUME for Confirm phase

2022-05-10 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 49 +-- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 29be797d78..8ed1c2c2b6 100644 --- a/src/qemu/qemu_migration.c +++

[libvirt PATCH 25/80] qemu: Move success-only code out of endjob in qemuMigrationDstFinish

2022-05-10 Thread Jiri Denemark
Code executed only when dom != NULL can be moved before "endjob" label, to the only place where dom is set. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 50 ++- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git

[libvirt PATCH 03/80] qemu: Return state from qemuMonitorGetMigrationCapabilities

2022-05-10 Thread Jiri Denemark
The function can now optionally return a bitmap describing the current state of each migration capability. Signed-off-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 2 +- src/qemu/qemu_migration_params.c | 2 +- src/qemu/qemu_monitor.c | 5 +++-- src/qemu/qemu_monitor.h

[libvirt PATCH 48/80] qemu: Refactor qemuDomainObjSetJobPhase

2022-05-10 Thread Jiri Denemark
We will want to update migration phase without affecting job ownership. Either in the thread that already owns the job or from an event handler which only changes the phase (of a job no-one owns) without assuming it. Let's move the ownership change to a new qemuDomainObjStartJobPhase helper and

[libvirt PATCH 54/80] qemu: Implement VIR_MIGRATE_POSTCOPY_RESUME for Begin phase

2022-05-10 Thread Jiri Denemark
Mostly we just need to check whether the domain is in a failed post-copy migration that can be resumed. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 143 ++ 1 file changed, 143 insertions(+) diff --git a/src/qemu/qemu_migration.c

[libvirt PATCH 63/80] qemu: Add support for migrate-recover QMP command

2022-05-10 Thread Jiri Denemark
This command tells QEMU to start listening for an incoming post-copy recovery connection. Just like migrate-incoming is used for starting fresh migration on the destination host. Signed-off-by: Jiri Denemark --- src/qemu/qemu_monitor.c | 12 src/qemu/qemu_monitor.h | 4

[libvirt PATCH 43/80] qemu: Check flags incompatible with offline migration earlier

2022-05-10 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 44 +++ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 854dfd43c1..180a760bca 100644 --- a/src/qemu/qemu_migration.c +++

  1   2   >