From b578178e72373c13f4e1e819793e28b9d39fc2f2 Mon Sep 17 00:00:00 2001
Message-Id: <b578178e72373c13f4e1e819793e28b9d39fc2f2@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Mon, 8 Mar 2021 12:57:29 +0100
Subject: [PATCH] virdevmapper.c: Join two WITH_DEVMAPPER sections together
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
There are two distinct WITH_DEVMAPPER sections in the file, for
different functions each. Rearrange the code to make some of
future commits smaller.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit ae5752aabc09f435675504246e30a0b9c4795d79)
Conflicts:
-src/util/virdevmapper.c: The old code uses ATTRIBUTE_UNUSED, the
cherry picked commit used G_GNUC_UNUSED because of commit
679f8b3994457f7801b470b7c6a3379d844d0f79 which is not backported.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1933557
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Message-Id: <675e510b0dfca0f4b4f3dc3ed3952b763182bad3.1615203117.git.mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
src/util/virdevmapper.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/src/util/virdevmapper.c b/src/util/virdevmapper.c
index c69830ac70..6aee00112c 100644
--- a/src/util/virdevmapper.c
+++ b/src/util/virdevmapper.c
@@ -201,19 +201,7 @@ virDevMapperGetTargets(const char *path,
return virDevMapperGetTargetsImpl(path, devPaths, ttl);
}
-#else /* ! WITH_DEVMAPPER */
-
-int
-virDevMapperGetTargets(const char *path ATTRIBUTE_UNUSED,
- char ***devPaths ATTRIBUTE_UNUSED)
-{
- errno = ENOSYS;
- return -1;
-}
-#endif /* ! WITH_DEVMAPPER */
-
-#if WITH_DEVMAPPER
bool
virIsDevMapperDevice(const char *dev_name)
{
@@ -229,6 +217,15 @@ virIsDevMapperDevice(const char *dev_name)
#else /* ! WITH_DEVMAPPER */
+int
+virDevMapperGetTargets(const char *path ATTRIBUTE_UNUSED,
+ char ***devPaths ATTRIBUTE_UNUSED)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
bool
virIsDevMapperDevice(const char *dev_name G_GNUC_UNUSED)
{
--
2.31.0