From bd3220870f677d5b08f59d7e786ac18bde1c1b7c Mon Sep 17 00:00:00 2001 From: aliguori Date: Thu, 4 Dec 2008 20:33:06 +0000 Subject: Add virtio-balloon support This adds a VirtIO based balloon driver. It uses madvise() to actually balloon the memory when possible. Until 2.6.27, KVM forced memory pinning so we must disable ballooning unless the kernel actually supports it when using KVM. It's always safe when using TCG. Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5874 c046a42c-6fe2-441c-8c8c-71466251a162 --- kvm-all.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'kvm-all.c') diff --git a/kvm-all.c b/kvm-all.c index 39f826b..69ca46b 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -549,3 +549,15 @@ int kvm_vcpu_ioctl(CPUState *env, int type, ...) return ret; } + +int kvm_has_sync_mmu(void) +{ + KVMState *s = kvm_state; + +#ifdef KVM_CAP_SYNC_MMU + if (kvm_ioctl(s, KVM_CHECK_EXTENSION, KVM_CAP_SYNC_MMU) > 0) + return 1; +#endif + + return 0; +} -- cgit v1.1