2008-05-07 Ian Campbell <ijc@hellion.org.uk>

* util/biosdisk.c (get_os_disk): Recognise xvd type disks.
	* util/grub-mkdevicemap.c (get_xvd_disk_name): New function.
	(make_device_map): Output entries for xvd type disks.
This commit is contained in:
proski 2008-05-07 20:46:57 +00:00
parent b56c4eaa3f
commit ed7593907d
3 changed files with 36 additions and 0 deletions

View file

@ -289,6 +289,12 @@ get_cciss_disk_name (char *name, int controller, int drive)
{
sprintf (name, "/dev/cciss/c%dd%d", controller, drive);
}
static void
get_xvd_disk_name (char *name, int unit)
{
sprintf (name, "/dev/xvd%c", unit + 'a');
}
#endif
/* Check if DEVICE can be read. If an error occurs, return zero,
@ -464,6 +470,22 @@ make_device_map (const char *device_map, int floppy_disks)
num_hd++;
}
}
/* Xen virtual block devices. */
for (i = 0; i < 16; i++)
{
char name[16];
get_xvd_disk_name (name, i);
if (check_device (name))
{
char *p;
p = grub_util_get_disk_name (num_hd, name);
fprintf (fp, "(%s)\t%s\n", p, name);
free (p);
num_hd++;
}
}
#endif /* __linux__ */
/* The rest is SCSI disks. */