diff options
author | Boris Ostrovsky <boris.ostrovsky@oracle.com> | 2018-10-07 22:05:38 +0200 |
---|---|---|
committer | Juergen Gross <jgross@suse.com> | 2018-10-24 10:18:47 +0200 |
commit | 3aa6c19d2f38be9c6e9a8ad5fa8e3c9d29ee3c35 (patch) | |
tree | ef27273d532d5fe9bf8c947dc4decaa5cb4f18cb /drivers/xen | |
parent | xen/pvh: increase early stack size (diff) | |
download | linux-3aa6c19d2f38be9c6e9a8ad5fa8e3c9d29ee3c35.tar.xz linux-3aa6c19d2f38be9c6e9a8ad5fa8e3c9d29ee3c35.zip |
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: 5266b8e4445c (xen: fix booting ballooned down hvm guest)
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: <stable@vger.kernel.org> # 4.13
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/xen-balloon.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/xen/xen-balloon.c b/drivers/xen/xen-balloon.c index 63c1494a8d73..2acbfe104e46 100644 --- a/drivers/xen/xen-balloon.c +++ b/drivers/xen/xen-balloon.c @@ -76,12 +76,15 @@ static void watch_target(struct xenbus_watch *watch, if (!watch_fired) { watch_fired = true; - err = xenbus_scanf(XBT_NIL, "memory", "static-max", "%llu", - &static_max); - if (err != 1) - static_max = new_target; - else + + if ((xenbus_scanf(XBT_NIL, "memory", "static-max", + "%llu", &static_max) == 1) || + (xenbus_scanf(XBT_NIL, "memory", "memory_static_max", + "%llu", &static_max) == 1)) static_max >>= PAGE_SHIFT - 10; + else + static_max = new_target; + target_diff = (xen_pv_domain() || xen_initial_domain()) ? 0 : static_max - balloon_stats.target_pages; } |