]> git.proxmox.com Git - mirror_qemu.git/commit - qdev-monitor.c
qdev-monitor: Stop error avalanche in qbus_find_recursive()
authorMarkus Armbruster <armbru@redhat.com>
Wed, 11 Mar 2015 16:26:31 +0000 (17:26 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 22 Jun 2015 16:20:39 +0000 (18:20 +0200)
commita5ec494e274ddcad6d487e3872e16964ef57e0de
tree0dc1b33e0bae10ffbdc0b870166f1e691317b517
parentd49190c4208f2c556c3a01962a81f8a85d522bb1
qdev-monitor: Stop error avalanche in qbus_find_recursive()

Reproducer:

    $ qemu-system-x86_64 -nodefaults -device virtio-rng-pci -device virtio-rng-pci -device virtio-rng-device,bus=virtio-bus
    qemu-system-x86_64: -device virtio-rng-device,bus=virtio-bus: Bus 'virtio-bus' is full
    qemu-system-x86_64: -device virtio-rng-device,bus=virtio-bus: Bus 'virtio-bus' is full
    qemu-system-x86_64: -device virtio-rng-device,bus=virtio-bus: Bus 'virtio-bus' not found

qbus_find_recursive() reports the "is full" error itself, and leaves
reporting "not found" to its caller.  The result is confusion.  Write
it a function contract that permits leaving all error reporting to the
caller, and implement it.  Update callers to detect and report "is
full".

Screwed up when commit 1395af6 added the max_dev limit and the "is
full" error condition to enforce it.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
qdev-monitor.c