Martin Polednik has uploaded a new change for review.

Change subject: hostdev: make caps in listByCaps truly optional
......................................................................

hostdev: make caps in listByCaps truly optional

In order to make the api cleaner, removes the need to specify the
caps parameter (defaulting to None which means all devices)

Change-Id: Ifc4f5ff217a12f0ffe3d75eec1e6c25c6d211fd7
Signed-off-by: Martin Polednik <mpoled...@redhat.com>
---
M vdsm/API.py
M vdsm/rpc/BindingXMLRPC.py
M vdsm/rpc/vdsmapi-schema.json
3 files changed, 5 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/67/35867/1

diff --git a/vdsm/API.py b/vdsm/API.py
index 6c35cfb..1be4147 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -1296,7 +1296,7 @@
         statsList = hooks.after_get_all_vm_stats(statsList)
         return {'status': doneCode, 'statsList': statsList}
 
-    def hostdevListByCaps(self, caps):
+    def hostdevListByCaps(self, caps=None):
         devices = hostdev.list_by_caps(self._cif.vmContainer, caps)
         return {'status': doneCode, 'deviceList': devices}
 
diff --git a/vdsm/rpc/BindingXMLRPC.py b/vdsm/rpc/BindingXMLRPC.py
index ec223e8..868d8ad 100644
--- a/vdsm/rpc/BindingXMLRPC.py
+++ b/vdsm/rpc/BindingXMLRPC.py
@@ -486,7 +486,7 @@
         api = API.Global()
         return api.getAllVmStats()
 
-    def hostdevListByCaps(self, caps):
+    def hostdevListByCaps(self, caps=None):
         api = API.Global()
         return api.hostdevListByCaps(caps)
 
diff --git a/vdsm/rpc/vdsmapi-schema.json b/vdsm/rpc/vdsmapi-schema.json
index edca1a9..f58eca4 100644
--- a/vdsm/rpc/vdsmapi-schema.json
+++ b/vdsm/rpc/vdsmapi-schema.json
@@ -3798,7 +3798,8 @@
 #
 # Refresh and get information about devices available on the host
 #
-# @caps:            List of capabilities of devices to fetch
+# @caps:            @optional List of capabilities of devices to fetch
+#                   Empty means all device capabilities.
 #
 # Returns:
 # A list of devices on the host
@@ -3806,7 +3807,7 @@
 # Since: 4.17.0
 ##
 {'command': {'class': 'Host', 'name': 'hostdevListByCaps'},
- 'data': {'caps': ['str']},
+ 'data': {'*caps': ['str']},
  'returns': ['HostDevices']}
 
 ##


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

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

Reply via email to