3070bc8 Fix vmdef usage after domain crash in monitor on device attach

Authored and Committed by Ján Tomko 9 years ago
    Fix vmdef usage after domain crash in monitor on device attach
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1161024
    
    If the domain crashed while we were in monitor,
    we cannot rely on the REALLOC done on live definition,
    since vm->def now points to the persistent definition.
    Skip adding the attached devices to domain definition
    if the domain crashed.
    
    In AttachChrDevice, the chardev was already added to the
    live definition and freed by qemuProcessStop in the case
    of a crash. Skip the device removal in that case.
    
    Also skip audit if the domain crashed in the meantime.
    
        
file modified
+52 -17