ShaoHe Feng has uploaded a new change for review.
Change subject: get the status of core dump ......................................................................
get the status of core dump
Change-Id: I5d552db4dbd88762950ec5a113a25c13b73319c8 Signed-off-by: ShaoHe Feng shaohef@linux.vnet.ibm.com --- M vdsm/API.py M vdsm/BindingXMLRPC.py M vdsm/vm.py M vdsm_api/vdsmapi-schema.json M vdsm_cli/vdsClient.py 5 files changed, 36 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/31/11131/1
diff --git a/vdsm/API.py b/vdsm/API.py index c5f7d40..6b4663a 100644 --- a/vdsm/API.py +++ b/vdsm/API.py @@ -302,6 +302,15 @@ return errCode['noVM'] return v.dumpCancel()
+ def dumpStatus(self): + """ + Report status of a currently outgoing core dump process. + """ + v = self._cif.vmContainer.get(self._UUID) + if not v: + return errCode['noVM'] + return v.dumpStatus() + def desktopLock(self): """ Lock user session in guest operating system using guest agent. diff --git a/vdsm/BindingXMLRPC.py b/vdsm/BindingXMLRPC.py index 17d97b1..b1f22fd 100644 --- a/vdsm/BindingXMLRPC.py +++ b/vdsm/BindingXMLRPC.py @@ -219,6 +219,10 @@ vm = API.VM(vmId) return vm.dumpCancel()
+ def vmCoreDumpStatus(self, vmId): + vm = API.VM(vmId) + return vm.dumpStatus() + def vmReset(self, vmId): vm = API.VM(vmId) return vm.reset() @@ -769,6 +773,7 @@ (self.vmCont, 'cont'), (self.vmCoreDump, 'coreDump'), (self.vmCoreDumpCancel, 'dumpCancel'), + (self.vmCoreDumpStatus, 'dumpStatus'), (self.vmSnapshot, 'snapshot'), (self.vmMerge, 'merge'), (self.vmMergeStatus, 'mergeStatus'), diff --git a/vdsm/vm.py b/vdsm/vm.py index 0a40e97..5d9c0d9 100644 --- a/vdsm/vm.py +++ b/vdsm/vm.py @@ -1371,3 +1371,6 @@ return reportError(msg=e.message) finally: self._guestCpuLock.release() + + def dumpStatus(self): + return self._doCoredumpThread.getStat() diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json index 39d1cba..e96f01f 100644 --- a/vdsm_api/vdsmapi-schema.json +++ b/vdsm_api/vdsmapi-schema.json @@ -5484,6 +5484,16 @@ {'command': {'class': 'VM', 'name': 'dumpCancel'}}
## +# @VM.dumpStatus: +# +# Reports the state of the currently core dump process +# +# Since: 4.10.4 +# +## +{'command': {'class': 'VM', 'name': 'dumpStatus'}} + +## # @VM.monitorCommand: # # Send a command to the qemu monitor. diff --git a/vdsm_cli/vdsClient.py b/vdsm_cli/vdsClient.py index 32ad348..7edc674 100644 --- a/vdsm_cli/vdsClient.py +++ b/vdsm_cli/vdsClient.py @@ -1674,6 +1674,11 @@ response = self.s.dumpCancel(vmId) return response['status']['code'], response['status']['message']
+ def do_dumpStat(self, args): + vmId = args[0] + response = self.s.dumpStatus(vmId) + return response['status']['code'], response['status']['message'] + def coreDump(self, args): dumpParams = {'crash': False, 'live': False, @@ -2422,6 +2427,10 @@ ('<vmId>', 'cancel machine core dump' )), + 'coreDumpStatus': (serv.do_dumpStat, + ('<vmId>', + 'Check the progress of current core dump' + )), 'coreDump': (serv.coreDump, ('<vmId> <file> [live=<True|False>] ' '[crash=<True|False>] [bypass-cache=<True|False>] '
-- To view, visit http://gerrit.ovirt.org/11131 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: I5d552db4dbd88762950ec5a113a25c13b73319c8 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com