]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: nodedev: Rename virNodeDeviceCapMatch to virNodeDevObjHasCap
authorErik Skultety <eskultet@redhat.com>
Thu, 11 Jan 2018 12:43:29 +0000 (13:43 +0100)
committerErik Skultety <eskultet@redhat.com>
Mon, 29 Jan 2018 14:34:30 +0000 (15:34 +0100)
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@redhat.com>
src/conf/virnodedeviceobj.c

index a4d38b3a1ceb0a751cd395b8e8e494747a9ce41d..cf7f45e4bfb4cc019d046db0235a21d3c92dcb46 100644 (file)
@@ -53,8 +53,7 @@ static virClassPtr virNodeDeviceObjClass;
 static virClassPtr virNodeDeviceObjListClass;
 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 +682,8 @@ virNodeDeviceObjListGetParentHost(virNodeDeviceObjListPtr devs,
 
 
 static bool
-virNodeDeviceCapMatch(virNodeDeviceObjPtr obj,
-                      int type)
+virNodeDeviceObjHasCap(const virNodeDeviceObj *obj,
+                       int type)
 {
     virNodeDevCapsDefPtr cap = NULL;
 
@@ -850,7 +849,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)