svn commit: r241150 - projects/bhyve/sys/boot/userboot/userboot

Peter Grehan grehan at FreeBSD.org
Wed Oct 3 02:58:56 UTC 2012


Author: grehan
Date: Wed Oct  3 02:58:55 2012
New Revision: 241150
URL: http://svn.freebsd.org/changeset/base/241150

Log:
  Restore the ability to boot partitioned disks. The previous submit
  broke that by forcing raw disks, due to the use of error returns
  by userboot's initial disk opens.

Modified:
  projects/bhyve/sys/boot/userboot/userboot/userboot_disk.c

Modified: projects/bhyve/sys/boot/userboot/userboot/userboot_disk.c
==============================================================================
--- projects/bhyve/sys/boot/userboot/userboot/userboot_disk.c	Wed Oct  3 02:32:47 2012	(r241149)
+++ projects/bhyve/sys/boot/userboot/userboot/userboot_disk.c	Wed Oct  3 02:58:55 2012	(r241150)
@@ -103,7 +103,6 @@ userdisk_open(struct open_file *f, ...)
 {
 	va_list			ap;
 	struct disk_devdesc	*dev;
-	int			rc;
 
 	va_start(ap, f);
 	dev = va_arg(ap, struct disk_devdesc *);
@@ -112,15 +111,11 @@ userdisk_open(struct open_file *f, ...)
 	if (dev->d_unit < 0 || dev->d_unit >= userboot_disk_maxunit)
 		return (EIO);
 
-	rc = disk_open(dev);
-
-	/*
-	 * No MBR/GPT - assume a raw disk image
-	 */
-	if (rc)
+	if (dev->d_slice == -1 && dev->d_partition == -1) {
 		dev->d_offset = 0;
-
-	return (0);
+		return (0);
+	} else
+		return (disk_open(dev));
 }
 
 static int


More information about the svn-src-projects mailing list