Skip to content

Commit 652faa3

Browse files
Boris Ostrovskyjfvogel
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]> Orabug: 28901032 (cherry picked from commit 3aa6c19) Signed-off-by: Boris Ostrovsky <[email protected]> Reviewed-by: Darren Kenny <[email protected]>
1 parent b84a28e commit 652faa3

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
@@ -75,12 +75,15 @@ static void watch_target(struct xenbus_watch *watch,
7575

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

0 commit comments

Comments
 (0)