Skip to content
  • Paolo Bonzini's avatar
    qmp: handle stop/cont in INMIGRATE state · 1e998146
    Paolo Bonzini authored
    
    
    Right now, stop followed by an incoming migration will let the
    virtual machine start.  cont before an incoming migration instead
    will fail.
    
    This is bad because the actual behavior is not predictable; it is
    racy with respect to the start of the incoming migration.  That's
    because incoming migration is blocking, and thus will delay the
    processing of stop/cont until the end of the migration.
    
    In addition, there's nothing that really prevents the user from
    typing the block device's passwords before incoming migration is
    done, so returning the DeviceEncrypted error is also helpful in
    the QMP case.
    
    Both things can be fixed by just toggling the autostart variable when
    stop/cont are called in INMIGRATE state.
    
    Note that libvirt is currently working around the race by looping
    if the MigrationExpected answer is returned.  After this patch, the
    command will return right away without ever raising an error.
    
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: default avatarLuiz Capitulino <lcapitulino@redhat.com>
    1e998146