mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +00:00
Make detect_scsi_host_caps a function on all architectures
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 58662f4416
)
This commit is contained in:
parent
4a4d2300ff
commit
3b8f6e5fd6
@ -51,16 +51,7 @@ void nodeDeviceUnlock(virNodeDeviceDriverStatePtr driver);
|
|||||||
|
|
||||||
int nodedevRegister(void);
|
int nodedevRegister(void);
|
||||||
|
|
||||||
# ifdef __linux__
|
int detect_scsi_host_caps(union _virNodeDevCapData *d);
|
||||||
|
|
||||||
# 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 nodeNumOfDevices(virConnectPtr conn, const char *cap, unsigned int flags);
|
int nodeNumOfDevices(virConnectPtr conn, const char *cap, unsigned int flags);
|
||||||
int nodeListDevices(virConnectPtr conn, const char *cap, char **const names,
|
int nodeListDevices(virConnectPtr conn, const char *cap, char **const names,
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
|
|
||||||
int
|
int
|
||||||
detect_scsi_host_caps_linux(union _virNodeDevCapData *d)
|
detect_scsi_host_caps(union _virNodeDevCapData *d)
|
||||||
{
|
{
|
||||||
char *max_vports = NULL;
|
char *max_vports = NULL;
|
||||||
char *vports = NULL;
|
char *vports = NULL;
|
||||||
@ -127,4 +127,12 @@ cleanup:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
int
|
||||||
|
detect_scsi_host_caps(union _virNodeDevCapData *d ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* __linux__ */
|
#endif /* __linux__ */
|
||||||
|
Loading…
Reference in New Issue
Block a user