#15 - qemu-traditional mis-parses host bus 8 as 0

Owner: George Dunlap <George.Dunlap@eu.citrix.com>

Date: Tue Aug 6 09:30:02 2013

Last Update: Tue Aug 6 09:30:02 2013

Severity: normal

Affects:

State: Closed

[ Retrieve as mbox ]


From: Gordan Bobic <gordan@bobich.net>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Bug in usbdevices option handling when BusID=8
Date: Mon, 05 Aug 2013 20:20:08 +0100
Message-ID: <51FFFAE8.1000206@bobich.net>

[ Reply to this message; Retrieve Raw Message; Archives: marc.info, gmane ]

On 08/05/2013 02:22 PM, George Dunlap wrote:
> On Mon, Aug 5, 2013 at 8:29 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> On Sun, 2013-08-04 at 12:08 +0100, Gordan Bobic wrote:
>>> At a glance, this looks like something buggy happens when BusID=8. It
>>> sees that the device is host:008.002, but then goes and tries to open
>>> /dev/bus/usb/000/002 instead of /dev/bus/usb/008/002.
>>
>> Smells like a bitmask gone wrong somewhere, or something like that.
>>
>> xl/libxl doesn't really do much with the string which you passed in so
>> it should be going straight to qemu unmodified. You ought to be able to
>> see this in the logs I think.
>
> Or using ps -ax -- what does that show the command-line to be?

It looks like a qemu-traditional (qemu-dm) issue:

# grep usb /var/log/xen/qemu-dm-edi.log
husb: open device 0.2
/dev/bus/usb/000/002: No such file or directory

# ps auxw | grep qemu
root      8364  4.4  0.0 239132  8880 ?        SLsl 20:16   0:07 
/usr/lib/xen/bin/qemu-dm -d 1 -domain-name edi -vnc 127.0.0.1:0 
-vncunused -k en-gb -serial pty -videoram 8 -std-vga -boot c -usb 
-usbdevice host:008.002 -acpi -vcpus 8 -vcpu_avail 0xff -net 
nic,vlan=0,macaddr=00:16:3e:4e:c5:0c,model=e1000 -net 
tap,vlan=0,ifname=vif1.0-emu,bridge=br0,script=no,downscript=no -M xenfv

Gordan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Gordan Bobic <gordan@bobich.net>
Cc: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, Anthony PERARD <anthony.perard@citrix.com>, Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] Bug in usbdevices option handling when BusID=8
Date: Tue, 6 Aug 2013 10:24:09 +0100
Message-ID: <CAFLBxZbG8ZEfNnsBjJbqFFio9G7jXq966aUbQ4cVet2WO0gcgg@mail.gmail.com>

[ Reply to this message; Retrieve Raw Message; Archives: marc.info, gmane ]

On Mon, Aug 5, 2013 at 8:20 PM, Gordan Bobic <gordan@bobich.net> wrote:
> On 08/05/2013 02:22 PM, George Dunlap wrote:
>>
>> On Mon, Aug 5, 2013 at 8:29 AM, Ian Campbell <Ian.Campbell@citrix.com>
>> wrote:
>>>
>>> On Sun, 2013-08-04 at 12:08 +0100, Gordan Bobic wrote:
>>>>
>>>> At a glance, this looks like something buggy happens when BusID=8. It
>>>> sees that the device is host:008.002, but then goes and tries to open
>>>> /dev/bus/usb/000/002 instead of /dev/bus/usb/008/002.
>>>
>>>
>>> Smells like a bitmask gone wrong somewhere, or something like that.
>>>
>>> xl/libxl doesn't really do much with the string which you passed in so
>>> it should be going straight to qemu unmodified. You ought to be able to
>>> see this in the logs I think.
>>
>>
>> Or using ps -ax -- what does that show the command-line to be?
>
>
> It looks like a qemu-traditional (qemu-dm) issue:
>
> # grep usb /var/log/xen/qemu-dm-edi.log
>
> husb: open device 0.2
> /dev/bus/usb/000/002: No such file or directory
>
> # ps auxw | grep qemu
> root      8364  4.4  0.0 239132  8880 ?        SLsl 20:16   0:07
> /usr/lib/xen/bin/qemu-dm -d 1 -domain-name edi -vnc 127.0.0.1:0 -vncunused
> -k en-gb -serial pty -videoram 8 -std-vga -boot c -usb -usbdevice
> host:008.002 -acpi -vcpus 8 -vcpu_avail 0xff -net
> nic,vlan=0,macaddr=00:16:3e:4e:c5:0c,model=e1000 -net
> tap,vlan=0,ifname=vif1.0-emu,bridge=br0,script=no,downscript=no -M xenfv

Could you test qemu-xen with configuration, to test to see if it
works?  If it doesn't we probably need to report this upstream --
otherwise it's just a matter of fixing it in our tree.

 -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From: Gordan Bobic <gordan@bobich.net>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: xen-devel@lists.xen.org, Ian Campbell <Ian.Campbell@citrix.com>, Anthony PERARD <anthony.perard@citrix.com>, Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] Bug in usbdevices option handling when BusID=8
Date: Tue, 06 Aug 2013 10:25:56 +0100
Message-ID: <514eacfa5e058d06abcdfc52ee9fd8e1@mail.shatteredsilicon.net>

[ Reply to this message; Retrieve Raw Message; Archives: marc.info, gmane ]

 On Tue, 6 Aug 2013 10:24:09 +0100, George Dunlap 
 <George.Dunlap@eu.citrix.com> wrote:
> On Mon, Aug 5, 2013 at 8:20 PM, Gordan Bobic <gordan@bobich.net> 
> wrote:
>> On 08/05/2013 02:22 PM, George Dunlap wrote:
>>>
>>> On Mon, Aug 5, 2013 at 8:29 AM, Ian Campbell 
>>> <Ian.Campbell@citrix.com>
>>> wrote:
>>>>
>>>> On Sun, 2013-08-04 at 12:08 +0100, Gordan Bobic wrote:
>>>>>
>>>>> At a glance, this looks like something buggy happens when 
>>>>> BusID=8. It
>>>>> sees that the device is host:008.002, but then goes and tries to 
>>>>> open
>>>>> /dev/bus/usb/000/002 instead of /dev/bus/usb/008/002.
>>>>
>>>>
>>>> Smells like a bitmask gone wrong somewhere, or something like 
>>>> that.
>>>>
>>>> xl/libxl doesn't really do much with the string which you passed 
>>>> in so
>>>> it should be going straight to qemu unmodified. You ought to be 
>>>> able to
>>>> see this in the logs I think.
>>>
>>>
>>> Or using ps -ax -- what does that show the command-line to be?
>>
>>
>> It looks like a qemu-traditional (qemu-dm) issue:
>>
>> # grep usb /var/log/xen/qemu-dm-edi.log
>>
>> husb: open device 0.2
>> /dev/bus/usb/000/002: No such file or directory
>>
>> # ps auxw | grep qemu
>> root      8364  4.4  0.0 239132  8880 ?        SLsl 20:16   0:07
>> /usr/lib/xen/bin/qemu-dm -d 1 -domain-name edi -vnc 127.0.0.1:0 
>> -vncunused
>> -k en-gb -serial pty -videoram 8 -std-vga -boot c -usb -usbdevice
>> host:008.002 -acpi -vcpus 8 -vcpu_avail 0xff -net
>> nic,vlan=0,macaddr=00:16:3e:4e:c5:0c,model=e1000 -net
>> tap,vlan=0,ifname=vif1.0-emu,bridge=br0,script=no,downscript=no -M 
>> xenfv
>
> Could you test qemu-xen with configuration, to test to see if it
> works?  If it doesn't we probably need to report this upstream --
> otherwise it's just a matter of fixing it in our tree.

 I'll have to rebuild my packages to test that - my build only includes
 qemu-dm.

 Gordan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Gordan Bobic <gordan@bobich.net>
Cc: Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Bug in usbdevices option handling when BusID=8
Date: Tue, 6 Aug 2013 10:28:42 +0100
Message-ID: <CAFLBxZZ8MvXnweAj-fpj2omkio=iX7gprSkxPxFihHGKLseM9Q@mail.gmail.com>

[ Reply to this message; Retrieve Raw Message; Archives: marc.info, gmane ]

create ^
title it qemu-traditional mis-parses host bus 8 as 0
thanks

On Mon, Aug 5, 2013 at 8:20 PM, Gordan Bobic <gordan@bobich.net> wrote:
> On 08/05/2013 02:22 PM, George Dunlap wrote:
>>
>> On Mon, Aug 5, 2013 at 8:29 AM, Ian Campbell <Ian.Campbell@citrix.com>
>> wrote:
>>>
>>> On Sun, 2013-08-04 at 12:08 +0100, Gordan Bobic wrote:
>>>>
>>>> At a glance, this looks like something buggy happens when BusID=8. It
>>>> sees that the device is host:008.002, but then goes and tries to open
>>>> /dev/bus/usb/000/002 instead of /dev/bus/usb/008/002.
>>>
>>>
>>> Smells like a bitmask gone wrong somewhere, or something like that.
>>>
>>> xl/libxl doesn't really do much with the string which you passed in so
>>> it should be going straight to qemu unmodified. You ought to be able to
>>> see this in the logs I think.
>>
>>
>> Or using ps -ax -- what does that show the command-line to be?
>
>
> It looks like a qemu-traditional (qemu-dm) issue:
>
> # grep usb /var/log/xen/qemu-dm-edi.log
>
> husb: open device 0.2
> /dev/bus/usb/000/002: No such file or directory
>
> # ps auxw | grep qemu
> root      8364  4.4  0.0 239132  8880 ?        SLsl 20:16   0:07
> /usr/lib/xen/bin/qemu-dm -d 1 -domain-name edi -vnc 127.0.0.1:0 -vncunused
> -k en-gb -serial pty -videoram 8 -std-vga -boot c -usb -usbdevice
> host:008.002 -acpi -vcpus 8 -vcpu_avail 0xff -net
> nic,vlan=0,macaddr=00:16:3e:4e:c5:0c,model=e1000 -net
> tap,vlan=0,ifname=vif1.0-emu,bridge=br0,script=no,downscript=no -M xenfv
>
> Gordan
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


From: Anthony PERARD <anthony.perard@citrix.com>
To: Gordan Bobic <gordan@bobich.net>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>, Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Bug in usbdevices option handling when BusID=8
Date: Thu, 12 Dec 2013 17:01:49 +0000
Message-ID: <20131212170149.GA5318@perard.uk.xensource.com>

[ Reply to this message; Retrieve Raw Message; Archives: marc.info, gmane ]

On Mon, Aug 05, 2013 at 08:20:08PM +0100, Gordan Bobic wrote:
> On 08/05/2013 02:22 PM, George Dunlap wrote:
> >On Mon, Aug 5, 2013 at 8:29 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> >>On Sun, 2013-08-04 at 12:08 +0100, Gordan Bobic wrote:
> >>>At a glance, this looks like something buggy happens when BusID=8. It
> >>>sees that the device is host:008.002, but then goes and tries to open
> >>>/dev/bus/usb/000/002 instead of /dev/bus/usb/008/002.
> >>
> >>Smells like a bitmask gone wrong somewhere, or something like that.
> >>
> >>xl/libxl doesn't really do much with the string which you passed in so
> >>it should be going straight to qemu unmodified. You ought to be able to
> >>see this in the logs I think.
> >
> >Or using ps -ax -- what does that show the command-line to be?
> 
> It looks like a qemu-traditional (qemu-dm) issue:
> 
> # grep usb /var/log/xen/qemu-dm-edi.log
> husb: open device 0.2
> /dev/bus/usb/000/002: No such file or directory
> 
> # ps auxw | grep qemu
> root      8364  4.4  0.0 239132  8880 ?        SLsl 20:16   0:07
> /usr/lib/xen/bin/qemu-dm -d 1 -domain-name edi -vnc 127.0.0.1:0 -vncunused
> -k en-gb -serial pty -videoram 8 -std-vga -boot c -usb -usbdevice
> host:008.002 -acpi -vcpus 8 -vcpu_avail 0xff -net
> nic,vlan=0,macaddr=00:16:3e:4e:c5:0c,model=e1000 -net
> tap,vlan=0,ifname=vif1.0-emu,bridge=br0,script=no,downscript=no -M xenfv

I've just look into this bug. The problem is the way the convertion of
the string is done. And it is just a:
strtoul(devname, NULL, 0);

Here, strtoul while try to guess the base of the string, and a string
that begin by zero while be interpreted to be base 8, or octal. The
character '8' those not belong to this base, so the conversion stop
before '8' and the value return is 0.

We could force the base to be 10, but that mean that anyone who whould
have something like "host:0x4.0x2" while have a configuration that those
not work anymore.

In your case, you can have:
usbdevice="host:8.2" which will fix the issue.

Regards,

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From: George Dunlap <george.dunlap@eu.citrix.com>
To: Anthony PERARD <anthony.perard@citrix.com>, Gordan Bobic <gordan@bobich.net>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>, Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [Xen-devel] Bug in usbdevices option handling when BusID=8
Date: Thu, 12 Dec 2013 17:29:09 +0000
Message-ID: <52A9F265.7080406@eu.citrix.com>

[ Reply to this message; Retrieve Raw Message; Archives: marc.info, gmane ]

On 12/12/2013 05:01 PM, Anthony PERARD wrote:
> On Mon, Aug 05, 2013 at 08:20:08PM +0100, Gordan Bobic wrote:
>> On 08/05/2013 02:22 PM, George Dunlap wrote:
>>> On Mon, Aug 5, 2013 at 8:29 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>>>> On Sun, 2013-08-04 at 12:08 +0100, Gordan Bobic wrote:
>>>>> At a glance, this looks like something buggy happens when BusID=8. It
>>>>> sees that the device is host:008.002, but then goes and tries to open
>>>>> /dev/bus/usb/000/002 instead of /dev/bus/usb/008/002.
>>>> Smells like a bitmask gone wrong somewhere, or something like that.
>>>>
>>>> xl/libxl doesn't really do much with the string which you passed in so
>>>> it should be going straight to qemu unmodified. You ought to be able to
>>>> see this in the logs I think.
>>> Or using ps -ax -- what does that show the command-line to be?
>> It looks like a qemu-traditional (qemu-dm) issue:
>>
>> # grep usb /var/log/xen/qemu-dm-edi.log
>> husb: open device 0.2
>> /dev/bus/usb/000/002: No such file or directory
>>
>> # ps auxw | grep qemu
>> root      8364  4.4  0.0 239132  8880 ?        SLsl 20:16   0:07
>> /usr/lib/xen/bin/qemu-dm -d 1 -domain-name edi -vnc 127.0.0.1:0 -vncunused
>> -k en-gb -serial pty -videoram 8 -std-vga -boot c -usb -usbdevice
>> host:008.002 -acpi -vcpus 8 -vcpu_avail 0xff -net
>> nic,vlan=0,macaddr=00:16:3e:4e:c5:0c,model=e1000 -net
>> tap,vlan=0,ifname=vif1.0-emu,bridge=br0,script=no,downscript=no -M xenfv
> I've just look into this bug. The problem is the way the convertion of
> the string is done. And it is just a:
> strtoul(devname, NULL, 0);
>
> Here, strtoul while try to guess the base of the string, and a string
> that begin by zero while be interpreted to be base 8, or octal. The
> character '8' those not belong to this base, so the conversion stop
> before '8' and the value return is 0.
>
> We could force the base to be 10, but that mean that anyone who whould
> have something like "host:0x4.0x2" while have a configuration that those
> not work anymore.
>
> In your case, you can have:
> usbdevice="host:8.2" which will fix the issue.

What does qemu-xen do?

I'm not sure "host:0x04.0x2" is a supported format.  You can see that 
"00x" is used in Linux in /dev; it's also used in lsusb, for instance, 
and I think a number of the other tools.  I think it would make much 
more sense to match the format of these other tools, than to allow 
people to specify it in hex (using "0x") and have people trip over 
issues like this.

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From: Anthony PERARD <anthony.perard@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Gordan Bobic <gordan@bobich.net>, Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Bug in usbdevices option handling when BusID=8
Date: Thu, 12 Dec 2013 19:32:02 +0000
Message-ID: <20131212193201.GW10855@perard.uk.xensource.com>

[ Reply to this message; Retrieve Raw Message; Archives: marc.info, gmane ]

On Thu, Dec 12, 2013 at 05:29:09PM +0000, George Dunlap wrote:
> On 12/12/2013 05:01 PM, Anthony PERARD wrote:
> >On Mon, Aug 05, 2013 at 08:20:08PM +0100, Gordan Bobic wrote:
> >>On 08/05/2013 02:22 PM, George Dunlap wrote:
> >>>On Mon, Aug 5, 2013 at 8:29 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> >>>>On Sun, 2013-08-04 at 12:08 +0100, Gordan Bobic wrote:
> >>>>>At a glance, this looks like something buggy happens when BusID=8. It
> >>>>>sees that the device is host:008.002, but then goes and tries to open
> >>>>>/dev/bus/usb/000/002 instead of /dev/bus/usb/008/002.
> >>>>Smells like a bitmask gone wrong somewhere, or something like that.
> >>>>
> >>>>xl/libxl doesn't really do much with the string which you passed in so
> >>>>it should be going straight to qemu unmodified. You ought to be able to
> >>>>see this in the logs I think.
> >>>Or using ps -ax -- what does that show the command-line to be?
> >>It looks like a qemu-traditional (qemu-dm) issue:
> >>
> >># grep usb /var/log/xen/qemu-dm-edi.log
> >>husb: open device 0.2
> >>/dev/bus/usb/000/002: No such file or directory
> >>
> >># ps auxw | grep qemu
> >>root      8364  4.4  0.0 239132  8880 ?        SLsl 20:16   0:07
> >>/usr/lib/xen/bin/qemu-dm -d 1 -domain-name edi -vnc 127.0.0.1:0 -vncunused
> >>-k en-gb -serial pty -videoram 8 -std-vga -boot c -usb -usbdevice
> >>host:008.002 -acpi -vcpus 8 -vcpu_avail 0xff -net
> >>nic,vlan=0,macaddr=00:16:3e:4e:c5:0c,model=e1000 -net
> >>tap,vlan=0,ifname=vif1.0-emu,bridge=br0,script=no,downscript=no -M xenfv
> >I've just look into this bug. The problem is the way the convertion of
> >the string is done. And it is just a:
> >strtoul(devname, NULL, 0);
> >
> >Here, strtoul while try to guess the base of the string, and a string
> >that begin by zero while be interpreted to be base 8, or octal. The
> >character '8' those not belong to this base, so the conversion stop
> >before '8' and the value return is 0.
> >
> >We could force the base to be 10, but that mean that anyone who whould
> >have something like "host:0x4.0x2" while have a configuration that those
> >not work anymore.
> >
> >In your case, you can have:
> >usbdevice="host:8.2" which will fix the issue.
> 
> What does qemu-xen do?

QEMU does exactly the same.

> I'm not sure "host:0x04.0x2" is a supported format.

I'm not actually sure which format is supported. Here is a list of
format I could find.
- man qemu
host:bus.addr

That the only place I find this format. Most webpage I could find use
host:vendor_id:product_id format. Even xen documentation use it (before
to send the user to man qemu):

- man xl.cfg
Host devices can also be passed through in this way, by specifying
host:USBID, where USBID is of the form xxxx:yyyy.  The USBID can
typically be found by using lsusb or usb-devices.

> You can see that "00x"
> is used in Linux in /dev; it's also used in lsusb, for instance, and I think
> a number of the other tools.  I think it would make much more sense to match
> the format of these other tools, than to allow people to specify it in hex
> (using "0x") and have people trip over issues like this.

Yes, I see the point.

Well, with whatever supported format I could come up with, I suppose we
can handle something like host:009.003 as 9.3 with no issue on
qemu-traditional. I don't know if we can do the same for QEMU.

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From: George Dunlap <george.dunlap@eu.citrix.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: Gordan Bobic <gordan@bobich.net>, Ian Campbell <Ian.Campbell@citrix.com>, "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] Bug in usbdevices option handling when BusID=8
Date: Fri, 13 Dec 2013 11:04:01 +0000
Message-ID: <52AAE9A1.9000200@eu.citrix.com>

[ Reply to this message; Retrieve Raw Message; Archives: marc.info, gmane ]

On 12/12/2013 07:32 PM, Anthony PERARD wrote:
> On Thu, Dec 12, 2013 at 05:29:09PM +0000, George Dunlap wrote:
>> On 12/12/2013 05:01 PM, Anthony PERARD wrote:
>>> On Mon, Aug 05, 2013 at 08:20:08PM +0100, Gordan Bobic wrote:
>>>> On 08/05/2013 02:22 PM, George Dunlap wrote:
>>>>> On Mon, Aug 5, 2013 at 8:29 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>>>>>> On Sun, 2013-08-04 at 12:08 +0100, Gordan Bobic wrote:
>>>>>>> At a glance, this looks like something buggy happens when BusID=8. It
>>>>>>> sees that the device is host:008.002, but then goes and tries to open
>>>>>>> /dev/bus/usb/000/002 instead of /dev/bus/usb/008/002.
>>>>>> Smells like a bitmask gone wrong somewhere, or something like that.
>>>>>>
>>>>>> xl/libxl doesn't really do much with the string which you passed in so
>>>>>> it should be going straight to qemu unmodified. You ought to be able to
>>>>>> see this in the logs I think.
>>>>> Or using ps -ax -- what does that show the command-line to be?
>>>> It looks like a qemu-traditional (qemu-dm) issue:
>>>>
>>>> # grep usb /var/log/xen/qemu-dm-edi.log
>>>> husb: open device 0.2
>>>> /dev/bus/usb/000/002: No such file or directory
>>>>
>>>> # ps auxw | grep qemu
>>>> root      8364  4.4  0.0 239132  8880 ?        SLsl 20:16   0:07
>>>> /usr/lib/xen/bin/qemu-dm -d 1 -domain-name edi -vnc 127.0.0.1:0 -vncunused
>>>> -k en-gb -serial pty -videoram 8 -std-vga -boot c -usb -usbdevice
>>>> host:008.002 -acpi -vcpus 8 -vcpu_avail 0xff -net
>>>> nic,vlan=0,macaddr=00:16:3e:4e:c5:0c,model=e1000 -net
>>>> tap,vlan=0,ifname=vif1.0-emu,bridge=br0,script=no,downscript=no -M xenfv
>>> I've just look into this bug. The problem is the way the convertion of
>>> the string is done. And it is just a:
>>> strtoul(devname, NULL, 0);
>>>
>>> Here, strtoul while try to guess the base of the string, and a string
>>> that begin by zero while be interpreted to be base 8, or octal. The
>>> character '8' those not belong to this base, so the conversion stop
>>> before '8' and the value return is 0.
>>>
>>> We could force the base to be 10, but that mean that anyone who whould
>>> have something like "host:0x4.0x2" while have a configuration that those
>>> not work anymore.
>>>
>>> In your case, you can have:
>>> usbdevice="host:8.2" which will fix the issue.
>> What does qemu-xen do?
> QEMU does exactly the same.
>
>> I'm not sure "host:0x04.0x2" is a supported format.
> I'm not actually sure which format is supported. Here is a list of
> format I could find.
> - man qemu
> host:bus.addr
>
> That the only place I find this format. Most webpage I could find use
> host:vendor_id:product_id format. Even xen documentation use it (before
> to send the user to man qemu):
>
> - man xl.cfg
> Host devices can also be passed through in this way, by specifying
> host:USBID, where USBID is of the form xxxx:yyyy.  The USBID can
> typically be found by using lsusb or usb-devices.
>
>> You can see that "00x"
>> is used in Linux in /dev; it's also used in lsusb, for instance, and I think
>> a number of the other tools.  I think it would make much more sense to match
>> the format of these other tools, than to allow people to specify it in hex
>> (using "0x") and have people trip over issues like this.
> Yes, I see the point.
>
> Well, with whatever supported format I could come up with, I suppose we
> can handle something like host:009.003 as 9.3 with no issue on
> qemu-traditional. I don't know if we can do the same for QEMU.

I think qemu-traditional should do what qemu-xen does.  (I was confused 
by Gordan saying it was a qemu-traditional issue.)

So for now I think we should just document this.  It might be worth 
submitting a patch to qemu upstream to see what people think of it and 
then backporting it if it's accepted; but obviously that's low priority 
at this point.

  -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From: Anthony PERARD <anthony.perard@citrix.com>
To: Xen Devel <xen-devel@lists.xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>
Subject: [Xen-devel] [PATCH] doc: Better documentation about the usbdevice=['host:bus.addr'] format
Date: Tue, 28 Jan 2014 16:03:03 +0000
Message-ID: <1390924983-4864-1-git-send-email-anthony.perard@citrix.com>

[ Reply to this message; Retrieve Raw Message; Archives: marc.info, gmane ]

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 docs/man/xl.cfg.pod.5 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 9941395..9c0b438 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1251,6 +1251,10 @@ Host devices can also be passed through in this way, by specifying
 host:USBID, where USBID is of the form xxxx:yyyy.  The USBID can
 typically be found by using lsusb or usb-devices.
 
+If you wish to use the "host:bus.addr" format, remove any leading '0' from the
+bus and addr. For example, for the USB device on bus 008 dev 002, you will
+write "host:8.2".
+
 The form usbdevice=DEVICE is also accepted for backwards compatibility.
 
 More valid options can be found in the "usbdevice" section of the qemu
-- 
Anthony PERARD


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From: Ian Campbell <Ian.Campbell@citrix.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: Xen Devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] doc: Better documentation about the usbdevice=['host:bus.addr'] format
Date: Tue, 4 Feb 2014 15:52:35 +0000
Message-ID: <1391529155.6497.44.camel@kazak.uk.xensource.com>

[ Reply to this message; Retrieve Raw Message; Archives: marc.info, gmane ]

On Tue, 2014-01-28 at 16:03 +0000, Anthony PERARD wrote:
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
>  docs/man/xl.cfg.pod.5 | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
> index 9941395..9c0b438 100644
> --- a/docs/man/xl.cfg.pod.5
> +++ b/docs/man/xl.cfg.pod.5
> @@ -1251,6 +1251,10 @@ Host devices can also be passed through in this way, by specifying
>  host:USBID, where USBID is of the form xxxx:yyyy.  The USBID can
>  typically be found by using lsusb or usb-devices.
>  
> +If you wish to use the "host:bus.addr" format, remove any leading '0' from the
> +bus and addr. For example, for the USB device on bus 008 dev 002, you will
> +write "host:8.2".

I tweaked this to "you should write...", then acked + applied.

Thanks.



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

From: Ian Campbell <Ian.Campbell@citrix.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: Xen Devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-devel] [PATCH] doc: Better documentation about the usbdevice=['host:bus.addr'] format
Date: Tue, 4 Feb 2014 15:54:59 +0000
Message-ID: <1391529299.6497.46.camel@kazak.uk.xensource.com>

[ Reply to this message; Retrieve Raw Message; Archives: marc.info, gmane ]

graft 15 <1390924983-4864-1-git-send-email-anthony.perard@citrix.com>
thanks

On Tue, 2014-02-04 at 15:52 +0000, Ian Campbell wrote:
> On Tue, 2014-01-28 at 16:03 +0000, Anthony PERARD wrote:
> > Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> > ---
> >  docs/man/xl.cfg.pod.5 | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
> > index 9941395..9c0b438 100644
> > --- a/docs/man/xl.cfg.pod.5
> > +++ b/docs/man/xl.cfg.pod.5
> > @@ -1251,6 +1251,10 @@ Host devices can also be passed through in this way, by specifying
> >  host:USBID, where USBID is of the form xxxx:yyyy.  The USBID can
> >  typically be found by using lsusb or usb-devices.
> >  
> > +If you wish to use the "host:bus.addr" format, remove any leading '0' from the
> > +bus and addr. For example, for the USB device on bus 008 dev 002, you will
> > +write "host:8.2".
> 
> I tweaked this to "you should write...", then acked + applied.

There is an associated bug but I think it should remain open until the
underlying issue is fixed, rather than just documented as suggested
here.

If you think this issue should be closed please send email to xen-devel
+ bcc xen@bugs.xenproject.org which begins:
        close 15
        thanks
(unindented)

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


From: Ian Campbell <Ian.Campbell@citrix.com>
To: xen-devel <xen-devel@lists.xen.org>
Subject: [Xen-devel] closing various bugs
Date: Thu, 27 Mar 2014 12:44:54 +0000
Message-ID: <1395924294.22909.113.camel@kazak.uk.xensource.com>

[ Reply to this message; Retrieve Raw Message; Archives: marc.info, gmane ]

#15 - qemu-traditional mis-parses host bus 8 as 0
close 15
#21 - credit2: init_pcpu doesn't grab runqueue lock before pointing
close 21
#31 - xl: global keymap= option not recognised
close 31
#33 - Re: xl errors if /var/log/xen doesn't exist
close 33
#35 - stubdom build failures with gcc 4.8
close 35
#37 - Disable IOMMU if no soutbridge
close 37
#39 - RHEL 7 doesn't boot under pygrub
close 39
thanks



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel