Blob Blame History Raw
From 4e021109613173e72df17eca6bff970ebb86b47f Mon Sep 17 00:00:00 2001
Message-Id: <4e021109613173e72df17eca6bff970ebb86b47f@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Mon, 27 Jul 2020 12:36:50 +0200
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)

https://bugzilla.redhat.com/show_bug.cgi?id=1860421

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Message-Id: <2b5410a10bb23e8a9526c663052afbb6f37b0a0c.1595846084.git.mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@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 40a82285f9..118dc82e94 100644
--- a/src/util/virdevmapper.c
+++ b/src/util/virdevmapper.c
@@ -195,19 +195,7 @@ virDevMapperGetTargets(const char *path,
     return virDevMapperGetTargetsImpl(path, devPaths, ttl);
 }
 
-#else /* ! WITH_DEVMAPPER */
-
-int
-virDevMapperGetTargets(const char *path G_GNUC_UNUSED,
-                       char ***devPaths G_GNUC_UNUSED)
-{
-    errno = ENOSYS;
-    return -1;
-}
-#endif /* ! WITH_DEVMAPPER */
 
-
-#if WITH_DEVMAPPER
 bool
 virIsDevMapperDevice(const char *dev_name)
 {
@@ -223,6 +211,15 @@ virIsDevMapperDevice(const char *dev_name)
 
 #else /* ! WITH_DEVMAPPER */
 
+int
+virDevMapperGetTargets(const char *path G_GNUC_UNUSED,
+                       char ***devPaths G_GNUC_UNUSED)
+{
+    errno = ENOSYS;
+    return -1;
+}
+
+
 bool
 virIsDevMapperDevice(const char *dev_name G_GNUC_UNUSED)
 {
-- 
2.28.0