qemu-e2k/hw
Tony Krowiak 12b2e9f30f qdev/core: fix qbus_is_full()
The qbus_is_full(BusState *bus) function (qdev_monitor.c) compares the max_index
value of the BusState structure with the max_dev value of the BusClass structure
to determine whether the maximum number of children has been reached for the
bus. The problem is, the max_index field of the BusState structure does not
necessarily reflect the number of devices that have been plugged into
the bus.

Whenever a child device is plugged into the bus, the bus's max_index value is
assigned to the child device and then incremented. If the child is subsequently
unplugged, the value of the max_index does not change and no longer reflects the
number of children.

When the bus's max_index value reaches the maximum number of devices
allowed for the bus (i.e., the max_dev field in the BusClass structure),
attempts to plug another device will be rejected claiming that the bus is
full -- even if the bus is actually empty.

To resolve the problem, a new 'num_children' field is being added to the
BusState structure to keep track of the number of children plugged into the
bus. It will be incremented when a child is plugged, and decremented when a
child is unplugged.

Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
Reviewed-by: Pierre Morel<pmorel@linux.ibm.com>
Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Message-Id: <1545062250-7573-1-git-send-email-akrowiak@linux.ibm.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-03-06 11:51:08 -03:00
..
9pfs
acpi hw/acpi: remove unnecessary variable acpi_table_builtin 2019-03-06 10:23:19 +01:00
adc
alpha
arm hw/arm/stellaris: Implement watchdog timer 2019-03-05 15:55:09 +00:00
audio i2c: have I2C receive operation return uint8_t 2019-02-27 21:06:08 -06:00
block block/pflash_cfi02: Fix memory leak and potential use-after-free 2019-03-06 10:37:23 +01:00
bt
char hw/char/pl011: Use '0x' prefix when logging hex numbers 2019-02-21 18:17:46 +00:00
core qdev/core: fix qbus_is_full() 2019-03-06 11:51:08 -03:00
cpu
cris
display i2c: have I2C receive operation return uint8_t 2019-02-27 21:06:08 -06:00
dma
gpio i2c: have I2C receive operation return uint8_t 2019-02-27 21:06:08 -06:00
hppa hw/hppa/dino: mask out lower 2 bits of PCI config addr 2019-02-21 10:16:19 -08:00
hyperv
i2c i2c: Verify that the count passed in to smbus_eeprom_init() is valid 2019-02-27 21:06:08 -06:00
i386 hw/i386/pc.c: remove unused function pc_acpi_init() 2019-03-06 10:22:03 +01:00
ide hw/ide: drop iov field from IDEDMA 2019-02-22 09:42:13 +00:00
input i2c: have I2C receive operation return uint8_t 2019-02-27 21:06:08 -06:00
intc hw/ppc: Use object_initialize_child for correct reference counting 2019-02-26 09:21:25 +11:00
ipack
ipmi
isa i2c: Split smbus into parts 2019-02-27 21:06:08 -06:00
lm32
m68k hw/m68k/mcf5208: Support loading of bios images 2019-02-28 12:18:18 +01:00
mem pc-dimm: use same mechanism for [get|set]_addr 2019-02-21 12:28:41 -05:00
microblaze
mips i2c: Split smbus into parts 2019-02-27 21:06:08 -06:00
misc This has been out there long enough, I need to get this in. 2019-03-01 11:20:49 +00:00
moxie
net virtio-net: Allow qemu_announce_self to trigger virtio announcements 2019-03-05 11:27:41 +08:00
nios2
nvram i2c: have I2C receive operation return uint8_t 2019-02-27 21:06:08 -06:00
openrisc
pci pci: Sanity test minimum downstream LNKSTA 2019-02-22 10:51:31 -05:00
pci-bridge
pci-host hw/pci-host/bonito.c: Add PCI mem region mapped at the correct address 2019-02-21 19:36:47 +01:00
pcmcia
ppc hw/boards: Add a MachineState parameter to kvm_type callback 2019-03-05 15:55:09 +00:00
rdma
riscv
s390x s390x/vfio-ap: Implement hot plug/unplug of vfio-ap device 2019-03-04 11:49:31 +01:00
scsi
sd
sh4
smbios hw/smbios: fix offset of type 3 sku field 2019-02-22 10:51:31 -05:00
sparc
sparc64
ssi
timer i2c: have I2C receive operation return uint8_t 2019-02-27 21:06:08 -06:00
tpm tpm_tis: convert tpm_tis_show_buffer() to use trace event 2019-02-24 14:46:14 -05:00
tricore
unicore32
usb hw/usb: switch MTP to use new inotify APIs 2019-02-26 15:25:58 +00:00
vfio s390x updates: 2019-03-04 13:38:54 +00:00
virtio pci, pc, virtio: fixes, cleanups, tests 2019-03-04 11:04:31 +00:00
watchdog hw/arm/stellaris: Implement watchdog timer 2019-03-05 15:55:09 +00:00
xen
xenpv
xtensa
Makefile.objs hw/vfio/Makefile.objs: Create new CONFIG_* variables for VFIO core and PCI 2019-02-05 16:50:21 +01:00