From: Ian Campbell <ijc@hellion.org.uk>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: Please support installation on Xen virtual block devices
Date: Wed, 07 May 2008 19:51:40 +0100 [thread overview]
Message-ID: <1210186300.18090.16.camel@localhost.localdomain> (raw)
In-Reply-To: <1210181595.2321.22.camel@dv>
[-- Attachment #1.1: Type: text/plain, Size: 755 bytes --]
On Wed, 2008-05-07 at 13:33 -0400, Pavel Roskin wrote:
> Apparently, it was copied from the code that was inside an extra "for"
> loop. Anyway, it's a very minor issue, and I would just apply the patch
> right now, but I prefer not to write changelog entries for others.
Sorry about that. An updated version is attached with changelog and
(hopefully) correct indentation.
I wasn't sure about the pre-processor conditionals, there seems to be
lots of existing ifdef __linux__ in there and the device path is pretty
Linux specific. I merged it into the one above but if you want them gone
I will redo.
Ian.
--
Ian Campbell
omnibiblious, adj.:
Indifferent to type of drink. Ex: "Oh, you can get me anything.
I'm omnibiblious."
[-- Attachment #1.2: support-xvd-v2.diff --]
[-- Type: text/x-patch, Size: 2361 bytes --]
diff -purN -X /home/ijc/development/dontdiff.txt grub2-1.96+20080430.orig/ChangeLog grub2-1.96+20080430/ChangeLog
--- grub2-1.96+20080430.orig/ChangeLog 2008-04-30 12:06:26.000000000 +0100
+++ grub2-1.96+20080430/ChangeLog 2008-05-07 19:41:10.000000000 +0100
@@ -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-04-30 Robert Millan <rmh@aybabtu.com>
Based on patch from Fabian Greffrath <greffrath@leat.rub.de>
diff -purN -X /home/ijc/development/dontdiff.txt grub2-1.96+20080430.orig/util/biosdisk.c grub2-1.96+20080430/util/biosdisk.c
--- grub2-1.96+20080430.orig/util/biosdisk.c 2008-04-07 16:00:27.000000000 +0100
+++ grub2-1.96+20080430/util/biosdisk.c 2008-05-07 19:34:42.000000000 +0100
@@ -645,6 +645,13 @@ get_os_disk (const char *os_dev)
return path;
}
+ if ((strncmp ("xvd", p, 3) == 0) && p[3] >= 'a' && p[3] <= 'z')
+ {
+ /* /dev/xvd[a-z][0-9]* */
+ p[4] = '\0';
+ return path;
+ }
+
/* If this is an IDE disk or a SCSI disk. */
if ((strncmp ("hd", p, 2) == 0
|| strncmp ("sd", p, 2) == 0)
diff -purN -X /home/ijc/development/dontdiff.txt grub2-1.96+20080430.orig/util/grub-mkdevicemap.c grub2-1.96+20080430/util/grub-mkdevicemap.c
--- grub2-1.96+20080430.orig/util/grub-mkdevicemap.c 2008-04-06 18:51:55.000000000 +0100
+++ grub2-1.96+20080430/util/grub-mkdevicemap.c 2008-05-07 19:49:26.000000000 +0100
@@ -273,6 +273,12 @@ get_i2o_disk_name (char *name, char unit
{
sprintf (name, "/dev/i2o/hd%c", unit);
}
+
+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,
@@ -513,6 +519,22 @@ make_device_map (const char *device_map,
}
}
}
+
+ /* Xen Virtual Disks. */
+ 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__ */
finish:
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2008-05-07 18:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-24 19:28 Please support installation on Xen virtual block devices Ian Campbell
2008-05-06 15:29 ` Ian Campbell
2008-05-06 21:33 ` Pavel Roskin
2008-05-07 12:43 ` Robert Millan
2008-05-07 17:33 ` Pavel Roskin
2008-05-07 18:51 ` Ian Campbell [this message]
2008-05-07 20:49 ` Pavel Roskin
2008-05-07 21:07 ` Ian Campbell
2008-05-09 12:53 ` Robert Millan
2008-05-10 12:03 ` Ian Campbell
2008-05-11 5:35 ` Pavel Roskin
2008-05-12 15:33 ` Robert Millan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1210186300.18090.16.camel@localhost.localdomain \
--to=ijc@hellion.org.uk \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.