Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Sep 2008 15:00:30 +0100
From:      Bruce M Simpson <bms@incunabulum.net>
To:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   [PATCH] Fix get max luns delay for QEMU USB disks
Message-ID:  <48CE6A7E.8010306@incunabulum.net>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------070109030907050207000703
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

QEMU will allow you to emulate umass devices using files.

However it does so with a VID/PID of 0, and does not support "get max 
lun" which causes a brief hang on boot.

This patch is against RELENG_7 but you get the general idea.

Any objections?

BMS

--------------070109030907050207000703
Content-Type: text/plain;
 name="qemu-umass.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="qemu-umass.diff"

--- umass.c.orig	2008-09-15 14:35:10.000000000 +0100
+++ umass.c	2008-09-15 14:34:18.000000000 +0100
@@ -822,6 +822,10 @@
 	  UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
 	  NO_QUIRKS
 	},
+	{ USB_VENDOR_UNKNOWN0, USB_PRODUCT_UNKNOWN0_UNKNOWN0, RID_WILDCARD,
+	  UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
+	  NO_GETMAXLUN
+	},
 	{ USB_VENDOR_VIA, USB_PRODUCT_VIA_USB2IDEBRIDGE, RID_WILDCARD,
 	  UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
 	  NO_SYNCHRONIZE_CACHE
--- usbdevs.orig	2008-09-15 14:31:04.000000000 +0100
+++ usbdevs	2008-09-15 14:32:09.000000000 +0100
@@ -62,6 +62,7 @@
  * make the device recognised by the appropriate device driver.
  */
 
+vendor UNKNOWN0		0x0000	Unknown vendor
 vendor UNKNOWN1		0x0053	Unknown vendor
 vendor UNKNOWN2		0x0105	Unknown vendor
 vendor EGALAX2		0x0123	eGalax, Inc.
@@ -2291,6 +2292,9 @@
 /* VIA Technologies products */
 product VIA USB2IDEBRIDGE	0x6204	USB 2.0 IDE Bridge
 
+/* Unknown vendor: QEMU typically presents zeroed VID/PID for disk images */
+product UNKNOWN0 UNKNOWN0	0x0000	Unknown device
+
 /* USI products */
 product USI MC60		0x10c5	MC60 Serial
 

--------------070109030907050207000703--



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