Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
libvirt
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Libvirt Packaging Team
libvirt
Commits
51548502
Commit
51548502
authored
12 years ago
by
Guido Günther
Browse files
Options
Downloads
Patches
Plain Diff
Make detect_scsi_host_caps a function on all architectures
Another kFreeBSD build fix
parent
031648a3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
debian/patches/Make-detect_scsi_host_caps-a-function-on-all-archite.patch
+61
-0
61 additions, 0 deletions
...ake-detect_scsi_host_caps-a-function-on-all-archite.patch
debian/patches/series
+1
-0
1 addition, 0 deletions
debian/patches/series
with
62 additions
and
0 deletions
debian/patches/Make-detect_scsi_host_caps-a-function-on-all-archite.patch
0 → 100644
+
61
−
0
View file @
51548502
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Fri, 3 May 2013 08:03:26 +0200
Subject: 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 emtpy
statement (to avoid a "statement without effect" warning). This is much
simpler solved by using a function instead of a define.
---
src/node_device/node_device_driver.h | 11 +----------
src/node_device/node_device_linux_sysfs.c | 10 +++++++++-
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/src/node_device/node_device_driver.h b/src/node_device/node_device_driver.h
index b6c6f18..9e97b7d 100644
--- a/src/node_device/node_device_driver.h
+++ b/src/node_device/node_device_driver.h
@@ -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,
diff --git a/src/node_device/node_device_linux_sysfs.c b/src/node_device/node_device_linux_sysfs.c
index fd91430..0c84619 100644
--- a/src/node_device/node_device_linux_sysfs.c
+++ b/src/node_device/node_device_linux_sysfs.c
@@ -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__ */
This diff is collapsed.
Click to expand it.
debian/patches/series
+
1
−
0
View file @
51548502
...
...
@@ -14,3 +14,4 @@ virthreadpthread-don-t-try-to-cast-pthread_t-to-void.patch
Add-sanitytest.py.patch
virInitctlRequest-Don-t-hardcode-384-bytes-size.patch
Fixup-rpcgen-code-on-kFreeBSD-too.patch
Make-detect_scsi_host_caps-a-function-on-all-archite.patch
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment