From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50975) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvXpx-0007MM-3I for qemu-devel@nongnu.org; Tue, 24 Dec 2013 14:40:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VvXpr-000118-VN for qemu-devel@nongnu.org; Tue, 24 Dec 2013 14:40:17 -0500 Date: Tue, 24 Dec 2013 21:43:37 +0200 From: "Michael S. Tsirkin" Message-ID: <20131224194337.GA15879@redhat.com> References: <1387904675-7962-1-git-send-email-afaerber@suse.de> <1387904675-7962-2-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1387904675-7962-2-git-send-email-afaerber@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PULL v2 01/24] qdev: Replace no_user by cannot_instantiate_with_device_add_yet List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: Kevin Wolf , Peter Maydell , Anthony Liguori , Markus Armbruster , Alexander Graf , qemu-devel@nongnu.org, Andreas =?iso-8859-1?Q?F=E4rber?= , "Vassili Karpov (malc)" , Gerd Hoffmann , Stefan Hajnoczi , Cornelia Huck , "open list:Old World" , Richard Henderson On Tue, Dec 24, 2013 at 06:04:12PM +0100, Andreas F=E4rber wrote: > From: Markus Armbruster >=20 > In an ideal world, machines can be built by wiring devices together > with configuration, not code. Unfortunately, that's not the world we > live in right now. We still have quite a few devices that need to be > wired up by code. If you try to device_add such a device, it'll fail > in sometimes mysterious ways. If you're lucky, you get an > unmysterious immediate crash. >=20 > To protect users from such badness, DeviceClass member no_user used to > make device models unavailable with -device / device_add, but that > regressed in commit 18b6dad. The device model is still omitted from > help, but is available anyway. >=20 > Attempts to fix the regression have been rejected with the argument > that the purpose of no_user isn't clear, and it's prone to misuse. >=20 > This commit clarifies no_user's purpose. Anthony suggested to rename > it cannot_instantiate_with_device_add_yet_due_to_internal_bugs, which > I shorten somewhat to keep checkpatch happy. While there, make it > bool. >=20 > Every use of cannot_instantiate_with_device_add_yet gets a FIXME > comment asking for rationale. The next few commits will clean them > all up, either by providing a rationale, or by getting rid of the use. >=20 > With that done, the regression fix is hopefully acceptable. >=20 > Signed-off-by: Markus Armbruster > Reviewed-by: Marcel Apfelbaum > Signed-off-by: Andreas F=E4rber Sorry about not commenting on this earlier. It looks like a bunch of devices will have this flag (whatever we call it) forever. If so, _yet seems confusing, should be just cannot_instantiate_with_device_add. Doesn't have to block this patchset, we can rename it all in one patch easily. > --- > hw/acpi/piix4.c | 2 +- > hw/alpha/typhoon.c | 2 +- > hw/arm/versatilepb.c | 2 +- > hw/audio/pcspk.c | 2 +- > hw/audio/pl041.c | 2 +- > hw/block/fdc.c | 2 +- > hw/display/pl110.c | 2 +- > hw/dma/pl080.c | 2 +- > hw/i2c/smbus_ich9.c | 2 +- > hw/i386/kvm/clock.c | 2 +- > hw/i386/kvmvapic.c | 2 +- > hw/i386/pc.c | 2 +- > hw/ide/piix.c | 6 +++--- > hw/ide/via.c | 2 +- > hw/input/pckbd.c | 2 +- > hw/input/vmmouse.c | 2 +- > hw/intc/apic_common.c | 2 +- > hw/intc/arm_gic.c | 2 +- > hw/intc/arm_gic_common.c | 2 +- > hw/intc/arm_gic_kvm.c | 2 +- > hw/intc/i8259_common.c | 2 +- > hw/intc/ioapic_common.c | 2 +- > hw/intc/pl190.c | 2 +- > hw/isa/isa-bus.c | 2 +- > hw/isa/lpc_ich9.c | 2 +- > hw/isa/piix4.c | 2 +- > hw/isa/vt82c686.c | 2 +- > hw/misc/arm_l2x0.c | 2 +- > hw/misc/vmport.c | 2 +- > hw/nvram/fw_cfg.c | 2 +- > hw/pci-host/bonito.c | 4 ++-- > hw/pci-host/grackle.c | 4 ++-- > hw/pci-host/piix.c | 8 ++++---- > hw/pci-host/prep.c | 4 ++-- > hw/ppc/spapr_vio.c | 2 +- > hw/s390x/ipl.c | 2 +- > hw/s390x/s390-virtio-bus.c | 2 +- > hw/s390x/virtio-ccw.c | 2 +- > hw/sd/pl181.c | 2 +- > hw/timer/arm_mptimer.c | 2 +- > hw/timer/hpet.c | 2 +- > hw/timer/i8254_common.c | 2 +- > hw/timer/m48t59.c | 2 +- > hw/timer/mc146818rtc.c | 2 +- > hw/timer/pl031.c | 2 +- > include/hw/qdev-core.h | 13 ++++++++++++- > qdev-monitor.c | 5 +++-- > qom/cpu.c | 2 +- > 48 files changed, 69 insertions(+), 57 deletions(-) >=20 > diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c > index 93849c8..dd11534 100644 > --- a/hw/acpi/piix4.c > +++ b/hw/acpi/piix4.c > @@ -544,7 +544,7 @@ static void piix4_pm_class_init(ObjectClass *klass,= void *data) > k->revision =3D 0x03; > k->class_id =3D PCI_CLASS_BRIDGE_OTHER; > dc->desc =3D "PM"; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->vmsd =3D &vmstate_acpi; > dc->props =3D piix4_pm_properties; > } > diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c > index 59e1bb8..60987ed 100644 > --- a/hw/alpha/typhoon.c > +++ b/hw/alpha/typhoon.c > @@ -938,7 +938,7 @@ static void typhoon_pcihost_class_init(ObjectClass = *klass, void *data) > SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); > =20 > k->init =3D typhoon_pcihost_init; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo typhoon_pcihost_info =3D { > diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c > index f7e8b7e..bb0c0ba 100644 > --- a/hw/arm/versatilepb.c > +++ b/hw/arm/versatilepb.c > @@ -390,7 +390,7 @@ static void vpb_sic_class_init(ObjectClass *klass, = void *data) > SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); > =20 > k->init =3D vpb_sic_init; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->vmsd =3D &vmstate_vpb_sic; > } > =20 > diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c > index 9004ce3..8e3e178 100644 > --- a/hw/audio/pcspk.c > +++ b/hw/audio/pcspk.c > @@ -192,7 +192,7 @@ static void pcspk_class_initfn(ObjectClass *klass, = void *data) > =20 > dc->realize =3D pcspk_realizefn; > set_bit(DEVICE_CATEGORY_SOUND, dc->categories); > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->props =3D pcspk_properties; > } > =20 > diff --git a/hw/audio/pl041.c b/hw/audio/pl041.c > index 5393b52..8ba661a 100644 > --- a/hw/audio/pl041.c > +++ b/hw/audio/pl041.c > @@ -632,7 +632,7 @@ static void pl041_device_class_init(ObjectClass *kl= ass, void *data) > =20 > k->init =3D pl041_init; > set_bit(DEVICE_CATEGORY_SOUND, dc->categories); > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->reset =3D pl041_device_reset; > dc->vmsd =3D &vmstate_pl041; > dc->props =3D pl041_device_properties; > diff --git a/hw/block/fdc.c b/hw/block/fdc.c > index c5a6c21..86f4920 100644 > --- a/hw/block/fdc.c > +++ b/hw/block/fdc.c > @@ -2234,7 +2234,7 @@ static void isabus_fdc_class_init(ObjectClass *kl= ass, void *data) > =20 > dc->realize =3D isabus_fdc_realize; > dc->fw_name =3D "fdc"; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->reset =3D fdctrl_external_reset_isa; > dc->vmsd =3D &vmstate_isa_fdc; > dc->props =3D isa_fdc_properties; > diff --git a/hw/display/pl110.c b/hw/display/pl110.c > index 790e510..7ad5972 100644 > --- a/hw/display/pl110.c > +++ b/hw/display/pl110.c > @@ -496,7 +496,7 @@ static void pl110_class_init(ObjectClass *klass, vo= id *data) > =20 > k->init =3D pl110_initfn; > set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->vmsd =3D &vmstate_pl110; > } > =20 > diff --git a/hw/dma/pl080.c b/hw/dma/pl080.c > index 35b9015..a515621 100644 > --- a/hw/dma/pl080.c > +++ b/hw/dma/pl080.c > @@ -381,7 +381,7 @@ static void pl080_class_init(ObjectClass *oc, void = *data) > { > DeviceClass *dc =3D DEVICE_CLASS(oc); > =20 > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->vmsd =3D &vmstate_pl080; > } > =20 > diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c > index ca22978..c1ffa34 100644 > --- a/hw/i2c/smbus_ich9.c > +++ b/hw/i2c/smbus_ich9.c > @@ -97,7 +97,7 @@ static void ich9_smb_class_init(ObjectClass *klass, v= oid *data) > k->device_id =3D PCI_DEVICE_ID_INTEL_ICH9_6; > k->revision =3D ICH9_A2_SMB_REVISION; > k->class_id =3D PCI_CLASS_SERIAL_SMBUS; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->vmsd =3D &vmstate_ich9_smbus; > dc->desc =3D "ICH9 SMBUS Bridge"; > k->init =3D ich9_smbus_initfn; > diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c > index 383938d..abd2ce8 100644 > --- a/hw/i386/kvm/clock.c > +++ b/hw/i386/kvm/clock.c > @@ -114,7 +114,7 @@ static void kvmclock_class_init(ObjectClass *klass,= void *data) > DeviceClass *dc =3D DEVICE_CLASS(klass); > =20 > dc->realize =3D kvmclock_realize; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->vmsd =3D &kvmclock_vmsd; > } > =20 > diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c > index 2d87600..f1a0a9d 100644 > --- a/hw/i386/kvmvapic.c > +++ b/hw/i386/kvmvapic.c > @@ -827,7 +827,7 @@ static void vapic_class_init(ObjectClass *klass, vo= id *data) > { > DeviceClass *dc =3D DEVICE_CLASS(klass); > =20 > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->reset =3D vapic_reset; > dc->vmsd =3D &vmstate_vapic; > dc->realize =3D vapic_realize; > diff --git a/hw/i386/pc.c b/hw/i386/pc.c > index 3cd8f38..1e6e8af 100644 > --- a/hw/i386/pc.c > +++ b/hw/i386/pc.c > @@ -547,7 +547,7 @@ static void port92_class_initfn(ObjectClass *klass,= void *data) > { > DeviceClass *dc =3D DEVICE_CLASS(klass); > =20 > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->realize =3D port92_realizefn; > dc->reset =3D port92_reset; > dc->vmsd =3D &vmstate_port92_isa; > diff --git a/hw/ide/piix.c b/hw/ide/piix.c > index ab36749..27b08e1 100644 > --- a/hw/ide/piix.c > +++ b/hw/ide/piix.c > @@ -248,7 +248,7 @@ static void piix3_ide_class_init(ObjectClass *klass= , void *data) > k->device_id =3D PCI_DEVICE_ID_INTEL_82371SB_1; > k->class_id =3D PCI_CLASS_STORAGE_IDE; > set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo piix3_ide_info =3D { > @@ -267,7 +267,7 @@ static void piix3_ide_xen_class_init(ObjectClass *k= lass, void *data) > k->device_id =3D PCI_DEVICE_ID_INTEL_82371SB_1; > k->class_id =3D PCI_CLASS_STORAGE_IDE; > set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->unplug =3D pci_piix3_xen_ide_unplug; > } > =20 > @@ -289,7 +289,7 @@ static void piix4_ide_class_init(ObjectClass *klass= , void *data) > k->device_id =3D PCI_DEVICE_ID_INTEL_82371AB; > k->class_id =3D PCI_CLASS_STORAGE_IDE; > set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo piix4_ide_info =3D { > diff --git a/hw/ide/via.c b/hw/ide/via.c > index 99468c7..b556c14 100644 > --- a/hw/ide/via.c > +++ b/hw/ide/via.c > @@ -225,7 +225,7 @@ static void via_ide_class_init(ObjectClass *klass, = void *data) > k->revision =3D 0x06; > k->class_id =3D PCI_CLASS_STORAGE_IDE; > set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo via_ide_info =3D { > diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c > index ce86237..dee31a6 100644 > --- a/hw/input/pckbd.c > +++ b/hw/input/pckbd.c > @@ -522,7 +522,7 @@ static void i8042_class_initfn(ObjectClass *klass, = void *data) > DeviceClass *dc =3D DEVICE_CLASS(klass); > =20 > dc->realize =3D i8042_realizefn; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->vmsd =3D &vmstate_kbd_isa; > } > =20 > diff --git a/hw/input/vmmouse.c b/hw/input/vmmouse.c > index abd032b..600e4a2 100644 > --- a/hw/input/vmmouse.c > +++ b/hw/input/vmmouse.c > @@ -282,7 +282,7 @@ static void vmmouse_class_initfn(ObjectClass *klass= , void *data) > DeviceClass *dc =3D DEVICE_CLASS(klass); > =20 > dc->realize =3D vmmouse_realizefn; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->reset =3D vmmouse_reset; > dc->vmsd =3D &vmstate_vmmouse; > dc->props =3D vmmouse_properties; > diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c > index a0beb10..ea420c7 100644 > --- a/hw/intc/apic_common.c > +++ b/hw/intc/apic_common.c > @@ -386,7 +386,7 @@ static void apic_common_class_init(ObjectClass *kla= ss, void *data) > =20 > dc->vmsd =3D &vmstate_apic_common; > dc->reset =3D apic_reset_common; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->props =3D apic_properties_common; > idc->init =3D apic_init_common; > } > diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c > index d431b7a..24ad276 100644 > --- a/hw/intc/arm_gic.c > +++ b/hw/intc/arm_gic.c > @@ -704,7 +704,7 @@ static void arm_gic_class_init(ObjectClass *klass, = void *data) > DeviceClass *dc =3D DEVICE_CLASS(klass); > ARMGICClass *agc =3D ARM_GIC_CLASS(klass); > =20 > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > agc->parent_realize =3D dc->realize; > dc->realize =3D arm_gic_realize; > } > diff --git a/hw/intc/arm_gic_common.c b/hw/intc/arm_gic_common.c > index c765850..214a585 100644 > --- a/hw/intc/arm_gic_common.c > +++ b/hw/intc/arm_gic_common.c > @@ -156,7 +156,7 @@ static void arm_gic_common_class_init(ObjectClass *= klass, void *data) > dc->realize =3D arm_gic_common_realize; > dc->props =3D arm_gic_common_properties; > dc->vmsd =3D &vmstate_gic; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo arm_gic_common_type =3D { > diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c > index f713975..a0bbf12 100644 > --- a/hw/intc/arm_gic_kvm.c > +++ b/hw/intc/arm_gic_kvm.c > @@ -150,7 +150,7 @@ static void kvm_arm_gic_class_init(ObjectClass *kla= ss, void *data) > kgc->parent_reset =3D dc->reset; > dc->realize =3D kvm_arm_gic_realize; > dc->reset =3D kvm_arm_gic_reset; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo kvm_arm_gic_info =3D { > diff --git a/hw/intc/i8259_common.c b/hw/intc/i8259_common.c > index 803d037..2acdbfe 100644 > --- a/hw/intc/i8259_common.c > +++ b/hw/intc/i8259_common.c > @@ -135,7 +135,7 @@ static void pic_common_class_init(ObjectClass *klas= s, void *data) > DeviceClass *dc =3D DEVICE_CLASS(klass); > =20 > dc->vmsd =3D &vmstate_pic_common; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->props =3D pic_properties_common; > dc->realize =3D pic_common_realize; > } > diff --git a/hw/intc/ioapic_common.c b/hw/intc/ioapic_common.c > index 6b705c1..cc5a80d 100644 > --- a/hw/intc/ioapic_common.c > +++ b/hw/intc/ioapic_common.c > @@ -98,7 +98,7 @@ static void ioapic_common_class_init(ObjectClass *kla= ss, void *data) > =20 > dc->realize =3D ioapic_common_realize; > dc->vmsd =3D &vmstate_ioapic_common; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo ioapic_common_type =3D { > diff --git a/hw/intc/pl190.c b/hw/intc/pl190.c > index 329680d..b16bc02 100644 > --- a/hw/intc/pl190.c > +++ b/hw/intc/pl190.c > @@ -273,7 +273,7 @@ static void pl190_class_init(ObjectClass *klass, vo= id *data) > SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); > =20 > k->init =3D pl190_init; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->reset =3D pl190_reset; > dc->vmsd =3D &vmstate_pl190; > } > diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c > index 9e104eb..6b2114d 100644 > --- a/hw/isa/isa-bus.c > +++ b/hw/isa/isa-bus.c > @@ -197,7 +197,7 @@ static void isabus_bridge_class_init(ObjectClass *k= lass, void *data) > DeviceClass *dc =3D DEVICE_CLASS(klass); > =20 > dc->fw_name =3D "isa"; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo isabus_bridge_info =3D { > diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c > index 19b2198..c1ca4d4 100644 > --- a/hw/isa/lpc_ich9.c > +++ b/hw/isa/lpc_ich9.c > @@ -644,7 +644,7 @@ static void ich9_lpc_class_init(ObjectClass *klass,= void *data) > dc->reset =3D ich9_lpc_reset; > k->init =3D ich9_lpc_initfn; > dc->vmsd =3D &vmstate_ich9_lpc; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > k->config_write =3D ich9_lpc_config_write; > dc->desc =3D "ICH9 LPC bridge"; > k->vendor_id =3D PCI_VENDOR_ID_INTEL; > diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c > index 1a1d451..d9dac61 100644 > --- a/hw/isa/piix4.c > +++ b/hw/isa/piix4.c > @@ -113,7 +113,7 @@ static void piix4_class_init(ObjectClass *klass, vo= id *data) > k->device_id =3D PCI_DEVICE_ID_INTEL_82371AB_0; > k->class_id =3D PCI_CLASS_BRIDGE_ISA; > dc->desc =3D "ISA bridge"; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->vmsd =3D &vmstate_piix4; > } > =20 > diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c > index 5fb8086..b06d15e 100644 > --- a/hw/isa/vt82c686.c > +++ b/hw/isa/vt82c686.c > @@ -480,7 +480,7 @@ static void via_class_init(ObjectClass *klass, void= *data) > k->class_id =3D PCI_CLASS_BRIDGE_ISA; > k->revision =3D 0x40; > dc->desc =3D "ISA bridge"; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->vmsd =3D &vmstate_via; > } > =20 > diff --git a/hw/misc/arm_l2x0.c b/hw/misc/arm_l2x0.c > index 8e192cd..ceea99d 100644 > --- a/hw/misc/arm_l2x0.c > +++ b/hw/misc/arm_l2x0.c > @@ -179,7 +179,7 @@ static void l2x0_class_init(ObjectClass *klass, voi= d *data) > =20 > k->init =3D l2x0_priv_init; > dc->vmsd =3D &vmstate_l2x0; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->props =3D l2x0_properties; > dc->reset =3D l2x0_priv_reset; > } > diff --git a/hw/misc/vmport.c b/hw/misc/vmport.c > index 0b5a564..94ae6ae 100644 > --- a/hw/misc/vmport.c > +++ b/hw/misc/vmport.c > @@ -162,7 +162,7 @@ static void vmport_class_initfn(ObjectClass *klass,= void *data) > DeviceClass *dc =3D DEVICE_CLASS(klass); > =20 > dc->realize =3D vmport_realizefn; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo vmport_info =3D { > diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c > index f5dc3ea..6075bfc 100644 > --- a/hw/nvram/fw_cfg.c > +++ b/hw/nvram/fw_cfg.c > @@ -599,7 +599,7 @@ static void fw_cfg_class_init(ObjectClass *klass, v= oid *data) > DeviceClass *dc =3D DEVICE_CLASS(klass); > =20 > dc->realize =3D fw_cfg_realize; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->reset =3D fw_cfg_reset; > dc->vmsd =3D &vmstate_fw_cfg; > dc->props =3D fw_cfg_properties; > diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c > index 5086d42..2e08e9d 100644 > --- a/hw/pci-host/bonito.c > +++ b/hw/pci-host/bonito.c > @@ -806,7 +806,7 @@ static void bonito_class_init(ObjectClass *klass, v= oid *data) > k->revision =3D 0x01; > k->class_id =3D PCI_CLASS_BRIDGE_HOST; > dc->desc =3D "Host bridge"; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->vmsd =3D &vmstate_bonito; > } > =20 > @@ -823,7 +823,7 @@ static void bonito_pcihost_class_init(ObjectClass *= klass, void *data) > SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); > =20 > k->init =3D bonito_pcihost_initfn; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo bonito_pcihost_info =3D { > diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c > index 75b60d3..ba6017f 100644 > --- a/hw/pci-host/grackle.c > +++ b/hw/pci-host/grackle.c > @@ -130,7 +130,7 @@ static void grackle_pci_class_init(ObjectClass *kla= ss, void *data) > k->device_id =3D PCI_DEVICE_ID_MOTOROLA_MPC106; > k->revision =3D 0x00; > k->class_id =3D PCI_CLASS_BRIDGE_HOST; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo grackle_pci_info =3D { > @@ -146,7 +146,7 @@ static void pci_grackle_class_init(ObjectClass *kla= ss, void *data) > DeviceClass *dc =3D DEVICE_CLASS(klass); > =20 > k->init =3D pci_grackle_init_device; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo grackle_pci_host_info =3D { > diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c > index 63be7f6..333358e 100644 > --- a/hw/pci-host/piix.c > +++ b/hw/pci-host/piix.c > @@ -635,7 +635,7 @@ static void piix3_class_init(ObjectClass *klass, vo= id *data) > =20 > dc->desc =3D "ISA bridge"; > dc->vmsd =3D &vmstate_piix3; > - dc->no_user =3D 1, > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > k->no_hotplug =3D 1; > k->init =3D piix3_initfn; > k->config_write =3D piix3_write_config; > @@ -659,7 +659,7 @@ static void piix3_xen_class_init(ObjectClass *klass= , void *data) > =20 > dc->desc =3D "ISA bridge"; > dc->vmsd =3D &vmstate_piix3; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > k->no_hotplug =3D 1; > k->init =3D piix3_initfn; > k->config_write =3D piix3_write_config_xen; > @@ -689,7 +689,7 @@ static void i440fx_class_init(ObjectClass *klass, v= oid *data) > k->revision =3D 0x02; > k->class_id =3D PCI_CLASS_BRIDGE_HOST; > dc->desc =3D "Host bridge"; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->vmsd =3D &vmstate_i440fx; > } > =20 > @@ -727,7 +727,7 @@ static void i440fx_pcihost_class_init(ObjectClass *= klass, void *data) > hc->root_bus_path =3D i440fx_pcihost_root_bus_path; > dc->realize =3D i440fx_pcihost_realize; > dc->fw_name =3D "pci"; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->props =3D i440fx_props; > } > =20 > diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c > index 0e71fdb..58b8c5e 100644 > --- a/hw/pci-host/prep.c > +++ b/hw/pci-host/prep.c > @@ -198,7 +198,7 @@ static void raven_class_init(ObjectClass *klass, vo= id *data) > k->class_id =3D PCI_CLASS_BRIDGE_HOST; > dc->desc =3D "PReP Host Bridge - Motorola Raven"; > dc->vmsd =3D &vmstate_raven; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo raven_info =3D { > @@ -215,7 +215,7 @@ static void raven_pcihost_class_init(ObjectClass *k= lass, void *data) > set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); > dc->realize =3D raven_pcihost_realizefn; > dc->fw_name =3D "pci"; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo raven_pcihost_info =3D { > diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c > index fee6195..e328f53 100644 > --- a/hw/ppc/spapr_vio.c > +++ b/hw/ppc/spapr_vio.c > @@ -532,7 +532,7 @@ static void spapr_vio_bridge_class_init(ObjectClass= *klass, void *data) > SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); > =20 > k->init =3D spapr_vio_bridge_init; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo spapr_vio_bridge_info =3D { > diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c > index 65d39da..26a717c 100644 > --- a/hw/s390x/ipl.c > +++ b/hw/s390x/ipl.c > @@ -182,7 +182,7 @@ static void s390_ipl_class_init(ObjectClass *klass,= void *data) > k->init =3D s390_ipl_init; > dc->props =3D s390_ipl_properties; > dc->reset =3D s390_ipl_reset; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo s390_ipl_info =3D { > diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c > index 6a83111..eccc3e7 100644 > --- a/hw/s390x/s390-virtio-bus.c > +++ b/hw/s390x/s390-virtio-bus.c > @@ -680,7 +680,7 @@ static void s390_virtio_bridge_class_init(ObjectCla= ss *klass, void *data) > SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); > =20 > k->init =3D s390_virtio_bridge_init; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo s390_virtio_bridge_info =3D { > diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c > index ecc80ec..3be9268 100644 > --- a/hw/s390x/virtio-ccw.c > +++ b/hw/s390x/virtio-ccw.c > @@ -1287,7 +1287,7 @@ static void virtual_css_bridge_class_init(ObjectC= lass *klass, void *data) > SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); > =20 > k->init =3D virtual_css_bridge_init; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo virtual_css_bridge_info =3D { > diff --git a/hw/sd/pl181.c b/hw/sd/pl181.c > index c35896d..d830188 100644 > --- a/hw/sd/pl181.c > +++ b/hw/sd/pl181.c > @@ -506,7 +506,7 @@ static void pl181_class_init(ObjectClass *klass, vo= id *data) > sdc->init =3D pl181_init; > k->vmsd =3D &vmstate_pl181; > k->reset =3D pl181_reset; > - k->no_user =3D 1; > + k->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expla= in why */ > } > =20 > static const TypeInfo pl181_info =3D { > diff --git a/hw/timer/arm_mptimer.c b/hw/timer/arm_mptimer.c > index d9f9494..1dc44cd 100644 > --- a/hw/timer/arm_mptimer.c > +++ b/hw/timer/arm_mptimer.c > @@ -274,7 +274,7 @@ static void arm_mptimer_class_init(ObjectClass *kla= ss, void *data) > dc->realize =3D arm_mptimer_realize; > dc->vmsd =3D &vmstate_arm_mptimer; > dc->reset =3D arm_mptimer_reset; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->props =3D arm_mptimer_properties; > } > =20 > diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c > index bb3bf98..74e0297 100644 > --- a/hw/timer/hpet.c > +++ b/hw/timer/hpet.c > @@ -765,7 +765,7 @@ static void hpet_device_class_init(ObjectClass *kla= ss, void *data) > DeviceClass *dc =3D DEVICE_CLASS(klass); > =20 > dc->realize =3D hpet_realize; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->reset =3D hpet_reset; > dc->vmsd =3D &vmstate_hpet; > dc->props =3D hpet_device_properties; > diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c > index e8fb971..dc2196c 100644 > --- a/hw/timer/i8254_common.c > +++ b/hw/timer/i8254_common.c > @@ -282,7 +282,7 @@ static void pit_common_class_init(ObjectClass *klas= s, void *data) > =20 > dc->realize =3D pit_common_realize; > dc->vmsd =3D &vmstate_pit_common; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo pit_common_type =3D { > diff --git a/hw/timer/m48t59.c b/hw/timer/m48t59.c > index be0592b..e079d41 100644 > --- a/hw/timer/m48t59.c > +++ b/hw/timer/m48t59.c > @@ -750,7 +750,7 @@ static void m48t59_isa_class_init(ObjectClass *klas= s, void *data) > DeviceClass *dc =3D DEVICE_CLASS(klass); > =20 > dc->realize =3D m48t59_isa_realize; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->reset =3D m48t59_reset_isa; > dc->props =3D m48t59_isa_properties; > } > diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c > index b011638..ad61e2c 100644 > --- a/hw/timer/mc146818rtc.c > +++ b/hw/timer/mc146818rtc.c > @@ -899,7 +899,7 @@ static void rtc_class_initfn(ObjectClass *klass, vo= id *data) > DeviceClass *dc =3D DEVICE_CLASS(klass); > =20 > dc->realize =3D rtc_realizefn; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->vmsd =3D &vmstate_rtc; > dc->props =3D mc146818rtc_properties; > } > diff --git a/hw/timer/pl031.c b/hw/timer/pl031.c > index 65928a4..2f7360c 100644 > --- a/hw/timer/pl031.c > +++ b/hw/timer/pl031.c > @@ -251,7 +251,7 @@ static void pl031_class_init(ObjectClass *klass, vo= id *data) > SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); > =20 > k->init =3D pl031_init; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > dc->vmsd =3D &vmstate_pl031; > } > =20 > diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h > index f2043a6..c8945a4 100644 > --- a/include/hw/qdev-core.h > +++ b/include/hw/qdev-core.h > @@ -97,7 +97,18 @@ typedef struct DeviceClass { > const char *fw_name; > const char *desc; > Property *props; > - int no_user; > + > + /* > + * Shall we hide this device model from -device / device_add? > + * All devices should support instantiation with device_add, and > + * this flag should not exist. But we're not there, yet. Some > + * devices fail to instantiate with cryptic error messages. > + * Others instantiate, but don't work. Exposing users to such > + * behavior would be cruel; this flag serves to protect them. It > + * should never be set without a comment explaining why it is set. > + * TODO remove once we're there > + */ > + bool cannot_instantiate_with_device_add_yet; > =20 > /* callbacks */ > void (*reset)(DeviceState *dev); > diff --git a/qdev-monitor.c b/qdev-monitor.c > index dc37a43..f2a5a6f 100644 > --- a/qdev-monitor.c > +++ b/qdev-monitor.c > @@ -87,7 +87,7 @@ static void qdev_print_devinfo(DeviceClass *dc) > if (dc->desc) { > error_printf(", desc \"%s\"", dc->desc); > } > - if (dc->no_user) { > + if (dc->cannot_instantiate_with_device_add_yet) { > error_printf(", no-user"); > } > error_printf("\n"); > @@ -127,7 +127,8 @@ static void qdev_print_devinfos(bool show_no_user) > if ((i < DEVICE_CATEGORY_MAX > ? !test_bit(i, dc->categories) > : !bitmap_empty(dc->categories, DEVICE_CATEGORY_MAX)) > - || (!show_no_user && dc->no_user)) { > + || (!show_no_user > + && dc->cannot_instantiate_with_device_add_yet)) { > continue; > } > if (!cat_printed) { > diff --git a/qom/cpu.c b/qom/cpu.c > index 818fb26..09c15e6 100644 > --- a/qom/cpu.c > +++ b/qom/cpu.c > @@ -254,7 +254,7 @@ static void cpu_class_init(ObjectClass *klass, void= *data) > k->gdb_read_register =3D cpu_common_gdb_read_register; > k->gdb_write_register =3D cpu_common_gdb_write_register; > dc->realize =3D cpu_common_realizefn; > - dc->no_user =3D 1; > + dc->cannot_instantiate_with_device_add_yet =3D true; /* FIXME expl= ain why */ > } > =20 > static const TypeInfo cpu_type_info =3D { > --=20 > 1.8.4 >=20