Hi,

I am trying to understand the code of QEMU and one of the things which
is unclear to me is what are the purposes of the loops:
main_loop_wait() and os_host_main_loop_wait(). They both look similar
since they prepare fds, poll them and dispatch them but I assume they
process different fds (otherwise, why there would be two different
loops?).

>From the name, I tend to think that main_loop_wait() polls fds which
represent emulated devices consumed by the guest OS, whereas
os_host_main_loop() polls fds from the host OS which are consumed by
QEMU. Assuming my interpretation is correct, if the guestOS writes a
block on /dev/vda, the write call will be processed by
main_loop_wait() (it will send the block to the specific disk device
in the host) and the ack from the disk will be first processed by
os_host_main_loop_wait() (it will send the ack to the Guest OS).

Is my interpretation correct?

Thanks in advance!

Reply via email to