All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Chun Yan Liu <cyliu@suse.com>
Cc: Juergen Gross <JGross@suse.com>, Wei Liu <wei.liu2@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jim Fehlig <JFEHLIG@suse.com>, Simon Cao <caobosimon@gmail.com>
Subject: Re: [PATCH V13 3/5] libxl: add pvusb API
Date: Tue, 26 Jan 2016 16:21:24 +0000	[thread overview]
Message-ID: <CAFLBxZaTWuViBUjH663tR-GWfwRGCWSNKoRecik9+Q6TJ3HQmA@mail.gmail.com> (raw)
In-Reply-To: <56A7941602000066000A1432@relay2.provo.novell.com>

On Tue, Jan 26, 2016 at 7:43 AM, Chun Yan Liu <cyliu@suse.com> wrote:
>
>
>>>> On 1/20/2016 at 12:56 PM, in message
> <569F83F5020000660009E6AC@relay2.provo.novell.com>, "Chun Yan Liu"
> <cyliu@suse.com> wrote:
>
>>
>>>>> On 1/19/2016 at 11:48 PM, in message
>> <22174.23240.402164.635740@mariner.uk.xensource.com>, Ian Jackson
>> <Ian.Jackson@eu.citrix.com> wrote:
>> > Chunyan Liu writes ("[PATCH V13 3/5] libxl: add pvusb API"):
>> > > Add pvusb APIs, including:
>> > >  - attach/detach (create/destroy) virtual usb controller.
>> > >  - attach/detach usb device
>> > >  - list usb controller and usb devices
>> > >  - some other helper functions
>> >
>> >
>> > Thanks.  This is making progress but I'm afraid we're not quite there
>> > yet.
>> >
>> >
>> > > +static int usbback_dev_unassign(libxl__gc *gc, const char *busid)
>> > > +{
>> > ...
>> > > +    /* Till here, USB device has been unbound from USBBACK and
>> > > +     * removed from xenstore, usb list couldn't show it anymore,
>> > > +     * so no matter removimg driver path successfully or not,
>> > > +     * we will report operation success.
>> > > +     */
>> >
>> > I'm still unconvinced by this and this may mean that the code in this
>> > function is in the wrong order.  Earlier we had this exchange:
>> >
>> > > > Ought this function to really report success if these calls fail ?
>> > >
>> > > I think so. Till here, the USB device has already been unbound from
>> > > usbback and removed from xenstore. usb-list cannot list it any more.
>> >
>> > The problem is that I think that if this function fails, it can leave
>> >  - debris in xenstore (the usbback path)
>> Yes, it's true.
>>
>> >  - the interface bound to the wrong driver
>> No, it won't be bound to 'wrong' driver, only maybe not bound to any driver
>> (Already unbound from usbback, but failed to rebound to its original
>> driver).
>> In this case, we would report warning: failed to rebind to driver xxx.
>>
>> > And then there is no way for the user to get libxl to re-attempt the
>> > operation, or clean up.  Am I right ?
>>
>> Yes. No way to re-attempt usbdev-detach or cleanup driver path in
>> xenstore. But won't affect next time usbdev-attach the same device.
>>
>> >
>> > One way to avoid this kind of problem is to deal with the xenstore
>> > path last.  That way the device will still appear as attached to the
>> > domain.
>>
>> I'm afraid if the side effect is acceptable? In my testing, some USB
>> bluetooth
>> device always fails to rebind to 'btusb' driver after it's unbound
>> from 'usbback'. In this case, we can't detach it from the domain then.
>
> Ian J., any opinion on this? If it's still thought to be better, I'll update patch.

I think Ian may be waiting for me to reply and express an opinion; but
unfortunately that will have to wait until next week. :-(

 -George

  reply	other threads:[~2016-01-26 16:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <569F8391020000660009E667@relay2.provo.novell.com>
2016-01-20  4:56 ` [PATCH V13 3/5] libxl: add pvusb API Chun Yan Liu
2016-01-26  7:43   ` Chun Yan Liu
2016-01-26 16:21     ` George Dunlap [this message]
     [not found] <56B0843302000066000A4C90@relay2.provo.novell.com>
2016-02-02  2:36 ` Chun Yan Liu
2016-01-19  8:39 [PATCH V13 0/5] xen pvusb toolstack work Chunyan Liu
2016-01-19  8:39 ` [PATCH V13 3/5] libxl: add pvusb API Chunyan Liu
2016-01-19 15:48   ` Ian Jackson
2016-02-02 16:26     ` George Dunlap
2016-02-02 18:11       ` Ian Jackson
2016-02-03  7:34         ` Chun Yan Liu
2016-02-03 14:38           ` George Dunlap
2016-02-04  1:44             ` Chun Yan Liu
2016-02-03 14:33         ` George Dunlap
2016-02-04  1:53           ` Chun Yan Liu
     [not found]           ` <56B31FAB02000066000A6596@suse.com>
2016-02-04 14:39             ` Juergen Gross
2016-02-08 14:07               ` George Dunlap
2016-02-08 14:32                 ` Ian Jackson
2016-02-02 16:48     ` George Dunlap
2016-02-03  8:25       ` Chun Yan Liu
2016-01-26 16:12   ` Olaf Hering
2016-01-27  2:29     ` Chun Yan Liu

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=CAFLBxZaTWuViBUjH663tR-GWfwRGCWSNKoRecik9+Q6TJ3HQmA@mail.gmail.com \
    --to=george.dunlap@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JFEHLIG@suse.com \
    --cc=JGross@suse.com \
    --cc=caobosimon@gmail.com \
    --cc=cyliu@suse.com \
    --cc=george.dunlap@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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 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.