summaryrefslogtreecommitdiffstats
path: root/linux-headers
diff options
context:
space:
mode:
authorMao Zhongyi2017-08-14 05:33:09 +0200
committerJason Wang2017-09-08 02:17:37 +0200
commit0c8f86ea98945678622c6e4b070c4218a53a0d19 (patch)
tree4c4ebca03ea7900347d42aab7447b455ac888ccc /linux-headers
parentnet/rocker: Plug memory leak in pci_rocker_init() (diff)
downloadqemu-0c8f86ea98945678622c6e4b070c4218a53a0d19.tar.gz
qemu-0c8f86ea98945678622c6e4b070c4218a53a0d19.tar.xz
qemu-0c8f86ea98945678622c6e4b070c4218a53a0d19.zip
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 'linux-headers')
0 files changed, 0 insertions, 0 deletions