]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2008-05-07 Ian Campbell <ijc@hellion.org.uk>
authorproski <proski@localhost>
Wed, 7 May 2008 20:46:57 +0000 (20:46 +0000)
committerproski <proski@localhost>
Wed, 7 May 2008 20:46:57 +0000 (20:46 +0000)
* 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.

ChangeLog
util/biosdisk.c
util/grub-mkdevicemap.c

index 7570f79b1fc346ead2dc0ed2c9e6ba3697190fae..6a8e341c87698abd468cf8cf725994dab215ee55 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
 2008-05-07  Robert Millan  <rmh@aybabtu.com>
 
        * util/biosdisk.c (linux_find_partition, get_os_disk): Handle CCISS
index 3b8b9e0897bb4e2633765a543f696f4e6081e80f..c4ee7c14a335a0e84726941704914626429fd8fb 100644 (file)
@@ -677,6 +677,14 @@ get_os_disk (const char *os_dev)
          p[3] = '\0';
          return path;
        }
+
+      /* If this is a Xen virtual block device.  */
+      if ((strncmp ("xvd", p, 3) == 0) && p[3] >= 'a' && p[3] <= 'z')
+       {
+         /* /dev/xvd[a-z][0-9]* */
+         p[4] = '\0';
+         return path;
+       }
     }
 
   return path;
index 12729812a606297f749b2e92c2e8ff4ee012e86a..19d6747bfb8e68e48814d2d30f908b46e8725a08 100644 (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.  */