e859da6 qemu: send allowReboot in migration cookie

Authored and Committed by phrdina 6 years ago
    qemu: send allowReboot in migration cookie
    
    We need to send allowReboot in the migration cookie to ensure the same
    behavior of the virDomainSetLifecycleAction() API on the destination.
    
    Consider this scenario:
    
        1. On the source the domain is started with:
            <on_poweroff>destroy</on_poweroff>
            <on_reboot>restart</on_reboot>
            <on_crash>destroy</on_crash>
    
        2. User calls an API to set "destroy" for <on_reboot>:
            <on_poweroff>destroy</on_poweroff>
            <on_reboot>destroy</on_reboot>
            <on_crash>destroy</on_crash>
    
        3. The guest is migrated to a different host
    
        4a. Without the allowReboot in the migration cookie the QEMU
            process on destination would be started with -no-reboot
            which would prevent using the virDomainSetLifecycleAction() API
            for the rest of the guest lifetime.
    
        4b. With the allowReboot in the migration cookie the QEMU process
            on destination is started without -no-reboot like it was started
            on the source host and the virDomainSetLifecycleAction() API
            continues to work.
    
    The following patch adds a QEMU implementation of the
    virDomainSetLifecycleAction() API and that implementation disallows
    using the API if all actions are set to "destroy" because we add
    "-no-reboot" on the QEMU command line.  Changing the lifecycle action
    is in this case pointless because the QEMU process is always terminated.
    
    Reviewed-by: John Ferlan <jferlan@redhat.com>
    Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
    
        
file modified
+2 -2
file modified
+8 -0
file modified
+6 -1