The sclpconsole currently does not have a proper parent in the QOM
tree, so it shows up under /machine/unattached - which is somewhat
ugly. Let's attach it to /machine/sclp instead.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
include/hw/s390x/sclp.h | 2 +-
hw/s390x/s390-virtio-ccw.c | 11 +++++++----
hw/s390x/sclp.c | 4 +++-
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/include/hw/s390x/sclp.h b/include/hw/s390x/sclp.h
index b405a387b6..abfd6d8868 100644
--- a/include/hw/s390x/sclp.h
+++ b/include/hw/s390x/sclp.h
@@ -222,7 +222,7 @@ static inline int sccb_data_len(SCCB *sccb)
}
-void s390_sclp_init(void);
+Object *s390_sclp_init(void);
void sclp_service_interrupt(uint32_t sccb);
void raise_irq_cpu_hotplug(void);
int sclp_service_call(S390CPU *cpu, uint64_t sccb, uint32_t code);
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 4dcc213820..e2f9206ded 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -237,11 +237,13 @@ static void s390_create_virtio_net(BusState *bus,
const char *name)
}
}
-static void s390_create_sclpconsole(const char *type, Chardev *chardev)
+static void s390_create_sclpconsole(Object *sclp, const char *type,
+ Chardev *chardev)
{
DeviceState *dev;
dev = qdev_new(type);
+ object_property_add_child(sclp, type, OBJECT(dev));
qdev_prop_set_chr(dev, "chardev", chardev);
qdev_realize_and_unref(dev, sclp_get_event_facility_bus(),
&error_fatal);
}
@@ -252,8 +254,9 @@ static void ccw_init(MachineState *machine)
int ret;
VirtualCssBus *css_bus;
DeviceState *dev;
+ Object *sclp;
- s390_sclp_init();
+ sclp = s390_sclp_init();