qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wessel <jason.wessel@windriver.com>
To: qemu-devel@nongnu.org, linux@tjworld.net
Cc: kvm <kvm@vger.kernel.org>
Subject: Re: [Qemu-devel] [PATCH] Add USB sys file-system support (v2)
Date: Fri, 05 Sep 2008 08:30:23 -0500	[thread overview]
Message-ID: <48C1346F.3000405@windriver.com> (raw)
In-Reply-To: <1220580385.2638.15.camel@hephaestion>

TJ wrote:
> Revision 2.
>
> I realised I'd made a major programming boo-boo despite knowing better -
> requesting an allocation of memory in the host USB file-system scan
> function, forgetting that the function isn't just called once but
> repeatedly. That would have led to orphaned memory allocations each time
> a USB scan or open operation occurred - baaad!
>
> I've also changed the logic so it only scans for the USB file-system
> type the first time. After that it works off stored values.
>
>   

Perhaps there is more work to do with this patch, or there are other
pieces still pending?

I tried out the patch because it looked reasonably interesting on ubuntu
7.10 64bit, and looked like a nice way to attach a local USB device, but
it did not quite work.

IE:
(qemu) info usbhost
  Device 3.2, speed 12 Mb/s
    Class 00: USB device 067b:2303, USB-Serial Controller


The first thing I tried was using it with the vendor/product id and it
failed immediately.

qemu ... -usb -usbdevice host:067b:2303
Warning: could not add USB device host:067b:2303

Then I tried using it with bus.addr syntax:

qemu ... -usb -usbdevice host:003.002
husb: open device 3.2
husb: opened /dev/bus/usb/003/002
husb: config #1 need -1
husb: 1 interfaces claimed for configuration -1
husb: grabbed usb device 3.2
usb_linux_update_endp_table: Broken pipe
Warning: could not add USB device host:003.002



It turns out that it is failing on the ioctl in usb-linux.c


    541         ct.bRequestType = USB_DIR_IN | USB_RECIP_INTERFACE;
    542         ct.bRequest = USB_REQ_GET_INTERFACE;
    543         ct.wValue = 0;
    544         ct.wIndex = interface;
    545         ct.wLength = 1;
    546         ct.data = &alt_interface;
    547         ct.timeout = 50;
    548
    549         ret = ioctl(s->fd, USBDEVFS_CONTROL, &ct);
    550         if (ret < 0) {
    551             perror("usb_linux_update_endp_table");
    552             return 1;
    553         }


I can see that some of the ioctls succeed so perhaps it is partially
working.  Any ideas around why this might be failing?  I had not ever
looked at the qemu usb code before, but the -1 for the configuration did
look a bit suspicious . 

Cheers,
Jason.

  reply	other threads:[~2008-09-05 13:30 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-04 23:35 [Qemu-devel] [PATCH] Add USB sys file-system support TJ
2008-09-05  2:06 ` [Qemu-devel] [PATCH] Add USB sys file-system support (v2) TJ
2008-09-05 13:30   ` Jason Wessel [this message]
2008-09-05 18:51     ` TJ
2008-09-05 19:19       ` Jason Wessel
2008-09-05 20:28         ` TJ
2008-09-05 20:54           ` Jason Wessel
2008-09-05 21:13         ` [Qemu-devel] [PATCH] Add USB sys file-system support (v3) TJ
2008-09-08 14:47           ` [Qemu-devel] " Jason Wessel
2008-09-17 19:31             ` [Qemu-devel] [PATCH] Add USB sys file-system support (v4) TJ
2008-09-17 20:31               ` [Qemu-devel] " Anthony Liguori
2008-09-17 22:47                 ` [Qemu-devel] [PATCH] Add USB sys file-system support (v5) TJ
2008-09-22 19:47                   ` Rick Vernam
2008-09-22 22:38                     ` Anthony Liguori
2008-09-25 17:34                       ` Rick Vernam
2008-09-25 17:45                         ` Anthony Liguori
2008-09-22 22:37                   ` [Qemu-devel] " Anthony Liguori
2008-09-23  1:23                     ` TJ
2008-09-23  1:33                     ` [Qemu-devel] [PATCH] Add USB sys file-system support (v6) TJ
2008-09-25 17:45                       ` [Qemu-devel] " Anthony Liguori
2008-09-26 13:57                         ` Jason Wessel
2008-09-26 14:27                           ` Anthony Liguori
2008-09-26 14:35                             ` Robert Riebisch
2008-09-26 14:37                               ` Anthony Liguori
2008-09-26 15:13                             ` Jason Wessel
2008-09-26 15:37                               ` Anthony Liguori
2008-09-30 20:53                                 ` TJ
2008-10-01 21:21                       ` [Qemu-devel] [PATCH] Add USB sys file-system support (v7) TJ
2008-10-01 23:19                         ` [Qemu-devel] [PATCH] Add USB sys file-system support (v8) TJ
2008-10-06 16:03                           ` Rick Vernam
2008-10-07  8:46                             ` TJ
2008-10-07 20:09                           ` [Qemu-devel] " Anthony Liguori
2008-09-05 19:20     ` [Qemu-devel] [PATCH] Add USB sys file-system support (v2) TJ

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48C1346F.3000405@windriver.com \
    --to=jason.wessel@windriver.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux@tjworld.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).