We essentially open code eight difference bottom half implementations for all of the various qemu_system_*_request() functions. All these functions need is to defer a bit of work to the I/O thread since they are often called in the VCPU threads.
This can be trivially implemented in terms of a bottom half without touching the main loop. That's what this series does. I've used g_idle_add instead of a bottom half to avoid dealing with life cycle tracking of the bottom half. It looks like Xen has it's own main loop logic for the ioreq thread and relies on the global reset/shutdown values. It's weird to me that it doesn't require all of them. Nonetheless, I'm hoping Stefano can help figure out what to do here. It seems like Xen shouldn't need it's own loop... I've done "medium" testing on this series and everything seems to work. My regression tests pass and I've manually tested most of entry points but only on a Linux host.