All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] USB storage cannot be recognized on guest Linux domain?
@ 2007-02-14  7:05 Yu, Xiaoyang
  2007-02-14 10:26 ` Yu, Xiaoyang
  0 siblings, 1 reply; 11+ messages in thread
From: Yu, Xiaoyang @ 2007-02-14  7:05 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 652 bytes --]

I am using Xen 3.0.3 with QEMU-DM 0.8.2 on a Intel VT platform. After
insert a USB storage, and use "usb_add" command in QEMU monitor, the
storage should be recognized on guest OS. I tested this with a Windows
XP SP2 guest OS, it doing well. 

 

But when I test the "usb_add" command with some Linux guest OS, it seems
that the guest OS cannot recognize the USB storage. And the device
number and address in guest domain are always "0.0". The Linux guest OS
I tested including Fedora Core 4 and Fedora Core 5. Does any one also
meet this problem or have some idea on this? Feedbacks will be highly
appreciated.

 

Thanks
Xiaoyang


[-- Attachment #2: Type: text/html, Size: 2445 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [Qemu-devel] USB storage cannot be recognized on guest Linux domain?
  2007-02-14  7:05 [Qemu-devel] USB storage cannot be recognized on guest Linux domain? Yu, Xiaoyang
@ 2007-02-14 10:26 ` Yu, Xiaoyang
  2007-02-14 11:27   ` AW: [Qemu-devel] USB storage cannot be recognized on guest Linuxdomain? Nenad Cimerman
  2007-02-14 15:00   ` [Qemu-devel] USB storage cannot be recognized on guest Linux domain? Lonnie Mendez
  0 siblings, 2 replies; 11+ messages in thread
From: Yu, Xiaoyang @ 2007-02-14 10:26 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1621 bytes --]

I just found that using an older kernel in Fedora Core 4 may “solve” the problem. 

 

When I tested Fedora Core 4 guest domain, the kernel version I used was 2.6.17-1.2142_FC4, and it cannot recognized the USB disk. 



I just changed the kernel in guest domain to version 2.6.11-1.1369_FC4. Then the guest domain can recognized the USB disk. I am wondering why the USB support in QEMU depend on the guest domain kernel. And I would like to know which kernel version can support QEMU USB emulation.

 

BTW, I also found that Windows XP guest domain can not recognize the USB disk, while Windows XP SP2 guest domain can recognize the USB disk. So it seems like that the guest Linux/Windows domain should have some “special feature” to work with the QEMU USB emulation successfully. Isn’t it strange?

 

 

Sent: 2007年2月14日 15:06
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] USB storage cannot be recognized on guest Linux domain?

 

I am using Xen 3.0.3 with QEMU-DM 0.8.2 on a Intel VT platform. After insert a USB storage, and use “usb_add” command in QEMU monitor, the storage should be recognized on guest OS. I tested this with a Windows XP SP2 guest OS, it doing well. 

 

But when I test the “usb_add” command with some Linux guest OS, it seems that the guest OS cannot recognize the USB storage. And the device number and address in guest domain are always “0.0”. The Linux guest OS I tested including Fedora Core 4 and Fedora Core 5. Does any one also meet this problem or have some idea on this? Feedbacks will be highly appreciated.

 

Thanks
Xiaoyang


[-- Attachment #2: Type: text/html, Size: 5917 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* AW: [Qemu-devel] USB storage cannot be recognized on guest Linuxdomain?
  2007-02-14 10:26 ` Yu, Xiaoyang
@ 2007-02-14 11:27   ` Nenad Cimerman
  2007-02-14 12:24     ` [Qemu-devel] USB storage cannot be recognized on guestLinuxdomain? Yu, Xiaoyang
  2007-02-14 15:00   ` [Qemu-devel] USB storage cannot be recognized on guest Linux domain? Lonnie Mendez
  1 sibling, 1 reply; 11+ messages in thread
From: Nenad Cimerman @ 2007-02-14 11:27 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 2111 bytes --]

Hi Xiaoyang,



did you check whether both kernels are configured to support USB?

# cat /proc/config

or

# zcat /proc/config.gz



Cheers,

Nenad.



  _____

Von: qemu-devel-bounces+nenad=cimerman.de@nongnu.org
[mailto:qemu-devel-bounces+nenad=cimerman.de@nongnu.org] Im Auftrag von Yu,
Xiaoyang
Gesendet: Mittwoch, 14. Februar 2007 11:26
An: qemu-devel@nongnu.org
Betreff: RE: [Qemu-devel] USB storage cannot be recognized on guest
Linuxdomain?



I just found that using an older kernel in Fedora Core 4 may “solve” the
problem.



When I tested Fedora Core 4 guest domain, the kernel version I used was 2.6.
17-1.2142_FC4, and it cannot recognized the USB disk.

I just changed the kernel in guest domain to version 2.6.11-1.1369_FC4. Then
the guest domain can recognized the USB disk. I am wondering why the USB
support in QEMU depend on the guest domain kernel. And I would like to know
which kernel version can support QEMU USB emulation.



BTW, I also found that Windows XP guest domain can not recognize the USB
disk, while Windows XP SP2 guest domain can recognize the USB disk. So it
seems like that the guest Linux/Windows domain should have some “special
feature” to work with the QEMU USB emulation successfully. Isn’t it
strange?





Sent: 2007年2月14日 15:06
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] USB storage cannot be recognized on guest Linux
domain?



I am using Xen 3.0.3 with QEMU-DM 0.8.2 on a Intel VT platform. After insert
a USB storage, and use “usb_add” command in QEMU monitor, the storage
should be recognized on guest OS. I tested this with a Windows XP SP2 guest
OS, it doing well.



But when I test the “usb_add” command with some Linux guest OS, it seems
that the guest OS cannot recognize the USB storage. And the device number
and address in guest domain are always “0.0”. The Linux guest OS I tested
including Fedora Core 4 and Fedora Core 5. Does any one also meet this
problem or have some idea on this? Feedbacks will be highly appreciated.



Thanks
Xiaoyang


[-- Attachment #2: Type: text/html, Size: 9913 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [Qemu-devel] USB storage cannot be recognized on guestLinuxdomain?
  2007-02-14 11:27   ` AW: [Qemu-devel] USB storage cannot be recognized on guest Linuxdomain? Nenad Cimerman
@ 2007-02-14 12:24     ` Yu, Xiaoyang
  2007-02-14 12:39       ` Yu, Xiaoyang
  0 siblings, 1 reply; 11+ messages in thread
From: Yu, Xiaoyang @ 2007-02-14 12:24 UTC (permalink / raw)
  To: nenad, qemu-devel


[-- Attachment #1.1: Type: text/plain, Size: 2788 bytes --]

Hi Nenad,

 

Both kernels are configured to support USB devices. The config files are put in the attachment.

 

USB storages can be recognized by both kernels successfully if I install the systems directly on hardware, instead of install the systems as guest domains in Xen/VT environment. 

 

Thanks
Xiaoyang

 

________________________________

From: qemu-devel-bounces+xiaoyang.yu=intel.com@nongnu.org [mailto:qemu-devel-bounces+xiaoyang.yu=intel.com@nongnu.org] On Behalf Of Nenad Cimerman
Sent: 2007年2月14日 19:28
To: qemu-devel@nongnu.org
Subject: AW: [Qemu-devel] USB storage cannot be recognized on guestLinuxdomain?

 

Hi Xiaoyang,

 

did you check whether both kernels are configured to support USB?

# cat /proc/config 

or

# zcat /proc/config.gz

 

Cheers,

Nenad.

 

________________________________

Von: qemu-devel-bounces+nenad=cimerman.de@nongnu.org [mailto:qemu-devel-bounces+nenad=cimerman.de@nongnu.org] Im Auftrag von Yu, Xiaoyang
Gesendet: Mittwoch, 14. Februar 2007 11:26
An: qemu-devel@nongnu.org
Betreff: RE: [Qemu-devel] USB storage cannot be recognized on guest Linuxdomain?

 

I just found that using an older kernel in Fedora Core 4 may “solve” the problem. 

 

When I tested Fedora Core 4 guest domain, the kernel version I used was 2.6.17-1.2142_FC4, and it cannot recognized the USB disk. 

I just changed the kernel in guest domain to version 2.6.11-1.1369_FC4. Then the guest domain can recognized the USB disk. I am wondering why the USB support in QEMU depend on the guest domain kernel. And I would like to know which kernel version can support QEMU USB emulation.

 

BTW, I also found that Windows XP guest domain can not recognize the USB disk, while Windows XP SP2 guest domain can recognize the USB disk. So it seems like that the guest Linux/Windows domain should have some “special feature” to work with the QEMU USB emulation successfully. Isn’t it strange?

 

 

Sent: 2007年2月14日 15:06
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] USB storage cannot be recognized on guest Linux domain?

 

I am using Xen 3.0.3 with QEMU-DM 0.8.2 on a Intel VT platform. After insert a USB storage, and use “usb_add” command in QEMU monitor, the storage should be recognized on guest OS. I tested this with a Windows XP SP2 guest OS, it doing well. 

 

But when I test the “usb_add” command with some Linux guest OS, it seems that the guest OS cannot recognize the USB storage. And the device number and address in guest domain are always “0.0”. The Linux guest OS I tested including Fedora Core 4 and Fedora Core 5. Does any one also meet this problem or have some idea on this? Feedbacks will be highly appreciated.

 

Thanks
Xiaoyang


[-- Attachment #1.2: Type: text/html, Size: 13192 bytes --]

[-- Attachment #2: config-2.6.11-1.1369_FC4.gz --]
[-- Type: application/x-gzip, Size: 15202 bytes --]

[-- Attachment #3: config-2.6.17-1.2142_FC4.gz --]
[-- Type: application/x-gzip, Size: 17418 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [Qemu-devel] USB storage cannot be recognized on guestLinuxdomain?
  2007-02-14 12:24     ` [Qemu-devel] USB storage cannot be recognized on guestLinuxdomain? Yu, Xiaoyang
@ 2007-02-14 12:39       ` Yu, Xiaoyang
  0 siblings, 0 replies; 11+ messages in thread
From: Yu, Xiaoyang @ 2007-02-14 12:39 UTC (permalink / raw)
  To: qemu-devel, nenad

[-- Attachment #1: Type: text/plain, Size: 3560 bytes --]

Also I have tested QEMU 0.9.0 using image “linux-0.2.img”. After invoked “usb_add” in QEMU monitor, nothing was shown in guest domain. Then I type “exit” to reboot the system, then the following message shown in guest domain:

 

scsi 0:0:0:0: Direct-Access  Kingston DataTraveler 2.0 1.00 PQ: 0 ANSI:2 

 

It seems like that the USB disk can be recognized only after a system reboot of “linux-0.2.img”.

 

________________________________

From: qemu-devel-bounces+xiaoyang.yu=intel.com@nongnu.org [mailto:qemu-devel-bounces+xiaoyang.yu=intel.com@nongnu.org] On Behalf Of Yu, Xiaoyang
Sent: 2007年2月14日 20:24
To: nenad@cimerman.de; qemu-devel@nongnu.org
Subject: RE: [Qemu-devel] USB storage cannot be recognized on guestLinuxdomain?

 

Hi Nenad,

 

Both kernels are configured to support USB devices. The config files are put in the attachment.

 

USB storages can be recognized by both kernels successfully if I install the systems directly on hardware, instead of install the systems as guest domains in Xen/VT environment. 

 

Thanks
Xiaoyang

 

________________________________

From: qemu-devel-bounces+xiaoyang.yu=intel.com@nongnu.org [mailto:qemu-devel-bounces+xiaoyang.yu=intel.com@nongnu.org] On Behalf Of Nenad Cimerman
Sent: 2007年2月14日 19:28
To: qemu-devel@nongnu.org
Subject: AW: [Qemu-devel] USB storage cannot be recognized on guestLinuxdomain?

 

Hi Xiaoyang,

 

did you check whether both kernels are configured to support USB?

# cat /proc/config 

or

# zcat /proc/config.gz

 

Cheers,

Nenad.

 

________________________________

Von: qemu-devel-bounces+nenad=cimerman.de@nongnu.org [mailto:qemu-devel-bounces+nenad=cimerman.de@nongnu.org] Im Auftrag von Yu, Xiaoyang
Gesendet: Mittwoch, 14. Februar 2007 11:26
An: qemu-devel@nongnu.org
Betreff: RE: [Qemu-devel] USB storage cannot be recognized on guest Linuxdomain?

 

I just found that using an older kernel in Fedora Core 4 may “solve” the problem. 

 

When I tested Fedora Core 4 guest domain, the kernel version I used was 2.6.17-1.2142_FC4, and it cannot recognized the USB disk. 

I just changed the kernel in guest domain to version 2.6.11-1.1369_FC4. Then the guest domain can recognized the USB disk. I am wondering why the USB support in QEMU depend on the guest domain kernel. And I would like to know which kernel version can support QEMU USB emulation.

 

BTW, I also found that Windows XP guest domain can not recognize the USB disk, while Windows XP SP2 guest domain can recognize the USB disk. So it seems like that the guest Linux/Windows domain should have some “special feature” to work with the QEMU USB emulation successfully. Isn’t it strange?

 

 

Sent: 2007年2月14日 15:06
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] USB storage cannot be recognized on guest Linux domain?

 

I am using Xen 3.0.3 with QEMU-DM 0.8.2 on a Intel VT platform. After insert a USB storage, and use “usb_add” command in QEMU monitor, the storage should be recognized on guest OS. I tested this with a Windows XP SP2 guest OS, it doing well. 

 

But when I test the “usb_add” command with some Linux guest OS, it seems that the guest OS cannot recognize the USB storage. And the device number and address in guest domain are always “0.0”. The Linux guest OS I tested including Fedora Core 4 and Fedora Core 5. Does any one also meet this problem or have some idea on this? Feedbacks will be highly appreciated.

 

Thanks
Xiaoyang


[-- Attachment #2: Type: text/html, Size: 16395 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [Qemu-devel] USB storage cannot be recognized on guest Linux domain?
  2007-02-14 10:26 ` Yu, Xiaoyang
  2007-02-14 11:27   ` AW: [Qemu-devel] USB storage cannot be recognized on guest Linuxdomain? Nenad Cimerman
@ 2007-02-14 15:00   ` Lonnie Mendez
  2007-02-15  2:36     ` [Qemu-devel] USB storage cannot be recognized on guest Linuxdomain? Yu, Xiaoyang
  1 sibling, 1 reply; 11+ messages in thread
From: Lonnie Mendez @ 2007-02-14 15:00 UTC (permalink / raw)
  To: qemu-devel

On Wed, 2007-02-14 at 18:26 +0800, Yu, Xiaoyang wrote:
> BTW, I also found that Windows XP guest domain can not recognize the
> USB disk, while Windows XP SP2 guest domain can recognize the USB
> disk. So it seems like that the guest Linux/Windows domain should have
> some “special feature” to work with the QEMU USB emulation
> successfully. Isn’t it strange?

The uhci emulation has no suspend/resume support.  From your description
this is exactly the problem you are seeing.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [Qemu-devel] USB storage cannot be recognized on guest Linuxdomain?
  2007-02-14 15:00   ` [Qemu-devel] USB storage cannot be recognized on guest Linux domain? Lonnie Mendez
@ 2007-02-15  2:36     ` Yu, Xiaoyang
  2007-02-15  2:43       ` Lonnie Mendez
  0 siblings, 1 reply; 11+ messages in thread
From: Yu, Xiaoyang @ 2007-02-15  2:36 UTC (permalink / raw)
  To: qemu-devel

Thanks a lot for the instruction. Will the suspend/resume support be added in the future release? 

Without the suspend/resume support, is there anything can be done in the guest domain to help detect a USB device? Maybe patch the kernel?

Thanks
Xiaoyang
 
-----Original Message-----
From: qemu-devel-bounces+xiaoyang.yu=intel.com@nongnu.org [mailto:qemu-devel-bounces+xiaoyang.yu=intel.com@nongnu.org] On Behalf Of Lonnie Mendez
Sent: 2007年2月14日 23:01
To: qemu-devel@nongnu.org
Subject: RE: [Qemu-devel] USB storage cannot be recognized on guest Linuxdomain?

On Wed, 2007-02-14 at 18:26 +0800, Yu, Xiaoyang wrote:
> BTW, I also found that Windows XP guest domain can not recognize the
> USB disk, while Windows XP SP2 guest domain can recognize the USB
> disk. So it seems like that the guest Linux/Windows domain should have
> some “special feature” to work with the QEMU USB emulation
> successfully. Isn’t it strange?

The uhci emulation has no suspend/resume support.  From your description
this is exactly the problem you are seeing.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [Qemu-devel] USB storage cannot be recognized on guest Linuxdomain?
  2007-02-15  2:36     ` [Qemu-devel] USB storage cannot be recognized on guest Linuxdomain? Yu, Xiaoyang
@ 2007-02-15  2:43       ` Lonnie Mendez
  2007-02-15  7:44         ` [Qemu-devel] USB storage cannot be recognized on guest Linux domain? Yu, Xiaoyang
  0 siblings, 1 reply; 11+ messages in thread
From: Lonnie Mendez @ 2007-02-15  2:43 UTC (permalink / raw)
  To: qemu-devel

On Thu, 2007-02-15 at 10:36 +0800, Yu, Xiaoyang wrote:
> Thanks a lot for the instruction. Will the suspend/resume support be added in the future release? 
> 
> Without the suspend/resume support, is there anything can be done in the guest domain to help detect a USB device? Maybe patch the kernel?

For windows you can disable the power management for the controller.
That will cause windows to constantly poll hub status.

For linux you have to reload the uhci hcd driver.  Notice that starting
qemu with -usbdevice works.  The code to implement this is very easy.
You basically set/clear some bits and trigger an interrupt.  See list
archives for example code.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [Qemu-devel] USB storage cannot be recognized on guest Linux domain?
  2007-02-15  2:43       ` Lonnie Mendez
@ 2007-02-15  7:44         ` Yu, Xiaoyang
  2007-02-15 14:48           ` Lonnie Mendez
  0 siblings, 1 reply; 11+ messages in thread
From: Yu, Xiaoyang @ 2007-02-15  7:44 UTC (permalink / raw)
  To: qemu-devel

Hi Lonnie,

Thanks a lot for the information.

In our use case, we do not know the USB disk information before it is plugged by customer, so we cannot start qemu with -usbdevice.

For Linux, reload the uhci_hcd driver works. If we use this solution in our use case, then we need to issue an interrupt (maybe by pic_set_irq_new?) to the guest OS when QEMU detect a USB device is attached, and then the guest OS will reload the uhci_hcd driver. Is that right? Currently there is something wrong with the list archive server, so I haven't search out any example code from it :-(

I found that there is a patch to add the UHCI suspend/resume support in the archive posted by you, but it cannot be applied to QEMU-DM 0.8.2 directly:
http://lists.gnu.org/archive/html/qemu-devel/2006-04/msg00576.html

I wonder why there is no official UHCI suspend/resume support in QEMU. To reload the uhci_hcd driver seems to be only a work around. Sometimes it even cause kernel oops. 

I also wonder why the kernel 2.6.11-1.1369_FC4 can recognize USB storage without UHCI suspend/resume support.

Thanks
Xiaoyang
 
-----Original Message-----
From: qemu-devel-bounces+xiaoyang.yu=intel.com@nongnu.org [mailto:qemu-devel-bounces+xiaoyang.yu=intel.com@nongnu.org] On Behalf Of Lonnie Mendez
Sent: 2007年2月15日 10:44
To: qemu-devel@nongnu.org
Subject: RE: [Qemu-devel] USB storage cannot be recognized onguest Linuxdomain?

On Thu, 2007-02-15 at 10:36 +0800, Yu, Xiaoyang wrote:
> Thanks a lot for the instruction. Will the suspend/resume support be added in the future release? 
> 
> Without the suspend/resume support, is there anything can be done in the guest domain to help detect a USB device? Maybe patch the kernel?

For windows you can disable the power management for the controller.
That will cause windows to constantly poll hub status.

For linux you have to reload the uhci hcd driver.  Notice that starting
qemu with -usbdevice works.  The code to implement this is very easy.
You basically set/clear some bits and trigger an interrupt.  See list
archives for example code.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [Qemu-devel] USB storage cannot be recognized on guest Linux domain?
  2007-02-15  7:44         ` [Qemu-devel] USB storage cannot be recognized on guest Linux domain? Yu, Xiaoyang
@ 2007-02-15 14:48           ` Lonnie Mendez
  2007-02-16  5:10             ` [Qemu-devel] USB storage cannot be recognized on guest Linuxdomain? Yu, Xiaoyang
  0 siblings, 1 reply; 11+ messages in thread
From: Lonnie Mendez @ 2007-02-15 14:48 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1396 bytes --]

On Thu, 2007-02-15 at 15:44 +0800, Yu, Xiaoyang wrote:
> Hi Lonnie,
> 
> Thanks a lot for the information.
> 
> In our use case, we do not know the USB disk information before it is plugged by customer, so we cannot start qemu with -usbdevice.
> 
> For Linux, reload the uhci_hcd driver works. If we use this solution in our use case, then we need to issue an interrupt (maybe by pic_set_irq_new?) to the guest OS when QEMU detect a USB device is attached, and then the guest OS will reload the uhci_hcd driver. Is that right? Currently there is something wrong with the list archive server, so I haven't search out any example code from it :-(
> 
> I found that there is a patch to add the UHCI suspend/resume support in the archive posted by you, but it cannot be applied to QEMU-DM 0.8.2 directly:
> http://lists.gnu.org/archive/html/qemu-devel/2006-04/msg00576.html
> 
> I wonder why there is no official UHCI suspend/resume support in QEMU. To reload the uhci_hcd driver seems to be only a work around. Sometimes it even cause kernel oops. 
> 
> I also wonder why the kernel 2.6.11-1.1369_FC4 can recognize USB storage without UHCI suspend/resume support.

The attached patch is enough to have a device on linux recognized after
usb_add.  However, the device must be attached to the uhci controller's
root hub.  If a device is attached to an emulated usb hub device it will
not be detected.

[-- Attachment #2: qemu-uhci-resume.diff --]
[-- Type: text/x-patch, Size: 1492 bytes --]

? qemu-uhci-resume.diff
Index: hw/usb-uhci.c
===================================================================
RCS file: /sources/qemu/qemu/hw/usb-uhci.c,v
retrieving revision 1.13
diff -u -r1.13 usb-uhci.c
--- hw/usb-uhci.c	17 Jan 2007 23:08:17 -0000	1.13
+++ hw/usb-uhci.c	15 Feb 2007 14:44:40 -0000
@@ -26,6 +26,8 @@
 //#define DEBUG
 //#define DEBUG_PACKET
 
+#define UHCI_CMD_FGR      (1 << 4)
+#define UHCI_CMD_EGSM     (1 << 3)
 #define UHCI_CMD_GRESET   (1 << 2)
 #define UHCI_CMD_HCRESET  (1 << 1)
 #define UHCI_CMD_RS       (1 << 0)
@@ -327,6 +329,21 @@
     return val;
 }
 
+/* signal resume if controller suspended */
+static void uhci_resume (void *opaque)
+{
+    UHCIState *s = (UHCIState *)opaque;
+
+    if (!s)
+        return;
+
+    if (s->cmd & UHCI_CMD_EGSM) {
+        s->cmd |= UHCI_CMD_FGR;
+        s->status |= UHCI_STS_RD;
+        uhci_update_irq(s);
+    }
+}
+
 static void uhci_attach(USBPort *port1, USBDevice *dev)
 {
     UHCIState *s = port1->opaque;
@@ -344,6 +361,9 @@
             port->ctrl |= UHCI_PORT_LSDA;
         else
             port->ctrl &= ~UHCI_PORT_LSDA;
+
+        uhci_resume(s);
+
         port->port.dev = dev;
         /* send the attach message */
         usb_send_msg(dev, USB_MSG_ATTACH);
@@ -358,6 +378,9 @@
             port->ctrl &= ~UHCI_PORT_EN;
             port->ctrl |= UHCI_PORT_ENC;
         }
+
+        uhci_resume(s);
+
         dev = port->port.dev;
         if (dev) {
             /* send the detach message */

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [Qemu-devel] USB storage cannot be recognized on guest Linuxdomain?
  2007-02-15 14:48           ` Lonnie Mendez
@ 2007-02-16  5:10             ` Yu, Xiaoyang
  0 siblings, 0 replies; 11+ messages in thread
From: Yu, Xiaoyang @ 2007-02-16  5:10 UTC (permalink / raw)
  To: qemu-devel

Lonnie,

Thank you so much for write the patch for me! It works well with Fedora Core 4. Since it added UHCI suspend/resume support, so I guess it should also work with Windows XP :-)

Thanks
Xiaoyang
 

-----Original Message-----
From: qemu-devel-bounces+xiaoyang.yu=intel.com@nongnu.org [mailto:qemu-devel-bounces+xiaoyang.yu=intel.com@nongnu.org] On Behalf Of Lonnie Mendez
Sent: 2007年2月15日 22:49
To: qemu-devel@nongnu.org
Subject: RE: [Qemu-devel] USB storage cannot be recognized on guest Linuxdomain?

On Thu, 2007-02-15 at 15:44 +0800, Yu, Xiaoyang wrote:
> Hi Lonnie,
> 
> Thanks a lot for the information.
> 
> In our use case, we do not know the USB disk information before it is plugged by customer, so we cannot start qemu with -usbdevice.
> 
> For Linux, reload the uhci_hcd driver works. If we use this solution in our use case, then we need to issue an interrupt (maybe by pic_set_irq_new?) to the guest OS when QEMU detect a USB device is attached, and then the guest OS will reload the uhci_hcd driver. Is that right? Currently there is something wrong with the list archive server, so I haven't search out any example code from it :-(
> 
> I found that there is a patch to add the UHCI suspend/resume support in the archive posted by you, but it cannot be applied to QEMU-DM 0.8.2 directly:
> http://lists.gnu.org/archive/html/qemu-devel/2006-04/msg00576.html
> 
> I wonder why there is no official UHCI suspend/resume support in QEMU. To reload the uhci_hcd driver seems to be only a work around. Sometimes it even cause kernel oops. 
> 
> I also wonder why the kernel 2.6.11-1.1369_FC4 can recognize USB storage without UHCI suspend/resume support.

The attached patch is enough to have a device on linux recognized after
usb_add.  However, the device must be attached to the uhci controller's
root hub.  If a device is attached to an emulated usb hub device it will
not be detected.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-02-16  5:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-14  7:05 [Qemu-devel] USB storage cannot be recognized on guest Linux domain? Yu, Xiaoyang
2007-02-14 10:26 ` Yu, Xiaoyang
2007-02-14 11:27   ` AW: [Qemu-devel] USB storage cannot be recognized on guest Linuxdomain? Nenad Cimerman
2007-02-14 12:24     ` [Qemu-devel] USB storage cannot be recognized on guestLinuxdomain? Yu, Xiaoyang
2007-02-14 12:39       ` Yu, Xiaoyang
2007-02-14 15:00   ` [Qemu-devel] USB storage cannot be recognized on guest Linux domain? Lonnie Mendez
2007-02-15  2:36     ` [Qemu-devel] USB storage cannot be recognized on guest Linuxdomain? Yu, Xiaoyang
2007-02-15  2:43       ` Lonnie Mendez
2007-02-15  7:44         ` [Qemu-devel] USB storage cannot be recognized on guest Linux domain? Yu, Xiaoyang
2007-02-15 14:48           ` Lonnie Mendez
2007-02-16  5:10             ` [Qemu-devel] USB storage cannot be recognized on guest Linuxdomain? Yu, Xiaoyang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.