Skip to content

Commit

Permalink
xen/balloon: Support xend-based toolstack
Browse files Browse the repository at this point in the history
Xend-based toolstacks don't have static-max entry in xenstore. The
equivalent node for those toolstacks is memory_static_max.

Fixes: 5266b8e (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>
  • Loading branch information
Boris Ostrovsky authored and Juergen Gross committed Oct 24, 2018
1 parent 7deecbd commit 3aa6c19
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions drivers/xen/xen-balloon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3aa6c19

Please sign in to comment.