qemu-e2k/hw/core
Markus Armbruster 1bc133365e qdev: Improve netdev property override error a bit
qdev_prop_set_netdev() fails when the property already has a non-null
value.  Seems to go back to commit 30c367ed44
"qdev-properties-system.c: Allow vlan or netdev for -device, not
both", v1.7.0.  Board code doesn't expect failure, and crashes:

    $ qemu-system-x86_64 --nodefaults -nic user -netdev user,id=nic0 -global e1000.netdev=nic0
    Unexpected error in error_set_from_qdev_prop_error() at /work/armbru/qemu/hw/core/qdev-properties.c:1101:
    qemu-system-x86_64: Property 'e1000.netdev' doesn't take value '__org.qemu.nic0
    '
    Aborted (core dumped)

-device and device_add handle the failure:

    $ qemu-system-x86_64 -nodefaults -netdev user,id=net0 -netdev user,id=net1 -device e1000,netdev=net0,netdev=net1
    qemu-system-x86_64: -device e1000,netdev=net0,netdev=net1: Property 'e1000.netdev' doesn't take value 'net1'
    $ qemu-system-x86_64 -nodefaults -S -display none -monitor stdio -netdev user,id=net0 -netdev user,id=net1 -global e1000.netdev=net0
    QEMU 5.0.50 monitor - type 'help' for more information
    (qemu) qemu-system-x86_64: warning: netdev net0 has no peer
    qemu-system-x86_64: warning: netdev net1 has no peer
    device_add e1000,netdev=net1
    Error: Property 'e1000.netdev' doesn't take value 'net1'

Perhaps netdev property override could be made to work.  Perhaps it
should.  I'm not the right guy to figure this out.  What I can do is
improve the error message a bit:

    (qemu) device_add e1000,netdev=net1
    Error: -global e1000.netdev=... conflicts with netdev=net1

Cc: Jason Wang <jasowang@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200622094227.1271650-11-armbru@redhat.com>
2020-06-23 16:07:07 +02:00
..
Kconfig hw/core: Add a config switch for the generic loader device 2019-08-20 09:11:17 +02:00
Makefile.objs hw/misc/empty_slot: Move the 'hw/misc' and cover in MAINTAINERS 2020-06-09 06:59:44 +02:00
bus.c qdev: Convert to qdev_unrealize() with Coccinelle 2020-06-15 21:36:30 +02:00
clock-vmstate.c hw/core/clock-vmstate: define a vmstate entry for clock state 2020-04-30 15:35:40 +01:00
clock.c hw/core/clock: introduce clock object 2020-04-30 11:52:28 +01:00
cpu.c Testing and plugin updates 2020-06-16 14:57:15 +01:00
fw-path-provider.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
generic-loader.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
hotplug.c call HotplugHandler->plug() as the last step in device realization 2018-10-19 13:44:12 +02:00
irq.c Revert "irq: introduce qemu_irq_proxy()" 2019-11-05 23:33:12 +01:00
loader-fit.c hw/core: Fix fit_load_fdt() error API violations 2019-12-18 08:36:15 +01:00
loader.c hw/core: properly terminate loading .hex on EOF record 2020-04-07 16:19:49 +01:00
machine-hmp-cmds.c qapi: Only input visitors can actually fail 2020-04-30 07:26:40 +02:00
machine-qmp-cmds.c qom: Drop convenience method object_property_get_uint16List() 2020-05-15 06:26:02 +02:00
machine.c * Miscellaneous fixes and feature enablement (many) 2020-06-12 23:06:22 +01:00
nmi.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
null-machine.c null-machine: use memdev for RAM 2020-02-19 16:49:57 +00:00
numa.c numa: prevent usage of -M memory-backend and -numa memdev at the same time 2020-06-10 12:09:34 -04:00
or-irq.c hw/core/or-irq: Fix incorrect assert forbidding num-lines == MAX_OR_LINES 2020-01-30 16:02:01 +00:00
platform-bus.c hw/core: Let devices own the MemoryRegion they create 2020-03-17 15:18:48 +01:00
ptimer.c ptimer: Remove old ptimer_init_with_bh() API 2019-11-11 13:44:16 +00:00
qdev-clock.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
qdev-fw.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
qdev-properties-system.c qdev: Improve netdev property override error a bit 2020-06-23 16:07:07 +02:00
qdev-properties.c qdev: Improve netdev property override error a bit 2020-06-23 16:07:07 +02:00
qdev.c qdev: qdev_init_nofail() is now unused, drop 2020-06-15 22:06:04 +02:00
register.c hw/core/register: Add register_init_block8 helper. 2020-05-05 13:37:51 -07:00
reset.c qemu/queue.h: leave head structs anonymous unless necessary 2019-01-11 15:46:55 +01:00
resettable.c hw/core: deprecate old reset functions and introduce new ones 2020-01-30 16:02:04 +00:00
split-irq.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
stream.c hw/core: stream: Add an end-of-packet flag 2020-05-14 13:44:35 +02:00
sysbus.c sysbus: sysbus_init_child_obj() is now unused, drop 2020-06-15 22:06:04 +02:00
trace-events hw/misc/empty_slot: Move the 'hw/misc' and cover in MAINTAINERS 2020-06-09 06:59:44 +02:00
uboot_image.h Support u-boot noload images for arm as used by, NetBSD/evbarm GENERIC kernel. 2019-01-07 15:46:20 +00:00
vm-change-state-handler.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
vmstate-if.c vmstate: add qom interface to get id 2020-01-06 18:41:32 +04:00