qemu-patch-raspberry4/hw/net/rocker
Mao Zhongyi 0c8f86ea98 net/rocker: Convert to realize()
The rocker device still implements the old PCIDeviceClass .init()
instead of the new .realize(). All devices need to be converted to
.realize().

.init() reports errors with fprintf() and return 0 on success, negative
number on failure. Meanwhile, when -device rocker fails, it first report
a specific error, then a generic one, like this:

    $ x86_64-softmmu/qemu-system-x86_64 -device rocker,name=qemu-rocker
    rocker: name too long; please shorten to at most 9 chars
    qemu-system-x86_64: -device rocker,name=qemu-rocker: Device initialization failed

Now, convert it to .realize() that passes errors to its callers via its
errp argument. Also avoid the superfluous second error message. After
the patch, effect like this:

    $ x86_64-softmmu/qemu-system-x86_64 -device rocker,name=qemu-rocker
    qemu-system-x86_64: -device rocker,name=qemu-rocker: name too long; please shorten to at most 9 chars

Cc: jasowang@redhat.com
Cc: jiri@resnulli.us
Cc: armbru@redhat.com
Cc: f4bug@amsat.org
Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2017-09-08 08:17:37 +08:00
..
qmp-norocker.c hw/net: Clean up includes 2016-01-29 15:07:23 +00:00
rocker.c net/rocker: Convert to realize() 2017-09-08 08:17:37 +08:00
rocker.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
rocker_desc.c net/rocker: Remove the dead error handling 2017-09-08 08:17:37 +08:00
rocker_desc.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
rocker_fp.c net/rocker: Remove the dead error handling 2017-09-08 08:17:37 +08:00
rocker_fp.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
rocker_hw.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
rocker_of_dpa.c net/rocker: Remove the dead error handling 2017-09-08 08:17:37 +08:00
rocker_of_dpa.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
rocker_tlv.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
rocker_world.c net/rocker: Remove the dead error handling 2017-09-08 08:17:37 +08:00
rocker_world.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00