Remove main loop.
This commit removes the external main loop, which never worked
and caused a number of bugs. Requests are now done synchronously,
and if the user wants to have requests issued in the background
or to have a responsive GUI, then they'll just have to use threads.
The big change is to push all reads and writes through two
functions called send_to_daemon (for writes) and recv_from_daemon
(for reads) which operate synchronously. These functions
read/write whole messages, and also handle checking for EOF
(ie. daemon died) and asynchronous log message events from
qemu (eg. from debug / dmesg printed by the guest). A more
complete description of how these work can be found in the code.
This code passes a complete run of the tests.
Bugs believed to be fixed by this commit:
https://bugzilla.redhat.com/show_bug.cgi?id=501888
internal error: reply callback called twice
https://bugzilla.redhat.com/show_bug.cgi?id=504418
In virt-inspector: "download: guestfs_download reply failed, see earlier error messages"
I have tried to avoid reintroducing this:
https://bugzilla.redhat.com/show_bug.cgi?id=508713
libguestfs: error: write: Broken pipe (guestfish only)
One other benefit of this is that 'set_busy/end_busy' calls
no longer appear in traces.