socsvn commit: r257162 - soc2013/zcore/head/usr.sbin/bhyve

zcore at FreeBSD.org zcore at FreeBSD.org
Mon Sep 9 14:28:09 UTC 2013


Author: zcore
Date: Mon Sep  9 14:28:08 2013
New Revision: 257162
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257162

Log:
  consider the device as ATAPI if the file's suffix is .iso

Modified:
  soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c

Modified: soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c
==============================================================================
--- soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c	Mon Sep  9 14:27:18 2013	(r257161)
+++ soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c	Mon Sep  9 14:28:08 2013	(r257162)
@@ -773,12 +773,22 @@
 	sc->ports = MAX_PORTS;
 
 	for (i = 0; i < sc->ports; i++) {
+		int len, suflen;
+		char suf[] = ".iso";
 		char bident[sizeof("XX:X:X")];
 		struct blockif_ctxt *bctxt;
 
 		fstr = strsep(&str, ",");
 		if (fstr == NULL)
 			break;
+
+		/* we consider it as ATAPI if the file's suffix is .iso */
+		len = strlen(fstr);
+		suflen = strlen(suf);
+		if (len > suflen &&
+			!strncmp(fstr + len - suflen, suf, suflen))
+			sc->port[i].atapi = 1;
+
 		/*
 		 * Attempt to open the backing image. Use the PCI
 		 * slot/func/ahci_port for the identifier string


More information about the svn-soc-all mailing list