Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MsbmF-0000Vp-Ht for qemu-devel@nongnu.org; Tue, 29 Sep 2009 08:25:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Msbm8-0000Tj-Qg for qemu-devel@nongnu.org; Tue, 29 Sep 2009 08:25:53 -0400 Received: from [199.232.76.173] (port=38842 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Msbm7-0000TN-Vn for qemu-devel@nongnu.org; Tue, 29 Sep 2009 08:25:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39408) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Msbm7-0007La-9P for qemu-devel@nongnu.org; Tue, 29 Sep 2009 08:25:47 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8TCPkNS028022 for ; Tue, 29 Sep 2009 08:25:46 -0400 Subject: Re: [Qemu-devel] [PATCH 16/24] qdev hotplug: infrastructure and monitor commands. References: <1253907769-1067-1-git-send-email-kraxel@redhat.com> <1253907769-1067-17-git-send-email-kraxel@redhat.com> <87r5tqdd4c.fsf@pike.pond.sub.org> <4AC1CE72.5090601@redhat.com> From: Markus Armbruster Date: Tue, 29 Sep 2009 14:25:43 +0200 In-Reply-To: <4AC1CE72.5090601@redhat.com> (Gerd Hoffmann's message of "Tue\, 29 Sep 2009 11\:08\:02 +0200") Message-ID: <871vlq6ipk.fsf@pike.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org Gerd Hoffmann writes: [...] >> >> As far as I can see, all qdev_hotplug does is telling qdev_device_add() >> and qdev_create() that this is a hotplug. > > Yes. > >> What about something like: >> >> DeviceState *qdev_device_add(QemuOpts *opts, int hotplug) >> { >> [...] >> if (hotplug&& !bus->allow_hotplug) { >> qemu_error("Bus %s does not support hotplugging\n", >> bus->name); >> return NULL; >> } >> >> /* create device, set properties */ >> qdev = qdev_create(bus, driver); >> if (hotplug) { >> dev->hotplugged = 1; > > I started that way. Doesn't fly. Not every device creation goes > through qdev_device_add(). Thus you'll have to do this in > qdev_create(), which in turn means that you would have to add a > hotplug parameter to tons of functions just to pass it down to > qdev_create ... Isn't it sufficient if every *hotplug* device creation goes through qdev_device_add()?