aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-08-28 10:02:46 +0100
committerPeter Maydell <peter.maydell@linaro.org>2020-08-28 10:02:46 +0100
commit739fa3255492f1c7541db1c7a9795fcf4b472c91 (patch)
tree66fd7f9d85ea237f11df037bd0b0344365c63ce2 /hw
parentf129360ca15723e43a8c44d1a2f025c0df1270cc (diff)
downloadqemu-739fa3255492f1c7541db1c7a9795fcf4b472c91.zip
qemu-739fa3255492f1c7541db1c7a9795fcf4b472c91.tar.gz
qemu-739fa3255492f1c7541db1c7a9795fcf4b472c91.tar.bz2
hw/qdev-clock: Avoid calling qdev_connect_clock_in after DeviceRealize
Clock canonical name is set in device_set_realized (see the block added to hw/core/qdev.c in commit 0e6934f264). If we connect a clock after the device is realized, this code is not executed. This is currently not a problem as this name is only used for trace events, however this disrupt tracing. Add a comment to document qdev_connect_clock_in() must be called before the device is realized, and assert this condition. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-id: 20200803105647.22223-5-f4bug@amsat.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/core/qdev-clock.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/core/qdev-clock.c b/hw/core/qdev-clock.c
index f139b68..47ecb5b 100644
--- a/hw/core/qdev-clock.c
+++ b/hw/core/qdev-clock.c
@@ -186,5 +186,6 @@ Clock *qdev_alias_clock(DeviceState *dev, const char *name,
void qdev_connect_clock_in(DeviceState *dev, const char *name, Clock *source)
{
+ assert(!dev->realized);
clock_set_source(qdev_get_clock_in(dev, name), source);
}