From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:32768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tbtzs-0006oz-C6 for qemu-devel@nongnu.org; Fri, 23 Nov 2012 09:12:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tbtzg-0002xB-QZ for qemu-devel@nongnu.org; Fri, 23 Nov 2012 09:12:48 -0500 Received: from greensocs.com ([87.106.252.221]:37207 helo=s15328186.onlinehome-server.info) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tbtzg-0002wz-KF for qemu-devel@nongnu.org; Fri, 23 Nov 2012 09:12:36 -0500 Message-ID: <50AF845D.2070003@greensocs.com> Date: Fri, 23 Nov 2012 15:12:45 +0100 From: Konrad Frederic MIME-Version: 1.0 References: <1353595852-30776-1-git-send-email-fred.konrad@greensocs.com> <1353595852-30776-2-git-send-email-fred.konrad@greensocs.com> <20121123130826.285c4d06@BR9GNB5Z> In-Reply-To: <20121123130826.285c4d06@BR9GNB5Z> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, e.voevodin@samsung.com, mark.burton@greensocs.com, qemu-devel@nongnu.org, stefanha@redhat.com, afaerber@suse.de On 23/11/2012 13:08, Cornelia Huck wrote: > On Thu, 22 Nov 2012 15:50:50 +0100 > fred.konrad@greensocs.com wrote: > > >> +/* Create a virtio bus. */ >> +VirtioBus *virtio_bus_new(DeviceState *host, const VirtioBusInfo *info) >> +{ >> + /* >> + * This is needed, as we want to have different names for each virtio-bus. >> + * If we don't do that, we can't add more than one VirtIODevice. >> + */ >> + static int next_virtio_bus; >> + char *bus_name = g_strdup_printf("virtio-bus.%d", next_virtio_bus++); > This still has the overflow/id-reuse problem, hasn't it? What do you mean by overflow problem ? > >> + >> + BusState *qbus = qbus_create(TYPE_VIRTIO_BUS, host, bus_name); >> + VirtioBus *bus = VIRTIO_BUS(qbus); >> + bus->info = info; >> + qbus->allow_hotplug = 0; >> + bus->bus_in_use = false; >> + DPRINTF("%s bus created\n", bus_name); >> + return bus; >> +} > Don't you need a way to destroy the bus again when the proxy device is > hotunplugged? > Yes, you're right I must add a way to destroy the bus, and the devices when the proxy is hot unplugged! Thanks, Fred