qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH RFC 0/9] Clean up and fix no_user
@ 2013-10-10 14:42 armbru
  2013-10-10 14:42 ` [Qemu-devel] [PATCH RFC 1/9] qdev: Replace no_user by cannot_instantiate_with_device_add_yet armbru
                   ` (10 more replies)
  0 siblings, 11 replies; 38+ messages in thread
From: armbru @ 2013-10-10 14:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: borntraeger, afaerber, anthony, peter.maydell

From: Markus Armbruster <armbru@redhat.com>

Note: this series is on top of my "Improve -device command line help
some more" series.  You can also get it from branch no-user at
git://repo.or.cz/qemu/armbru.git

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.

We used to protect users from such badness by marking devices where
device_add cannot possibly work "no-user", and refusing to device_add
them.  Anthony silently broke the protection in v1.1.  He has rejected
attempts to unbreak it with the argument that the protection makes it
impossible to wire devices together with configuration, not code, and
that the protection is being misused[*].

On the former, I disagree.  The problem isn't protecting users from
devices that cannot be wired up that way, it's devices that cannot be
wired up that way.

On the latter, Anthony has a point: the purpose of the no-user flag
isn't obvious, and some of its uses are suspect.

So, instead of just fixing the regression, this RFC series first
explores how to address that point.  PATCH 1 clarifies the purpose of
no-user.  PATCH 2-8 clean up and document its user.  PATCH 9 fixes the
regression.

This is RFC because a few unclear uses are left after PATCH 2-8:
kvm-i8259, piix3-ide, piix3-ide-xen, piix4-ide, via-ide, and abstract
TYPE_CPU.  Please chime in with arguments why these should or should
not be available with -device.

[*] Thread
https://lists.nongnu.org/archive/html/qemu-devel/2013-01/msg00717.html
and
https://lists.nongnu.org/archive/html/qemu-devel/2013-03/msg00437.html

Markus Armbruster (9):
  qdev: Replace no_user by cannot_instantiate_with_device_add_yet
  sysbus: Set cannot_instantiate_with_device_add_yet
  apic: Document why cannot_instantiate_with_device_add_yet
  pci-host: Consistently set cannot_instantiate_with_device_add_yet
  ich9: Document why cannot_instantiate_with_device_add_yet
  piix3 piix4: Document why cannot_instantiate_with_device_add_yet
  vt82c686: Document why cannot_instantiate_with_device_add_yet
  isa: Clean up use of cannot_instantiate_with_device_add_yet
  qdev: Do not let the user try to device_add when it cannot work

 hw/acpi/piix4.c            |  7 ++++++-
 hw/alpha/typhoon.c         |  2 --
 hw/arm/versatilepb.c       |  1 -
 hw/audio/pcspk.c           |  3 ++-
 hw/audio/pl041.c           |  1 -
 hw/block/fdc.c             |  1 -
 hw/core/sysbus.c           |  7 +++++++
 hw/display/pl110.c         |  1 -
 hw/dma/pl080.c             |  1 -
 hw/i2c/smbus_ich9.c        |  6 +++++-
 hw/i386/kvm/clock.c        |  1 -
 hw/i386/kvm/i8259.c        |  1 +
 hw/i386/kvmvapic.c         |  1 -
 hw/i386/pc.c               |  1 -
 hw/ide/piix.c              |  6 +++---
 hw/ide/via.c               |  2 +-
 hw/input/pckbd.c           |  1 -
 hw/input/vmmouse.c         |  3 ++-
 hw/intc/apic_common.c      |  6 +++++-
 hw/intc/arm_gic.c          |  1 -
 hw/intc/arm_gic_common.c   |  1 -
 hw/intc/arm_gic_kvm.c      |  1 -
 hw/intc/i8259.c            |  2 ++
 hw/intc/i8259_common.c     |  1 -
 hw/intc/ioapic_common.c    |  1 -
 hw/intc/pl190.c            |  1 -
 hw/isa/isa-bus.c           |  1 -
 hw/isa/lpc_ich9.c          |  7 +++++--
 hw/isa/piix4.c             |  6 +++++-
 hw/isa/vt82c686.c          |  6 +++++-
 hw/mips/gt64xxx_pci.c      |  5 +++++
 hw/misc/arm_l2x0.c         |  1 -
 hw/misc/vmport.c           |  3 ++-
 hw/nvram/fw_cfg.c          |  1 -
 hw/pci-bridge/dec.c        |  5 +++++
 hw/pci-host/apb.c          |  5 +++++
 hw/pci-host/bonito.c       |  8 +++++---
 hw/pci-host/grackle.c      |  8 +++++---
 hw/pci-host/piix.c         | 19 +++++++++++++++----
 hw/pci-host/ppce500.c      |  5 +++++
 hw/pci-host/prep.c         |  7 +++++--
 hw/pci-host/q35.c          |  5 +++++
 hw/pci-host/uninorth.c     | 20 ++++++++++++++++++++
 hw/pci-host/versatile.c    |  5 +++++
 hw/ppc/ppc4xx_pci.c        |  5 +++++
 hw/ppc/spapr_vio.c         |  2 --
 hw/s390x/ipl.c             |  1 -
 hw/s390x/s390-virtio-bus.c |  2 --
 hw/s390x/virtio-ccw.c      |  2 --
 hw/sd/pl181.c              |  1 -
 hw/sh4/sh_pci.c            |  5 +++++
 hw/timer/arm_mptimer.c     |  1 -
 hw/timer/hpet.c            |  1 -
 hw/timer/i8254_common.c    |  1 -
 hw/timer/m48t59.c          |  1 -
 hw/timer/mc146818rtc.c     |  1 -
 hw/timer/pl031.c           |  1 -
 include/hw/qdev-core.h     | 13 ++++++++++++-
 qdev-monitor.c             |  7 ++++---
 qom/cpu.c                  |  2 +-
 60 files changed, 158 insertions(+), 65 deletions(-)

-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2013-10-29 16:27 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-10 14:42 [Qemu-devel] [PATCH RFC 0/9] Clean up and fix no_user armbru
2013-10-10 14:42 ` [Qemu-devel] [PATCH RFC 1/9] qdev: Replace no_user by cannot_instantiate_with_device_add_yet armbru
2013-10-10 14:42 ` [Qemu-devel] [PATCH RFC 2/9] sysbus: Set cannot_instantiate_with_device_add_yet armbru
2013-10-10 14:42 ` [Qemu-devel] [PATCH RFC 3/9] apic: Document why cannot_instantiate_with_device_add_yet armbru
2013-10-10 14:42 ` [Qemu-devel] [PATCH RFC 4/9] pci-host: Consistently set cannot_instantiate_with_device_add_yet armbru
2013-10-10 14:42 ` [Qemu-devel] [PATCH RFC 5/9] ich9: Document why cannot_instantiate_with_device_add_yet armbru
2013-10-10 16:01   ` Paolo Bonzini
2013-10-10 16:03     ` Paolo Bonzini
2013-10-11  6:13       ` Markus Armbruster
2013-10-10 14:42 ` [Qemu-devel] [PATCH RFC 6/9] piix3 piix4: " armbru
2013-10-10 14:42 ` [Qemu-devel] [PATCH RFC 7/9] vt82c686: " armbru
2013-10-10 14:42 ` [Qemu-devel] [PATCH RFC 8/9] isa: Clean up use of cannot_instantiate_with_device_add_yet armbru
2013-10-15 12:43   ` [Qemu-devel] Should the i8259 devices remain no-user? (was: [PATCH RFC 8/9] isa: Clean up use of cannot_instantiate_with_device_add_yet) Markus Armbruster
2013-10-15 12:54     ` [Qemu-devel] Should the i8259 devices remain no-user? Paolo Bonzini
2013-10-16  9:51       ` Markus Armbruster
2013-10-16 11:06         ` Paolo Bonzini
2013-10-16 16:12           ` Markus Armbruster
2013-10-16 16:21           ` BALATON Zoltan
2013-10-16 16:23             ` Paolo Bonzini
2013-10-26 20:00               ` [Qemu-devel] fix clearing i8259 IRQ lines (Was: Should the i8259 devices remain no-user?) Matthew Ogilvie
2013-10-29 16:27                 ` BALATON Zoltan
2013-10-10 14:42 ` [Qemu-devel] [PATCH RFC 9/9] qdev: Do not let the user try to device_add when it cannot work armbru
2013-10-15 12:24 ` [Qemu-devel] Why is TYPE_CPU no-user? (was: [PATCH RFC 0/9] Clean up and fix no_user) Markus Armbruster
2013-10-15 12:37   ` Peter Maydell
2013-10-15 14:01     ` [Qemu-devel] Why is TYPE_CPU no-user? Markus Armbruster
2013-10-15 13:08   ` Andreas Färber
2013-10-16  9:55     ` Markus Armbruster
2013-10-15 13:21 ` [Qemu-devel] Which functions of southbridges should be no-user? (was: [PATCH RFC 0/9] Clean up and fix no_user) Markus Armbruster
2013-10-15 13:31   ` [Qemu-devel] Which functions of southbridges should be no-user? Andreas Färber
2013-10-15 14:41     ` Kevin Wolf
2013-10-15 14:53       ` Andreas Färber
2013-10-16  9:58         ` Markus Armbruster
2013-10-15 15:09       ` Anthony Liguori
2013-10-16 10:00         ` Markus Armbruster
2013-10-16 11:02           ` Andreas Färber
2013-10-17  9:47             ` Markus Armbruster
2013-10-16 17:53           ` Anthony Liguori
2013-10-17  9:49             ` Markus Armbruster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).