Martin Sivák has uploaded a new change for review. Change subject: Add support for KSM and CpuTune calls to XMLRPC for MOM to use ......................................................................
Add support for KSM and CpuTune calls to XMLRPC for MOM to use MOM is moving to a separate process, but it still needs to be able to perform the same actions regarding KSM and QoS. This patch adds the missing pieces to be used before the jsonrpc client is ready. Change-Id: Ifd318b50abf8605c2584cb3b5316e2ca2ac4f5ef Signed-off-by: Martin Sivak <[email protected]> --- M lib/vdsm/define.py M vdsm/API.py M vdsm/rpc/bindingxmlrpc.py 3 files changed, 23 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/71/41571/1 diff --git a/lib/vdsm/define.py b/lib/vdsm/define.py index 147e2b8..7204c01 100644 --- a/lib/vdsm/define.py +++ b/lib/vdsm/define.py @@ -162,6 +162,9 @@ 'V2VJobExists': {'status': { 'code': 69, 'message': 'Job id already exists'}}, + 'ksmErr': {'status': { + 'code': 70, + 'message': 'Failed to update KSM values'}}, 'recovery': {'status': { 'code': 99, 'message': 'Recovering from crash or Initializing'}}, diff --git a/vdsm/API.py b/vdsm/API.py index 31bedbf..31bc981 100644 --- a/vdsm/API.py +++ b/vdsm/API.py @@ -1642,6 +1642,14 @@ except: return errCode['momErr'] + def setKsmTune(self, tuningParams): + try: + superVdsm = supervdsm.getProxy() + superVdsm.ksmTune(tuningParams) + return dict(status=doneCode) + except: + return errCode['ksmErr'] + def setHaMaintenanceMode(self, mode, enabled): """ Sets Hosted Engine HA maintenance mode ('global' or 'local') to diff --git a/vdsm/rpc/bindingxmlrpc.py b/vdsm/rpc/bindingxmlrpc.py index 6bb7082..330999f 100644 --- a/vdsm/rpc/bindingxmlrpc.py +++ b/vdsm/rpc/bindingxmlrpc.py @@ -525,6 +525,14 @@ vm = API.VM(vmId) return vm.setIoTune(tunables) + def vmSetCpuTuneQuota(self, vmId, quota): + vm = API.VM(vmId) + return vm.setCpuTuneQuota(quota) + + def vmSetCpuTunePeriod(self, vmId, period): + vm = API.VM(vmId) + return vm.setCpuTunePeriod(period) + def vmMigrationCreate(self, params): vm = API.VM(params['vmId']) return vm.migrationCreate(params) @@ -616,6 +624,10 @@ api = API.Global() return api.setMOMPolicyParameters(key_value_store) + def setKsmTune(self, tuningParams): + api = API.Global() + return api.setKsmTune(tuningParams) + def setHaMaintenanceMode(self, mode, enabled): api = API.Global() return api.setHaMaintenanceMode(mode, enabled) -- To view, visit https://gerrit.ovirt.org/41571 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd318b50abf8605c2584cb3b5316e2ca2ac4f5ef Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Sivák <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
