Skip to content

Commit 3aa6c19

Browse files
Boris Ostrovskyjgross1
authored andcommitted
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: 5266b8e (xen: fix booting ballooned down hvm guest) Signed-off-by: Boris Ostrovsky <[email protected]> Cc: <[email protected]> # 4.13 Reviewed-by: Juergen Gross <[email protected]> Signed-off-by: Juergen Gross <[email protected]>
1 parent 7deecbd commit 3aa6c19

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

drivers/xen/xen-balloon.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,15 @@ static void watch_target(struct xenbus_watch *watch,
7676

7777
if (!watch_fired) {
7878
watch_fired = true;
79-
err = xenbus_scanf(XBT_NIL, "memory", "static-max", "%llu",
80-
&static_max);
81-
if (err != 1)
82-
static_max = new_target;
83-
else
79+
80+
if ((xenbus_scanf(XBT_NIL, "memory", "static-max",
81+
"%llu", &static_max) == 1) ||
82+
(xenbus_scanf(XBT_NIL, "memory", "memory_static_max",
83+
"%llu", &static_max) == 1))
8484
static_max >>= PAGE_SHIFT - 10;
85+
else
86+
static_max = new_target;
87+
8588
target_diff = (xen_pv_domain() || xen_initial_domain()) ? 0
8689
: static_max - balloon_stats.target_pages;
8790
}

0 commit comments

Comments
 (0)