• D
    Automatically kill target QEMU if migration aborts abnormally · 2c2effa1
    Daniel P. Berrange 提交于
    Migration is a multi-step process
    
      1. Begin(src)
      2. Prepare(dst)
      3. Perform(src)
      4. Finish(dst)
      5. Confirm(src)
    
    At step 2, a QEMU process is lauched in the destination to
    accept the incoming migration. Occasionally the process
    that is controlling the migration workflow aborts, and fails
    to call step 4, Finish. This leaves a QEMU process running
    on the target (albeit with paused CPUs). Unfortunately because
    step 2 actives a job on the QEMU process, it is unkillable by
    normal means.
    
    By registering the VM for autokill against the src virConnectPtr
    in step 2, we can ensure that the guest is forcefully killed off
    if the connection is closed without step 4 being invoked
    
    * src/qemu/qemu_migration.c: Register autokill in PrepareDirect
      and PrepareTunnel. Unregister autokill on successful run
      of Finish
    * src/qemu/qemu_process.c: Unregister autokill when stopping a
      process
    2c2effa1
qemu_migration.c 91.9 KB