qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: arei.gonglei@huawei.com
Cc: weidong.huang@huawei.com, luonengjun@huawei.com,
	qemu-devel@nongnu.org, peter.huangpeng@huawei.com
Subject: Re: [Qemu-devel] [PATCH 1/6] usb: add usb_bus_release function
Date: Mon, 02 Jun 2014 09:36:20 +0200	[thread overview]
Message-ID: <1401694580.22391.10.camel@nilsson.home.kraxel.org> (raw)
In-Reply-To: <1401452542-11080-2-git-send-email-arei.gonglei@huawei.com>

  Hi,

> +void usb_bus_release(USBBus *bus)
> +{
> +    assert(next_usb_bus > 0);
> +
> +    next_usb_bus--;
> +    QTAILQ_REMOVE(&busses, bus, next);
> +}

That breaks when not hotplugging in last-in-first-out order.  I'd
suggest to simply leave next_usb_bus alone on unplug.  It is only used
for bus numbering.  We'll get holes in our bus numbering then, but we
can't avoid that with hotplug anyway.

cheers,
  Gerd

       reply	other threads:[~2014-06-02  7:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1401452542-11080-1-git-send-email-arei.gonglei@huawei.com>
     [not found] ` <1401452542-11080-2-git-send-email-arei.gonglei@huawei.com>
2014-06-02  7:36   ` Gerd Hoffmann [this message]
2014-06-03  1:21     ` [Qemu-devel] [PATCH 1/6] usb: add usb_bus_release function Gonglei (Arei)
     [not found] ` <1401452542-11080-3-git-send-email-arei.gonglei@huawei.com>
2014-06-02  7:45   ` [Qemu-devel] [PATCH 2/6] usb-ohci: add exit function Gerd Hoffmann
2014-06-03  1:40     ` Gonglei (Arei)
     [not found] ` <1401452542-11080-7-git-send-email-arei.gonglei@huawei.com>
2014-06-02  7:58   ` [Qemu-devel] [PATCH 6/6] usb: tag usb host controller as hotpluggable Gerd Hoffmann
2014-06-02 10:49     ` Michael S. Tsirkin

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=1401694580.22391.10.camel@nilsson.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=luonengjun@huawei.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=weidong.huang@huawei.com \
    /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).