[PATCH] Fix get max luns delay for QEMU USB disks

Bruce M Simpson bms at incunabulum.net
Mon Sep 15 14:15:53 UTC 2008


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
-------------- next part --------------
--- 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
 


More information about the freebsd-current mailing list