diff mbox

[1/5] tmem: add tmem_disable() function

Message ID 1457987365-866-2-git-send-email-cardoe@cardoe.com (mailing list archive)
State New, archived
Headers show

Commit Message

Douglas Goldstein March 14, 2016, 8:29 p.m. UTC
Instead of manipulating the opt_tmem variable directly utilize a wrapper
function.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
---
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/arch/x86/setup.c       | 4 ++--
 xen/include/xen/tmem_xen.h | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)

Comments

Jan Beulich March 15, 2016, 8:12 a.m. UTC | #1
>>> On 14.03.16 at 21:29, <cardoe@cardoe.com> wrote:
> Instead of manipulating the opt_tmem variable directly utilize a wrapper
> function.
> 
> Signed-off-by: Doug Goldstein <cardoe@cardoe.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
diff mbox

Patch

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 8431f06..5485468 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -25,7 +25,7 @@ 
 #include <xen/dmi.h>
 #include <xen/pfn.h>
 #include <xen/nodemask.h>
-#include <xen/tmem_xen.h> /* for opt_tmem only */
+#include <xen/tmem_xen.h>
 #include <xen/watchdog.h>
 #include <public/version.h>
 #include <compat/platform.h>
@@ -1247,7 +1247,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 c770f3e..f516bbe 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
  */