2009-07-31 Bean <bean123ch@gmail.com>

* disk/lvm.c (grub_lvm_scan_device): Ignore extra copy of metadata.
	Don't change pv->disk if it's already set.

	* disk/raid.c (grub_raid_scan_device): Merge this function into ...
	(grub_raid_register): ... here.
	(grub_raid_rescan): Removed.

	* include/grub/raid.h (grub_raid_rescan): Removed.

	* util/grub-fstest.c: Remove include file <grub/raid.h>.
	(fstest): Replace grub_raid_rescan with module fini function followed
	by init function.

	* util/grub-probe.c: Add include file <grub/raid.h>.
	(probe_raid_level): New function.
	(probe): Detect abstraction by walking the disk device, support two
	level of abstraction (LVM on RAID) when detecting partition map.
This commit is contained in:
bean 2009-07-31 14:25:19 +00:00
parent 24443b5a47
commit f45d6cfc48
6 changed files with 139 additions and 93 deletions

View file

@ -271,15 +271,9 @@ grub_lvm_scan_device (const char *name)
dlocn++;
mda_offset = grub_le_to_cpu64 (dlocn->offset);
mda_size = grub_le_to_cpu64 (dlocn->size);
dlocn++;
if (dlocn->offset)
{
grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
"We don't support multiple LVM metadata areas");
goto fail;
}
/* It's possible to have multiple copies of metadata areas, we just use the
first one. */
/* Allocate buffer space for the circular worst-case scenario. */
metadatabuf = grub_malloc (2 * mda_size);
@ -564,7 +558,10 @@ grub_lvm_scan_device (const char *name)
{
if (! grub_memcmp (pv->id, pv_id, GRUB_LVM_ID_STRLEN))
{
pv->disk = grub_disk_open (name);
/* This could happen to LVM on RAID, pv->disk points to the
raid device, we shouldn't change it. */
if (! pv->disk)
pv->disk = grub_disk_open (name);
break;
}
}