Re: [libvirt PATCH v2 81/81] RFC: qemu: Keep vCPUs paused while migration is in postcopy-paused

2022-06-06 Thread Daniel P . Berrangé
On Mon, Jun 06, 2022 at 10:32:03AM -0400, Peter Xu wrote: > [copy Dave] > > On Mon, Jun 06, 2022 at 12:29:39PM +0100, Daniel P. Berrangé wrote: > > On Wed, Jun 01, 2022 at 02:50:21PM +0200, Jiri Denemark wrote: > > > QEMU keeps guest CPUs running even in postcopy-paused migration state so > > > th

Re: [libvirt PATCH v2 81/81] RFC: qemu: Keep vCPUs paused while migration is in postcopy-paused

2022-06-06 Thread Peter Xu
[copy Dave, for real] On Mon, Jun 06, 2022 at 10:32:03AM -0400, Peter Xu wrote: > [copy Dave] > > On Mon, Jun 06, 2022 at 12:29:39PM +0100, Daniel P. Berrangé wrote: > > On Wed, Jun 01, 2022 at 02:50:21PM +0200, Jiri Denemark wrote: > > > QEMU keeps guest CPUs running even in postcopy-paused migr

Re: [libvirt PATCH v2 81/81] RFC: qemu: Keep vCPUs paused while migration is in postcopy-paused

2022-06-06 Thread Peter Xu
[copy Dave] On Mon, Jun 06, 2022 at 12:29:39PM +0100, Daniel P. Berrangé wrote: > On Wed, Jun 01, 2022 at 02:50:21PM +0200, Jiri Denemark wrote: > > QEMU keeps guest CPUs running even in postcopy-paused migration state so > > that processes that already have all memory pages they need migrated to

Re: [libvirt PATCH v2 81/81] RFC: qemu: Keep vCPUs paused while migration is in postcopy-paused

2022-06-06 Thread Jiri Denemark
On Mon, Jun 06, 2022 at 15:37:45 +0200, Peter Krempa wrote: > On Wed, Jun 01, 2022 at 14:50:21 +0200, Jiri Denemark wrote: > > QEMU keeps guest CPUs running even in postcopy-paused migration state so > > that processes that already have all memory pages they need migrated to > > the destination can

Re: [libvirt PATCH v2 81/81] RFC: qemu: Keep vCPUs paused while migration is in postcopy-paused

2022-06-06 Thread Peter Krempa
On Wed, Jun 01, 2022 at 14:50:21 +0200, Jiri Denemark wrote: > QEMU keeps guest CPUs running even in postcopy-paused migration state so > that processes that already have all memory pages they need migrated to > the destination can keep running. However, this behavior might bring > unexpected delay

Re: [libvirt PATCH v2 80/81] qemu: Fix VSERPORT_CHANGE event in post-copy migration

2022-06-06 Thread Peter Krempa
On Wed, Jun 01, 2022 at 14:50:20 +0200, Jiri Denemark wrote: > When a domain has a guest agent channel enabled and the agent is running > in the guest, we will get VSERPORT_CHANGE event on a destination host as > soon as we start vCPUs there. This is not an issue for normal migration, > but post-co

Re: [libvirt PATCH v2 79/81] Introduce VIR_JOB_MIGRATION_SAFE job type

2022-06-06 Thread Peter Krempa
On Wed, Jun 01, 2022 at 14:50:19 +0200, Jiri Denemark wrote: > This is a special job for operations that need to modify domain state > during an active migration. The modification must not affect any state > that could conflict with the migration code. This is useful mainly for > event handlers tha

Re: [libvirt PATCH v2 76/81] qemu: Implement VIR_DOMAIN_ABORT_JOB_POSTCOPY flag

2022-06-06 Thread Peter Krempa
On Mon, Jun 06, 2022 at 14:24:05 +0200, Peter Krempa wrote: > On Wed, Jun 01, 2022 at 14:50:16 +0200, Jiri Denemark wrote: > > Signed-off-by: Jiri Denemark > > --- > > > > Notes: > > Version 2: > > - dropped DeviceNotFound QMP error handling and replaced it with > > reporting an err

Re: [libvirt PATCH v2 67/81] qemu: Implement VIR_MIGRATE_POSTCOPY_RESUME for Finish phase

2022-06-06 Thread Peter Krempa
On Fri, Jun 03, 2022 at 14:29:58 +0200, Jiri Denemark wrote: > On Wed, Jun 01, 2022 at 14:50:07 +0200, Jiri Denemark wrote: > > 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: Ji

Re: [libvirt PATCH v2 66/81] qemu: Implement VIR_MIGRATE_POSTCOPY_RESUME for Prepare phase

2022-06-06 Thread Peter Krempa
On Fri, Jun 03, 2022 at 16:10:07 +0200, Jiri Denemark wrote: > On Wed, Jun 01, 2022 at 14:50:06 +0200, Jiri Denemark wrote: > > 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. > > > > Sign

Re: [libvirt PATCH v2 66/81] qemu: Implement VIR_MIGRATE_POSTCOPY_RESUME for Prepare phase

2022-06-06 Thread Peter Krempa
On Fri, Jun 03, 2022 at 14:27:55 +0200, Jiri Denemark wrote: > On Wed, Jun 01, 2022 at 14:50:06 +0200, Jiri Denemark wrote: > > 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. > > > > Sign

Re: [libvirt PATCH v2 52/81] qemu: Implement VIR_MIGRATE_POSTCOPY_RESUME for Begin phase

2022-06-06 Thread Peter Krempa
On Wed, Jun 01, 2022 at 14:49:52 +0200, Jiri Denemark wrote: > 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 > --- > > Notes: > Version 2: > - s/return NULL/return false/ > - dropped line bre

Re: [libvirt PATCH v2 45/81] qemu: Make qemuMigrationCheckPhase failure fatal

2022-06-06 Thread Peter Krempa
On Wed, Jun 01, 2022 at 14:49:45 +0200, Jiri Denemark wrote: > The check can reveal a serious bug in our migration code and we should > not silently ignore it. > > Signed-off-by: Jiri Denemark > --- > > Notes: > Version 2: > - no change > > src/qemu/qemu_migration.c | 58 ++

Re: [libvirt PATCH v2 34/81] qemu: Handle migration job in qemuMigrationDstFinish

2022-06-06 Thread Peter Krempa
On Wed, Jun 01, 2022 at 14:49:34 +0200, Jiri Denemark wrote: > The function which started a migration phase should also finish it by > calling qemuMigrationJobFinish/qemuMigrationJobContinue so that the code > is easier to follow. > > Signed-off-by: Jiri Denemark > --- > > Notes: > Version 2

Re: [libvirt PATCH v2 33/81] qemu: Introduce qemuMigrationDstFinishActive

2022-06-06 Thread Peter Krempa
On Wed, Jun 01, 2022 at 14:49:33 +0200, Jiri Denemark wrote: > 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: > >

Re: [libvirt PATCH v2 03/81] Introduce VIR_DOMAIN_RUNNING_POSTCOPY_FAILED

2022-06-06 Thread Jiri Denemark
On Mon, Jun 06, 2022 at 14:35:10 +0200, Peter Krempa wrote: > On Mon, Jun 06, 2022 at 14:29:20 +0200, Peter Krempa wrote: > > On Wed, Jun 01, 2022 at 14:49:03 +0200, Jiri Denemark wrote: > > > This new "post-copy failed" reason for the running state will be used on > > > the destination host when p

Re: [libvirt PATCH v2 21/81] qemu: Add support for postcopy-recover QEMU migration state

2022-06-06 Thread Peter Krempa
On Wed, Jun 01, 2022 at 14:49:21 +0200, Jiri Denemark wrote: > Signed-off-by: Jiri Denemark > --- > > Notes: > Version 2: > - rebased on top of newly added "qemu: Use switch in > qemuProcessHandleMigrationStatus" > - debug message on a single line > > src/qemu/qemu_migration.c

Re: [libvirt PATCH v2 20/81] qemu: Handle 'postcopy-paused' migration state

2022-06-06 Thread Peter Krempa
On Wed, Jun 01, 2022 at 14:49:20 +0200, Jiri Denemark wrote: > When connection breaks during post-copy migration, QEMU enters > 'postcopy-paused' state. We need to handle this state and make the > situation visible to upper layers. > > Signed-off-by: Jiri Denemark > --- > > Notes: > Version

Re: [libvirt PATCH v2 19/81] qemu: Use switch in qemuProcessHandleMigrationStatus

2022-06-06 Thread Peter Krempa
On Wed, Jun 01, 2022 at 14:49:19 +0200, Jiri Denemark wrote: > Signed-off-by: Jiri Denemark > --- > > Notes: > Version 2: > - new patch Reviewed-by: Peter Krempa

Re: [libvirt PATCH v2 15/81] qemu: Restore async job start timestamp on reconnect

2022-06-06 Thread Peter Krempa
On Wed, Jun 01, 2022 at 14:49:15 +0200, Jiri Denemark wrote: > Jobs that are supposed to remain active even when libvirt daemon > restarts were reported as started at the time the daemon was restarted. > This is not very helpful, we should restore the original timestamp. > > Signed-off-by: Jiri De

Re: [libvirt PATCH v2 04/81] qemu: Keep domain running on dst on failed post-copy migration

2022-06-06 Thread Peter Krempa
On Wed, Jun 01, 2022 at 14:49:04 +0200, Jiri Denemark wrote: > There's no need to artificially pause a domain when post-copy fails > from our point of view unless QEMU connection is broken too as migration > may still be progressing well. > > Signed-off-by: Jiri Denemark > --- > > Notes: > V

Re: [libvirt PATCH v2 03/81] Introduce VIR_DOMAIN_RUNNING_POSTCOPY_FAILED

2022-06-06 Thread Peter Krempa
On Mon, Jun 06, 2022 at 14:29:20 +0200, Peter Krempa wrote: > On Wed, Jun 01, 2022 at 14:49:03 +0200, Jiri Denemark wrote: > > This new "post-copy failed" reason for the running state will be used on > > the destination host when post-copy migration fails while the domain is > > already running the

Re: [libvirt PATCH v2 03/81] Introduce VIR_DOMAIN_RUNNING_POSTCOPY_FAILED

2022-06-06 Thread Peter Krempa
On Wed, Jun 01, 2022 at 14:49:03 +0200, Jiri Denemark wrote: > This new "post-copy failed" reason for the running state will be used on > the destination host when post-copy migration fails while the domain is > already running there. > > Signed-off-by: Jiri Denemark > --- > > Notes: > Versi

Re: [libvirt PATCH v2 78/81] NEWS: Add support for post-copy recovery

2022-06-06 Thread Peter Krempa
On Wed, Jun 01, 2022 at 14:50:18 +0200, Jiri Denemark wrote: > Signed-off-by: Jiri Denemark > Reviewed-by: Peter Krempa > Reviewed-by: Pavel Hrdina > --- > > Notes: > Version 2: > - s/fecovering/recovering/ > - added `` around flag name and virsh command > > NEWS.rst | 5 + >

Re: [libvirt PATCH v2 76/81] qemu: Implement VIR_DOMAIN_ABORT_JOB_POSTCOPY flag

2022-06-06 Thread Peter Krempa
On Wed, Jun 01, 2022 at 14:50:16 +0200, Jiri Denemark wrote: > Signed-off-by: Jiri Denemark > --- > > Notes: > Version 2: > - dropped DeviceNotFound QMP error handling and replaced it with > reporting an error if the VIR_DOMAIN_ABORT_JOB_POSTCOPY flag is used > for something e

Re: [PATCH 14/16] conf: Expose QEMU's main loop object

2022-06-06 Thread Daniel P . Berrangé
On Thu, Jun 02, 2022 at 01:54:39PM +0200, Peter Krempa wrote: > On Thu, Jun 02, 2022 at 09:18:04 +0200, Michal Privoznik wrote: > > As of v7.0.0-877-g70ac26b9e5 QEMU exposes its main event loop as > > an QMP object. In the very next commit (v7.0.0-878-g71ad4713cc) > > it was extended for thread-poo

Re: [PATCH] util: json: Add modifier for adding non-negative long values to JSON objects

2022-06-06 Thread Daniel P . Berrangé
On Thu, Jun 02, 2022 at 09:52:16AM +0200, Peter Krempa wrote: > On Thu, Jun 02, 2022 at 09:48:28 +0200, Jiri Denemark wrote: > > On Thu, Jun 02, 2022 at 09:45:16 +0200, Peter Krempa wrote: > > > Similarly to the 'k' modifier for integers introduce 'K' for long > > > integers. > > > > > > Signed-of

Re: [libvirt PATCH v2 81/81] RFC: qemu: Keep vCPUs paused while migration is in postcopy-paused

2022-06-06 Thread Daniel P . Berrangé
On Wed, Jun 01, 2022 at 02:50:21PM +0200, Jiri Denemark wrote: > QEMU keeps guest CPUs running even in postcopy-paused migration state so > that processes that already have all memory pages they need migrated to > the destination can keep running. However, this behavior might bring > unexpected del

Re: [PATCH] qemu: Fix crash in qemuBuildDeviceCommandlineHandleOverrides

2022-06-06 Thread Ján Tomko
On a Monday in 2022, Peter Krempa wrote: 'STREQ' is used to compare the override alias with the device alias. While the parser ensures that the override alias is non-NULL, the device alias may be NULL and STREQ doesn't handle that. Fixes: 38ab5c9ead5 Resolves: https://gitlab.com/libvirt/libvirt/

Re: [PATCH] qemu: Fix crash in qemuBuildDeviceCommandlineHandleOverrides

2022-06-06 Thread Pavel Hrdina
On Mon, Jun 06, 2022 at 10:26:38AM +0200, Peter Krempa wrote: > 'STREQ' is used to compare the override alias with the device alias. > While the parser ensures that the override alias is non-NULL, the device > alias may be NULL and STREQ doesn't handle that. > > Fixes: 38ab5c9ead5 > Resolves: http

[PATCH] qemu: Fix crash in qemuBuildDeviceCommandlineHandleOverrides

2022-06-06 Thread Peter Krempa
'STREQ' is used to compare the override alias with the device alias. While the parser ensures that the override alias is non-NULL, the device alias may be NULL and STREQ doesn't handle that. Fixes: 38ab5c9ead5 Resolves: https://gitlab.com/libvirt/libvirt/-/issues/321 Signed-off-by: Peter Krempa -

Re: [libvirt][PATCH RESEND v12 0/6] Support query and use SGX

2022-06-06 Thread Peter Krempa
On Fri, Jun 03, 2022 at 16:43:30 +0200, Michal Prívozník wrote: > On 6/3/22 09:36, Peter Krempa wrote: > > On Thu, Jun 02, 2022 at 22:49:15 +, Yang, Lin A wrote: > >> On 6/2/22, 11:28 AM, "Yang, Lin A" wrote: > >>> On 6/1/22, 11:37 PM, "Michal Prívozník" wrote: [...] > Exactly. This is what