sysbus: New sysbus_realize(), sysbus_realize_and_unref()
commit496a8525622d4ac5d276f76840dd30eddb73672d
authorMarkus Armbruster <armbru@redhat.com>
Wed, 10 Jun 2020 05:32:33 +0000 (10 07:32 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 15 Jun 2020 20:05:28 +0000 (15 22:05 +0200)
tree0b47f1fcd14bd2efc8ce34a115ee9062008b6c56
parentb45ad78889461fdf9aa98493a9b49612a8e79833
sysbus: New sysbus_realize(), sysbus_realize_and_unref()

Sysbus devices almost always plug into the main system bus.
qdev_create() even has a convenience feature to make that easy: a null
bus argument gets replaced by the main system bus.  qdev_realize() and
qdev_realize_and_unref() do the same.

We can do better.  Provide convenience wrappers around qdev_realize()
and qdev_realize_and_unref() that don't take a @bus argument.  They
always pass the main system bus.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-45-armbru@redhat.com>
hw/core/sysbus.c
include/hw/sysbus.h