[PATCH 00/12] qemu: migration: Fix crashes when VM shutdowns itself during migration in active state

Peter Krempa posted 12 patches 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1718291410.git.pkrempa@redhat.com
src/qemu/qemu_backup.c    |   6 +--
src/qemu/qemu_backup.h    |   2 +-
src/qemu/qemu_blockjob.c  |   9 +++-
src/qemu/qemu_domain.c    |  40 +++++++++++++-
src/qemu/qemu_domain.h    |   2 +
src/qemu/qemu_migration.c |  43 +++++++---------
src/qemu/qemu_process.c   | 106 ++++++++++++++++++++++----------------
7 files changed, 131 insertions(+), 77 deletions(-)
[PATCH 00/12] qemu: migration: Fix crashes when VM shutdowns itself during migration in active state
Posted by Peter Krempa 4 months ago
The daemon crashes due to unexpected cleanup happening due to bad
assumptions about locking and state. See patch 5.

Peter Krempa (12):
  qemuBlockJobProcessEventConcludedBackup: Handle potentially NULL
    'job->disk'
  qemuDomainDiskPrivateDispose: Prevent dangling 'disk' pointer in
    blockjob data
  qemuDomainDeviceBackendChardevForeach: Fix typo in comment
  qemuDomainObjWait: Add documentation
  qemuProcessStop: Prevent crash when qemuDomainObjStopWorker() unlocks
    the VM
  qemuProcessStop: Move code not depending on 'vm->def->id' after reset
    of the ID
  qemu: process: Ensure that 'beingDestroyed' gets cleared only after VM
    id is reset
  qemu: domain: Introduce qemuDomainObjIsActive helper
  qemu: migration: Properly check for live VM after qemuDomainObjWait()
  qemu: migration: Inline 'qemuMigrationDstFinishResume()'
  qemuMigrationSrcRun: Re-check whether VM is active before accessing
    job data
  qemu: migration: Preserve error across qemuDomainSetMaxMemLock() on
    error paths

 src/qemu/qemu_backup.c    |   6 +--
 src/qemu/qemu_backup.h    |   2 +-
 src/qemu/qemu_blockjob.c  |   9 +++-
 src/qemu/qemu_domain.c    |  40 +++++++++++++-
 src/qemu/qemu_domain.h    |   2 +
 src/qemu/qemu_migration.c |  43 +++++++---------
 src/qemu/qemu_process.c   | 106 ++++++++++++++++++++++----------------
 7 files changed, 131 insertions(+), 77 deletions(-)

-- 
2.45.2
Re: [PATCH 00/12] qemu: migration: Fix crashes when VM shutdowns itself during migration in active state
Posted by Michal Prívozník 4 months ago
On 6/13/24 17:11, Peter Krempa wrote:
> The daemon crashes due to unexpected cleanup happening due to bad
> assumptions about locking and state. See patch 5.
> 
> Peter Krempa (12):
>   qemuBlockJobProcessEventConcludedBackup: Handle potentially NULL
>     'job->disk'
>   qemuDomainDiskPrivateDispose: Prevent dangling 'disk' pointer in
>     blockjob data
>   qemuDomainDeviceBackendChardevForeach: Fix typo in comment
>   qemuDomainObjWait: Add documentation
>   qemuProcessStop: Prevent crash when qemuDomainObjStopWorker() unlocks
>     the VM
>   qemuProcessStop: Move code not depending on 'vm->def->id' after reset
>     of the ID
>   qemu: process: Ensure that 'beingDestroyed' gets cleared only after VM
>     id is reset
>   qemu: domain: Introduce qemuDomainObjIsActive helper
>   qemu: migration: Properly check for live VM after qemuDomainObjWait()
>   qemu: migration: Inline 'qemuMigrationDstFinishResume()'
>   qemuMigrationSrcRun: Re-check whether VM is active before accessing
>     job data
>   qemu: migration: Preserve error across qemuDomainSetMaxMemLock() on
>     error paths
> 
>  src/qemu/qemu_backup.c    |   6 +--
>  src/qemu/qemu_backup.h    |   2 +-
>  src/qemu/qemu_blockjob.c  |   9 +++-
>  src/qemu/qemu_domain.c    |  40 +++++++++++++-
>  src/qemu/qemu_domain.h    |   2 +
>  src/qemu/qemu_migration.c |  43 +++++++---------
>  src/qemu/qemu_process.c   | 106 ++++++++++++++++++++++----------------
>  7 files changed, 131 insertions(+), 77 deletions(-)
> 

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal