diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-12-04 20:33:06 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-12-04 20:33:06 +0000 |
commit | bd3220870f677d5b08f59d7e786ac18bde1c1b7c (patch) | |
tree | 2f790c4ead1b6829a8433b37ba95e9b632d5f45e /hw/pc.c | |
parent | df751fa8bfed4408ca091a7badd75c5ab80f71de (diff) | |
download | qemu-bd3220870f677d5b08f59d7e786ac18bde1c1b7c.tar.gz qemu-bd3220870f677d5b08f59d7e786ac18bde1c1b7c.tar.bz2 qemu-bd3220870f677d5b08f59d7e786ac18bde1c1b7c.zip |
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 <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5874 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/pc.c')
-rw-r--r-- | hw/pc.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -34,6 +34,7 @@ #include "console.h" #include "fw_cfg.h" #include "virtio-blk.h" +#include "virtio-balloon.h" /* output Bochs bios info messages */ //#define DEBUG_BIOS @@ -1105,6 +1106,10 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, unit_id++; } } + + /* Add virtio balloon device */ + if (pci_enabled) + virtio_balloon_init(pci_bus); } static void pc_init_pci(ram_addr_t ram_size, int vga_ram_size, |