From dba8bfb94dd3d51f7576dfbdd1d541aa75f90457 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Wed, 16 Mar 2016 09:10:59 -0500 Subject: [PATCH] tmem: add tmem_disable() function Instead of manipulating the opt_tmem variable directly utilize a wrapper function. Signed-off-by: Doug Goldstein Acked-by: Jan Beulich Signed-off-by: Konrad Rzeszutek Wilk --- xen/arch/x86/setup.c | 4 ++-- xen/include/xen/tmem_xen.h | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index a8bf2c9bb0..50119303ac 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -25,7 +25,7 @@ #include #include #include -#include /* for opt_tmem only */ +#include #include #include #include @@ -1276,7 +1276,7 @@ void __init noreturn __start_xen(unsigned long mbi_p) { printk(XENLOG_WARNING "TMEM physical RAM limit exceeded, disabling TMEM\n"); - opt_tmem = 0; + tmem_disable(); } } else diff --git a/xen/include/xen/tmem_xen.h b/xen/include/xen/tmem_xen.h index c770f3e4d5..f516bbefc8 100644 --- a/xen/include/xen/tmem_xen.h +++ b/xen/include/xen/tmem_xen.h @@ -69,6 +69,11 @@ static inline bool_t tmem_enabled(void) return opt_tmem; } +static inline void tmem_disable(void) +{ + opt_tmem = 0; +} + /* * Memory free page list management */ -- 2.30.2