hw/isa/superio: Make the components QOM children
commite508430619b3b26112117b6e06ebc5f8f1d54aed
authorMarkus Armbruster <armbru@redhat.com>
Tue, 5 May 2020 15:29:18 +0000 (5 17:29 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Fri, 15 May 2020 05:07:58 +0000 (15 07:07 +0200)
treeca0262ab1813ffcaee8141dadeb857c0b428a579
parente274408cdc07b431ef6dfdbb5011c5ef434702e8
hw/isa/superio: Make the components QOM children

isa_superio_realize() attempts to make isa-parallel and isa-serial QOM
children, but this does not work, because it calls
object_property_add_child() after realizing with qdev_init_nofail().
Realizing a device without a parent gives it one: it gets put into the
"/machine/unattached/" orphanage.  The extra
object_property_add_child() fails, and isa_superio_realize() ignores
the error.

Move the object_property_add_child() before qdev_init_nofail(), and
pass &error_abort.

For the other components, isa_superio_realize() doesn't even try.  Add
object_property_add_child() there.

This affects machines 40p, clipper and fulong2e.

For instance, fulong2e has its vt82c686b-superio (which is an
isa-superio) at /machine/unattached/device[9].  Before the patch, its
components are at /machine/unattached/device[10] .. [14].  Afterwards,
they are at
/machine/unattached/device[9]/{parallel0,serial0,serial1,isa-fdc,i8042}.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200505152926.18877-11-armbru@redhat.com>
hw/isa/isa-superio.c