Philippe Mathieu-Daudé <phi...@redhat.com> writes: > On 5/18/20 12:30 PM, Peter Maydell wrote: >> On Mon, 18 May 2020 at 06:04, Markus Armbruster <arm...@redhat.com> wrote: >>> >>> xlnx_dp_init() creates these two devices, but they're never realized. >>> Affects machine xlnx-zcu102. >>> >>> I wonder how this ever worked. If the "device becomes real only on >>> realize" thing actually works, then we've always been missing these >>> two devices, yet nobody noticed. >> >> It depends entirely on the implementation of the device. >> If it happens to do nothing in the realize method that >> matters
Also in the realize methods of supertypes. >> (eg i2c-ddc has no realize method and does the limited >> amount of initialization it needs in instance_init) then the >> device will (by lucky accident) work just fine. Yes. >> We should really ideally have an assert() in the DeviceClass >> reset that the device was realized, so we can keep this kind >> of bug out of the codebase. (Last time I looked it wasn't obvious >> exactly where to put the assert now that we have both legacy-reset >> and three-phase-reset, unfortunately.) > > Your wish came true in the last patch of this series! #24: > https://www.mail-archive.com/qemu-devel@nongnu.org/msg704239.html Not exactly what Peter asked for, but hopefully close enough for practical purposes.