From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGlEn-0002vJ-57 for qemu-devel@nongnu.org; Tue, 03 Sep 2013 03:41:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGlEg-00030L-TR for qemu-devel@nongnu.org; Tue, 03 Sep 2013 03:41:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57968) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGlEg-00030H-LF for qemu-devel@nongnu.org; Tue, 03 Sep 2013 03:41:14 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r837fEmo029992 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 3 Sep 2013 03:41:14 -0400 Message-ID: <1378194071.3618.8.camel@nilsson.home.kraxel.org> From: Gerd Hoffmann Date: Tue, 03 Sep 2013 09:41:11 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv2] Make usb-bt-dongle configurable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: mrezanin@redhat.com Cc: qemu-devel@nongnu.org > diff --git a/hw/bt/core.c b/hw/bt/core.c > index 49012e0..ef27b15 100644 > --- a/hw/bt/core.c > +++ b/hw/bt/core.c > @@ -119,3 +119,28 @@ void bt_device_done(struct bt_device_s *dev) > > *p = dev->next; > } > + > +static struct bt_vlan_s { > + struct bt_scatternet_s net; > + int id; > + struct bt_vlan_s *next; > +} *first_bt_vlan; > + > +/* find or alloc a new bluetooth "VLAN" */ > +struct bt_scatternet_s *qemu_find_bt_vlan(int id) > +{ > + struct bt_vlan_s **pvlan, *vlan; > + for (vlan = first_bt_vlan; vlan != NULL; vlan = vlan->next) { > + if (vlan->id == id) { > + return &vlan->net; > + } > + } > + vlan = g_malloc0(sizeof(struct bt_vlan_s)); > + vlan->id = id; > + pvlan = &first_bt_vlan; > + while (*pvlan != NULL) { > + pvlan = &(*pvlan)->next; > + } > + *pvlan = vlan; > + return &vlan->net; > +} This (and some other bits) are pure code motion from vl.c, correct? Can you split this into a separate patch please? That'll simplify the review o the actual code changes. It also doesn't make much sense to compile hw/bt/ with CONFIG_USB_BLUETOOTH=n. It's basically dead code then. cheers, Gerd