Commit 3aa6c19d authored by Boris Ostrovsky's avatar Boris Ostrovsky Committed by Juergen Gross

xen/balloon: Support xend-based toolstack

Xend-based toolstacks don't have static-max entry in xenstore. The
equivalent node for those toolstacks is memory_static_max.

Fixes: 5266b8e4 (xen: fix booting ballooned down hvm guest)
Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: <stable@vger.kernel.org> # 4.13
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
parent 7deecbda
...@@ -76,12 +76,15 @@ static void watch_target(struct xenbus_watch *watch, ...@@ -76,12 +76,15 @@ static void watch_target(struct xenbus_watch *watch,
if (!watch_fired) { if (!watch_fired) {
watch_fired = true; watch_fired = true;
err = xenbus_scanf(XBT_NIL, "memory", "static-max", "%llu",
&static_max); if ((xenbus_scanf(XBT_NIL, "memory", "static-max",
if (err != 1) "%llu", &static_max) == 1) ||
static_max = new_target; (xenbus_scanf(XBT_NIL, "memory", "memory_static_max",
else "%llu", &static_max) == 1))
static_max >>= PAGE_SHIFT - 10; static_max >>= PAGE_SHIFT - 10;
else
static_max = new_target;
target_diff = (xen_pv_domain() || xen_initial_domain()) ? 0 target_diff = (xen_pv_domain() || xen_initial_domain()) ? 0
: static_max - balloon_stats.target_pages; : static_max - balloon_stats.target_pages;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment