All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Alon Levy <alevy@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] monitor: add usb_detach
Date: Mon, 11 Oct 2010 09:51:14 +0200	[thread overview]
Message-ID: <4CB2C1F2.7070101@redhat.com> (raw)
In-Reply-To: <64312746.15881286709134101.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>

On 10/10/10 13:12, Alon Levy wrote:
>
> ----- "Anthony Liguori"<anthony@codemonkey.ws>  wrote:
>
>> How is this different than usb_del?  Is it that it detaches it but
>> does
>> not delete the device?
>
> yes. There is no usb_attach command because it was harder to write (can't
> use the bus.addr since a detached device doesn't have them) and I didn't
> need it right now, my device attaches itself based on a external event.

Which points out a problem with this patch:  It should better not use 
bus.addr.  addr isn't fixed and even can be uninitialized.  Yes, usb_del 
uses it (for historical reasons).  But we better should not use it in 
new code.  Better use the device id (like device_del).  Which will work 
for usb_attach too.

Next question:  What is the use case?  attach/detach is used by devices 
internally.  usb-host does attach/detach when devices get plugged-in and 
-out on the host.  The ccid device does simliar things on vsclient 
connect/disconnect.  So toggeling the attach state via monitor easily 
could have unwanted side effects ...

cheers,
   Gerd

  reply	other threads:[~2010-10-11  7:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-05 14:40 [Qemu-devel] [PATCH] monitor: add usb_detach Alon Levy
2010-10-08 18:08 ` Luiz Capitulino
2010-10-08 18:43 ` Anthony Liguori
2010-10-10 11:12   ` Alon Levy
2010-10-11  7:51     ` Gerd Hoffmann [this message]
2010-10-11 11:02       ` Alon Levy

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=4CB2C1F2.7070101@redhat.com \
    --to=kraxel@redhat.com \
    --cc=alevy@redhat.com \
    --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 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.