On Thu, 22 Nov 2012 15:50:50 +0100 fred.kon...@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? > + > + 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?