[PATCH 02/15] conf: nodedev: Rename virNodeDeviceCapMatch to virNodeDevObjHasCap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We currently have 2 methods that do the capability matching. This should
be condensed to a single function and all the derivates should just call
into that using a proper type conversion.

Signed-off-by: Erik Skultety <eskultet@xxxxxxxxxx>
---
 src/conf/virnodedeviceobj.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c
index a4d38b3a1..ccad59a4b 100644
--- a/src/conf/virnodedeviceobj.c
+++ b/src/conf/virnodedeviceobj.c
@@ -55,6 +55,8 @@ static void virNodeDeviceObjDispose(void *opaque);
 static void virNodeDeviceObjListDispose(void *opaque);
 static bool virNodeDeviceObjHasCapStr(const virNodeDeviceObj *obj,
                                       const char *cap);
+static bool virNodeDeviceObjHasCap(const virNodeDeviceObj *obj,
+                                   int type);
 
 static int
 virNodeDeviceObjOnceInit(void)
@@ -683,8 +685,8 @@ virNodeDeviceObjListGetParentHost(virNodeDeviceObjListPtr devs,
 
 
 static bool
-virNodeDeviceCapMatch(virNodeDeviceObjPtr obj,
-                      int type)
+virNodeDeviceObjHasCap(const virNodeDeviceObj *obj,
+                       int type)
 {
     virNodeDevCapsDefPtr cap = NULL;
 
@@ -850,7 +852,7 @@ virNodeDeviceObjListGetNames(virNodeDeviceObjListPtr devs,
 
 
 #define MATCH(FLAG) ((flags & (VIR_CONNECT_LIST_NODE_DEVICES_CAP_ ## FLAG)) && \
-                     virNodeDeviceCapMatch(obj, VIR_NODE_DEV_CAP_ ## FLAG))
+                     virNodeDeviceObjHasCap(obj, VIR_NODE_DEV_CAP_ ## FLAG))
 static bool
 virNodeDeviceMatch(virNodeDeviceObjPtr obj,
                    unsigned int flags)
-- 
2.13.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux