* 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 2013-08-14 17:55:15 +02:00
parent b828fb5d9c
commit f0b94ded6d
3 changed files with 42 additions and 34 deletions

View file

@ -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> 2013-08-14 Vladimir Serbinenko <phcoder@gmail.com>
* include/grub/i386/pc/biosdisk.h (grub_biosdisk_drp): Fix device_path * include/grub/i386/pc/biosdisk.h (grub_biosdisk_drp): Fix device_path

View file

@ -404,6 +404,41 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk)
#endif #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 int
grub_util_device_is_mapped (const char *dev) grub_util_device_is_mapped (const char *dev)
{ {

View file

@ -207,37 +207,3 @@ canonicalize_file_name (const char *path)
return ret; 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 */