Martin Peřina has uploaded a new change for review.

Change subject: caps: Collect kdump status
......................................................................

caps: Collect kdump status

Adds kdump configuration status to caps module. The status will be
reported to engine in xml response of getCapabilities using boolean
key 'kdumpStatus'.

Change-Id: I68d7a2a24fdaad74255004af0f327197eaee65f2
BugUrl: https://bugzilla.redhat.com/970259
Signed-off-by: Martin Perina <mper...@redhat.com>
---
M vdsm/caps.py
M vdsm_api/vdsmapi-schema.json
2 files changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/26/25926/1

diff --git a/vdsm/caps.py b/vdsm/caps.py
index b260d29..5b4c0cc 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -274,6 +274,10 @@
             if os.path.exists(path)]
 
 
+def _getKdumpStatus():
+    return file('/sys/kernel/kexec_crash_loaded').read() == '1\n'
+
+
 @utils.memoized
 def getos():
     if os.path.exists('/etc/rhev-hypervisor-release'):
@@ -386,6 +390,7 @@
                               config.getint('vars', 'extra_mem_reserve'))
     caps['guestOverhead'] = config.get('vars', 'guest_ram_overhead')
     caps['rngSources'] = _getRngSources()
+    caps['kdumpStatus'] = _getKdumpStatus()
 
     return caps
 
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 1275ddb..ce71fb4 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -1032,7 +1032,8 @@
           'HBAInventory': 'HbaInventory', 'vmTypes': ['VmType'],
           'memSize': 'uint', 'reservedMem': 'uint',
           'guestOverhead': 'uint', 'netConfigDirty': 'bool',
-          'rngSources': ['VmRngDeviceSource']}}
+          'rngSources': ['VmRngDeviceSource'],
+          'kdumpStatus': 'bool'}}
 
 ##
 # @Host.getCapabilities:


-- 
To view, visit http://gerrit.ovirt.org/25926
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I68d7a2a24fdaad74255004af0f327197eaee65f2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Peřina <mper...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to