]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/kern/emu/misc.c (grub_device_mapper_supported): Move from
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 14 Aug 2013 15:55:15 +0000 (17:55 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 14 Aug 2013 15:55:15 +0000 (17:55 +0200)
here ...
* grub-core/kern/emu/hostdisk.c (grub_device_mapper_supported): ... to
here.

ChangeLog
grub-core/kern/emu/hostdisk.c
grub-core/kern/emu/misc.c

index 57e64c2dc77ddb6337b11dec7b6e88286f865d29..94a23607ffe8dc90102334a87636b3530cbddccb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-08-14  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/kern/emu/misc.c (grub_device_mapper_supported): Move from
+       here ...
+       * grub-core/kern/emu/hostdisk.c (grub_device_mapper_supported): ... to
+       here.
+
 2013-08-14  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * include/grub/i386/pc/biosdisk.h (grub_biosdisk_drp): Fix device_path
index 31423326cbd3c6c1771f38e82d019173aa89bd5a..3dbc6ca3fa722a3380b6bcdd2d273f46ce499425 100644 (file)
@@ -404,6 +404,41 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk)
 #endif
 }
 
+#ifdef HAVE_DEVICE_MAPPER
+static void device_mapper_null_log (int level __attribute__ ((unused)),
+                                   const char *file __attribute__ ((unused)),
+                                   int line __attribute__ ((unused)),
+                                   int dm_errno __attribute__ ((unused)),
+                                   const char *f __attribute__ ((unused)),
+                                   ...)
+{
+}
+
+int
+grub_device_mapper_supported (void)
+{
+  static int supported = -1;
+
+  if (supported == -1)
+    {
+      struct dm_task *dmt;
+
+      /* Suppress annoying log messages.  */
+      dm_log_with_errno_init (&device_mapper_null_log);
+
+      dmt = dm_task_create (DM_DEVICE_VERSION);
+      supported = (dmt != NULL);
+      if (dmt)
+       dm_task_destroy (dmt);
+
+      /* Restore the original logger.  */
+      dm_log_with_errno_init (NULL);
+    }
+
+  return supported;
+}
+#endif /* HAVE_DEVICE_MAPPER */
+
 int
 grub_util_device_is_mapped (const char *dev)
 {
index dc0a3952144eaf41fbb808a9a0463b8ba9b33038..c1668bad57454bd08dc6564db7c3d0e5a3524aa0 100644 (file)
@@ -207,37 +207,3 @@ canonicalize_file_name (const char *path)
   return ret;
 }
 
-#ifdef HAVE_DEVICE_MAPPER
-static void device_mapper_null_log (int level __attribute__ ((unused)),
-                                   const char *file __attribute__ ((unused)),
-                                   int line __attribute__ ((unused)),
-                                   int dm_errno __attribute__ ((unused)),
-                                   const char *f __attribute__ ((unused)),
-                                   ...)
-{
-}
-
-int
-grub_device_mapper_supported (void)
-{
-  static int supported = -1;
-
-  if (supported == -1)
-    {
-      struct dm_task *dmt;
-
-      /* Suppress annoying log messages.  */
-      dm_log_with_errno_init (&device_mapper_null_log);
-
-      dmt = dm_task_create (DM_DEVICE_VERSION);
-      supported = (dmt != NULL);
-      if (dmt)
-       dm_task_destroy (dmt);
-
-      /* Restore the original logger.  */
-      dm_log_with_errno_init (NULL);
-    }
-
-  return supported;
-}
-#endif /* HAVE_DEVICE_MAPPER */