Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Oct 2012 02:58:55 +0000 (UTC)
From:      Peter Grehan <grehan@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r241150 - projects/bhyve/sys/boot/userboot/userboot
Message-ID:  <201210030258.q932wt0r047757@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210030258.q932wt0r047757>