| .. | .. |
|---|
| 37 | 37 | #include <linux/mm_types.h> |
|---|
| 38 | 38 | #include <linux/init.h> |
|---|
| 39 | 39 | #include <linux/capability.h> |
|---|
| 40 | +#include <linux/memory_hotplug.h> |
|---|
| 40 | 41 | |
|---|
| 41 | 42 | #include <xen/xen.h> |
|---|
| 42 | 43 | #include <xen/interface/xen.h> |
|---|
| .. | .. |
|---|
| 50 | 51 | |
|---|
| 51 | 52 | #define BALLOON_CLASS_NAME "xen_memory" |
|---|
| 52 | 53 | |
|---|
| 54 | +#ifdef CONFIG_MEMORY_HOTPLUG |
|---|
| 55 | +u64 xen_saved_max_mem_size = 0; |
|---|
| 56 | +#endif |
|---|
| 57 | + |
|---|
| 53 | 58 | static struct device balloon_dev; |
|---|
| 54 | 59 | |
|---|
| 55 | 60 | static int register_balloon(struct device *dev); |
|---|
| .. | .. |
|---|
| 62 | 67 | int err; |
|---|
| 63 | 68 | static bool watch_fired; |
|---|
| 64 | 69 | static long target_diff; |
|---|
| 70 | + |
|---|
| 71 | +#ifdef CONFIG_MEMORY_HOTPLUG |
|---|
| 72 | + /* The balloon driver will take care of adding memory now. */ |
|---|
| 73 | + if (xen_saved_max_mem_size) |
|---|
| 74 | + max_mem_size = xen_saved_max_mem_size; |
|---|
| 75 | +#endif |
|---|
| 65 | 76 | |
|---|
| 66 | 77 | err = xenbus_scanf(XBT_NIL, "memory", "target", "%llu", &new_target); |
|---|
| 67 | 78 | if (err != 1) { |
|---|
| .. | .. |
|---|
| 117 | 128 | void xen_balloon_init(void) |
|---|
| 118 | 129 | { |
|---|
| 119 | 130 | register_balloon(&balloon_dev); |
|---|
| 120 | | - |
|---|
| 121 | | - register_xen_selfballooning(&balloon_dev); |
|---|
| 122 | 131 | |
|---|
| 123 | 132 | register_xenstore_notifier(&xenstore_notifier); |
|---|
| 124 | 133 | } |
|---|