Received: from eggs.gnu.org ([2001:4830:134:3::10]:57457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6jy1-0007uV-Db for qemu-devel@nongnu.org; Fri, 05 May 2017 16:36:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6jy0-0006c2-Gy for qemu-devel@nongnu.org; Fri, 05 May 2017 16:36:45 -0400 Date: Fri, 5 May 2017 17:36:20 -0300 From: Eduardo Habkost Message-ID: <20170505203620.GN3482@thinpad.lan.raisama.net> References: <20170503203604.31462-1-ehabkost@redhat.com> <20170503203604.31462-3-ehabkost@redhat.com> <20170505093622.37902dea.cornelia.huck@de.ibm.com> <20170505165419.GF3482@thinpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170505165419.GF3482@thinpad.lan.raisama.net> Subject: [Qemu-devel] [PATCH] fixup! sysbus: Set user_creatable=false by default on TYPE_SYS_BUS_DEVICE List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck Cc: qemu-devel@nongnu.org, Laszlo Ersek , Thomas Huth , Alexander Graf , Markus Armbruster , Marcel Apfelbaum , Peter Maydell , Alex Williamson , Alistair Francis , Beniamino Galvani , Christian Borntraeger , David Gibson , "Edgar E. Iglesias" , Frank Blaschka , "Gabriel L . Somlo" , Gerd Hoffmann , Igor Mammedov , Jason Wang , John Snow , Juergen Gross , Kevin Wolf , Max Reitz , "Michael S. Tsirkin" , Paolo Bonzini , Pierre Morel , Prasad J Pandit , qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Rob Herring , Shannon Zhao , sstabellini@kernel.org, Yi Min Zhao On Fri, May 05, 2017 at 01:54:19PM -0300, Eduardo Habkost wrote: > On Fri, May 05, 2017 at 09:36:22AM +0200, Cornelia Huck wrote: > [...] > > > diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c > > > index c0f560b289..6a2eec8dd0 100644 > > > --- a/hw/core/sysbus.c > > > +++ b/hw/core/sysbus.c > > > @@ -326,6 +326,17 @@ static void sysbus_device_class_init(ObjectClass *klass, void *data) > > > DeviceClass *k = DEVICE_CLASS(klass); > > > k->init = sysbus_device_init; > > > k->bus_type = TYPE_SYSTEM_BUS; > > > + /* > > > + * device_add plugs devices into suitable bus. For "real" buses, > > > > s/suitable/a suitable/ > > Thanks, I will fix it. > > > > > > + * that actually connects the device. For sysbus, the connections > > > + * need to be made separately, and device_add can't do that. The > > > + * device would be left unconnected, and will probably not work > > > + * > > > + * However, a few machines and a few devices can handle a few sysbus > > > + * devices. In this case, the device subclass needs to override > > > > Should that rather be "a few machines can handle a few specific sysbus > > devices"? > > I will extend it to "a few machines can handle device_add for a > few specific sysbus devices". Thanks for spotting it. Fixup will be included in v3, or can be applied by maintainer: Signed-off-by: Eduardo Habkost --- hw/core/sysbus.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 6a2eec8dd0..5d0887f499 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -327,14 +327,14 @@ static void sysbus_device_class_init(ObjectClass *klass, void *data) k->init = sysbus_device_init; k->bus_type = TYPE_SYSTEM_BUS; /* - * device_add plugs devices into suitable bus. For "real" buses, + * device_add plugs devices into a suitable bus. For "real" buses, * that actually connects the device. For sysbus, the connections * need to be made separately, and device_add can't do that. The * device would be left unconnected, and will probably not work * - * However, a few machines and a few devices can handle a few sysbus - * devices. In this case, the device subclass needs to override - * it and set user_creatable=true. + * However, a few machines can handle device_add/-device with + * a few specific sysbus devices. In those cases, the device + * subclass needs to override it and set user_creatable=true. */ k->user_creatable = false; } -- 2.11.0.259.g40922b1