mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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>
This commit is contained in:
parent
f129360ca1
commit
739fa32554
2 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue