* 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.
This commit is contained in:
Vladimir 'phcoder' Serbinenko committed 2013-08-14 17:55:15 +02:00
1 parent b828fb5d9c
commit f0b94ded6d
3 files changed
+42 -34

No files matched your search

+35
View 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)
{
-34
View 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 */