Hi, > Okay, let's use your example here with a standard UART. In the > following sequence, I should receive: > > 1) Starts guest > 2) When guest initializes the UART, qemu_chr_fe_open() > 3) Reboot guest > 4) Receive qemu_chr_fe_close() > 5) Boot new guest without a UART driver > 6) Nothing is received
Well, with virtio-serial the logic is slightly different. qemu_chr_fe_open() is called when a process opens /dev/virtio-ports/$name, not when the virtio-serial driver loads. I'm not sure whenever the qemu uart emulation can reliable do the same. Guest loading the uart driver can probably detected without too much trouble. But detecting a process opening /dev/ttySx might not be possible. Depends on the guest driver implementation. For virtio-serial it is trivial, there is a control message for that ;) > And for me, the most logical thing is to call qemu_chr_fe_open() in > post_load for the device. Ok, just lets do that then. cheers, Gerd