3926d0a qemu: Fix snapshot redefine vs. domain state bug

Authored and Committed by ericb 5 years ago
    qemu: Fix snapshot redefine vs. domain state bug
    
    The existing qemu snapshot code has a slight bug: if the domain
    is currently pmsuspended, you can't use the _REDEFINE flag even
    though the current domain state should have no bearing on being
    able to recreate metadata state; and conversely, you can use the
    _REDEFINE flag to create snapshot metadata claiming to be
    pmsuspended as a bypass to the normal restrictions that you can't
    create an original qemu snapshot in that state (the restriction
    against pmsuspend is specific to qemu, rather than part of the
    driver-agnostic snapshot_conf code).
    
    Fix this by checking the snapshot state (when redefining) instead
    of the domain state (which is a subset of snapshot states).
    
    Fixes the second problem mentioned in https://bugzilla.redhat.com/1680304
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: John Ferlan <jferlan@redhat.com>
    
        
file modified
+7 -2