Skip to content

Commit

Permalink
accel/kvm: Convert to ram_block_discard_disable()
Browse files Browse the repository at this point in the history
Discarding memory does not work as expected. At the time this is called,
we cannot have anyone active that relies on discards to work properly.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20200626072248.78761-5-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
davidhildenbrand authored and mstsirkin committed Jul 2, 2020
1 parent aff92b8 commit 956b109
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions accel/kvm/kvm-all.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include "trace.h"
#include "hw/irq.h"
#include "sysemu/sev.h"
#include "sysemu/balloon.h"
#include "qapi/visitor.h"
#include "qapi/qapi-types-common.h"
#include "qapi/qapi-visit-common.h"
Expand Down Expand Up @@ -2229,7 +2228,8 @@ static int kvm_init(MachineState *ms)

s->sync_mmu = !!kvm_vm_check_extension(kvm_state, KVM_CAP_SYNC_MMU);
if (!s->sync_mmu) {
qemu_balloon_inhibit(true);
ret = ram_block_discard_disable(true);
assert(!ret);
}

return 0;
Expand Down

0 comments on commit 956b109

Please sign in to comment.