File kdump-fate318842-0004-print-total.patch of Package kdump

From: Petr Tesarik <ptesarik@suse.com>
Date: Thu, 17 Sep 2015 22:56:23 +0200
Subject: "kdumptool calibrate": print out total memory
References: FATE#318842, bsc#882082
Patch-mainline: v0.8.16
Git-commit: cf0fe0ee34c7215b31df1683ec1f0a01478465fe

Print total available RAM as found in /etc/iomem.

Signed-off-by: Petr Tesarik <ptesarik@suse.com>
---
 kdumptool/calibrate.cc |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/kdumptool/calibrate.cc
+++ b/kdumptool/calibrate.cc
@@ -812,16 +812,16 @@ void Calibrate::execute()
 {
     Debug::debug()->trace("Calibrate::execute()");
 
+    MemMap mm;
     unsigned long required, prev;
     unsigned long pagesize = sysconf(_SC_PAGESIZE);
+    unsigned long memtotal = shr_round_up(mm.total(), 10);
 
     try {
 	Configuration *config = Configuration::config();
 	bool needsnet = config->needsNetwork();
 
 	// Get total RAM size
-	MemMap mm;
-	unsigned long memtotal = shr_round_up(mm.total(), 10);
         Debug::debug()->dbg("Expected total RAM: %lu KiB", memtotal);
 
 	// Calculate boot requirements
@@ -937,6 +937,7 @@ void Calibrate::execute()
 	required = DEF_RESERVE_KB;
     }
 
+    cout << "Total: " << (memtotal >> 10) << endl;
     cout << "Low: " << shr_round_up(required, 10) << endl;
 }
 
openSUSE Build Service is sponsored by