8f8031d qemu: Emit correct audit message for memory hot unplug

1 file Authored by Luyao Huang 8 years ago, Committed by John Ferlan 8 years ago,
    qemu: Emit correct audit message for memory hot unplug
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1226234#c3
    
    If the qemu monitor fails to remove the memory from the guest for
    any reason, the auditlog message will incorrectly use the current
    actual memory (via virDomainDefGetMemoryActual) instead of the
    value we were attempting to reduce to. The result is the 'new-mem'
    and 'old-mem' values for the auditlog message would be identical.
    
    This patch creates a local 'newmem' which accounts for the current
    memory size minus the memory which is being removed. NB, for the
    success case this results in the same value that would be returned
    by virDomainDefGetMemoryActual without the need to do the math. This
    follows the existing code which would subtract the size for cur_balloon.
    
    Signed-off-by: Luyao Huang <lhuang@redhat.com>
    
        
file modified
+11 -12