diff options
| -rw-r--r-- | drivers/xen/xen-balloon.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/xen/xen-balloon.c b/drivers/xen/xen-balloon.c index 5c9dc43c1e94..9cc2259c9992 100644 --- a/drivers/xen/xen-balloon.c +++ b/drivers/xen/xen-balloon.c | |||
| @@ -50,11 +50,6 @@ static struct sys_device balloon_sysdev; | |||
| 50 | 50 | ||
| 51 | static int register_balloon(struct sys_device *sysdev); | 51 | static int register_balloon(struct sys_device *sysdev); |
| 52 | 52 | ||
| 53 | static struct xenbus_watch target_watch = | ||
| 54 | { | ||
| 55 | .node = "memory/target" | ||
| 56 | }; | ||
| 57 | |||
| 58 | /* React to a change in the target key */ | 53 | /* React to a change in the target key */ |
| 59 | static void watch_target(struct xenbus_watch *watch, | 54 | static void watch_target(struct xenbus_watch *watch, |
| 60 | const char **vec, unsigned int len) | 55 | const char **vec, unsigned int len) |
| @@ -73,6 +68,11 @@ static void watch_target(struct xenbus_watch *watch, | |||
| 73 | */ | 68 | */ |
| 74 | balloon_set_new_target(new_target >> (PAGE_SHIFT - 10)); | 69 | balloon_set_new_target(new_target >> (PAGE_SHIFT - 10)); |
| 75 | } | 70 | } |
| 71 | static struct xenbus_watch target_watch = { | ||
| 72 | .node = "memory/target", | ||
| 73 | .callback = watch_target, | ||
| 74 | }; | ||
| 75 | |||
| 76 | 76 | ||
| 77 | static int balloon_init_watcher(struct notifier_block *notifier, | 77 | static int balloon_init_watcher(struct notifier_block *notifier, |
| 78 | unsigned long event, | 78 | unsigned long event, |
| @@ -87,7 +87,9 @@ static int balloon_init_watcher(struct notifier_block *notifier, | |||
| 87 | return NOTIFY_DONE; | 87 | return NOTIFY_DONE; |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | static struct notifier_block xenstore_notifier; | 90 | static struct notifier_block xenstore_notifier = { |
| 91 | .notifier_call = balloon_init_watcher, | ||
| 92 | }; | ||
| 91 | 93 | ||
| 92 | static int __init balloon_init(void) | 94 | static int __init balloon_init(void) |
| 93 | { | 95 | { |
| @@ -100,9 +102,6 @@ static int __init balloon_init(void) | |||
| 100 | 102 | ||
| 101 | register_xen_selfballooning(&balloon_sysdev); | 103 | register_xen_selfballooning(&balloon_sysdev); |
| 102 | 104 | ||
| 103 | target_watch.callback = watch_target; | ||
| 104 | xenstore_notifier.notifier_call = balloon_init_watcher; | ||
| 105 | |||
| 106 | register_xenstore_notifier(&xenstore_notifier); | 105 | register_xenstore_notifier(&xenstore_notifier); |
| 107 | 106 | ||
| 108 | return 0; | 107 | return 0; |
