diff options
author | Mao Zhongyi <maozy.fnst@cn.fujitsu.com> | 2017-08-14 11:33:09 +0800 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2017-09-08 08:17:37 +0800 |
commit | 0c8f86ea98945678622c6e4b070c4218a53a0d19 (patch) | |
tree | 4c4ebca03ea7900347d42aab7447b455ac888ccc /hw/usb | |
parent | 1343a107e46feed8b901bf08ad8485bd5f302912 (diff) | |
download | qemu-0c8f86ea98945678622c6e4b070c4218a53a0d19.zip qemu-0c8f86ea98945678622c6e4b070c4218a53a0d19.tar.gz qemu-0c8f86ea98945678622c6e4b070c4218a53a0d19.tar.bz2 |
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>
Diffstat (limited to 'hw/usb')
0 files changed, 0 insertions, 0 deletions