2008-05-09 Robert Millan <rmh@aybabtu.com>

* util/biosdisk.c (linux_find_partition, get_os_disk): Handle Virtio
        devices.
        * util/grub-mkdevicemap.c (get_virtio_disk_name)
        (make_device_map): Likewise.
        Reported by Aurelien Jarno <aurel32@debian.org>
This commit is contained in:
robertmh 2008-05-09 12:13:03 +00:00
parent ed7593907d
commit 1cf4059a49
3 changed files with 34 additions and 2 deletions

View file

@ -227,6 +227,7 @@ linux_find_partition (char *dev, unsigned long sector)
format = "part%d";
}
else if ((strncmp (real_dev + 5, "hd", 2) == 0
|| strncmp (real_dev + 5, "vd", 2) == 0
|| strncmp (real_dev + 5, "sd", 2) == 0)
&& real_dev[7] >= 'a' && real_dev[7] <= 'z')
{
@ -668,12 +669,13 @@ get_os_disk (const char *os_dev)
return path;
}
/* If this is an IDE disk or a SCSI disk. */
/* If this is an IDE, SCSI or Virtio disk. */
if ((strncmp ("hd", p, 2) == 0
|| strncmp ("vd", p, 2) == 0
|| strncmp ("sd", p, 2) == 0)
&& p[2] >= 'a' && p[2] <= 'z')
{
/* /dev/[hs]d[a-z][0-9]* */
/* /dev/[hsv]d[a-z][0-9]* */
p[3] = '\0';
return path;
}