]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Make detect_scsi_host_caps a function on all architectures
authorGuido Günther <agx@sigxcpu.org>
Fri, 3 May 2013 06:03:26 +0000 (08:03 +0200)
committerEric Blake <eblake@redhat.com>
Mon, 6 May 2013 20:20:33 +0000 (14:20 -0600)
In the non linux case some callers like gather_scsi_host_caps needed the
return code of -1 while others like update_caps needed an empty
statement (to avoid a "statement without effect" warning). This is much
simpler solved by using a function instead of a define.
(cherry picked from commit 58662f44165ccbffee95b4911a7eec49975bde0b)

src/node_device/node_device_driver.h
src/node_device/node_device_linux_sysfs.c

index b6c6f182d3f3f450d7ba3be654866cbdf52e2737..9e97b7d2448d7397bbc7e5766a2a2ffe714bf82b 100644 (file)
@@ -51,16 +51,7 @@ void nodeDeviceUnlock(virNodeDeviceDriverStatePtr driver);
 
 int nodedevRegister(void);
 
-# ifdef __linux__
-
-#  define detect_scsi_host_caps(d) detect_scsi_host_caps_linux(d)
-int detect_scsi_host_caps_linux(union _virNodeDevCapData *d);
-
-# else  /* __linux__ */
-
-#  define detect_scsi_host_caps(d)                      (-1)
-
-# endif /* __linux__ */
+int detect_scsi_host_caps(union _virNodeDevCapData *d);
 
 int nodeNumOfDevices(virConnectPtr conn, const char *cap, unsigned int flags);
 int nodeListDevices(virConnectPtr conn, const char *cap, char **const names,
index fd9143062056745d979bffcf4f2bf403afdb805f..0c8461936434d182e1ac256999560cd9b160f865 100644 (file)
@@ -38,7 +38,7 @@
 #ifdef __linux__
 
 int
-detect_scsi_host_caps_linux(union _virNodeDevCapData *d)
+detect_scsi_host_caps(union _virNodeDevCapData *d)
 {
     char *max_vports = NULL;
     char *vports = NULL;
@@ -127,4 +127,12 @@ cleanup:
     return ret;
 }
 
+#else
+
+int
+detect_scsi_host_caps(union _virNodeDevCapData *d ATTRIBUTE_UNUSED)
+{
+    return -1;
+}
+
 #endif /* __linux__ */