QEMU, QMP manager, and SPICE manager each needs to connect. To simplify things
we set a 30s timeout on each one with 1s per try. They will independently try
to connect and if any fail, then an error message will be shown.
This process should be improved for better failure handling.
Turns out you can only have one instance of a helper. Therefore we use NSTask
to launch multiple instances of QEMU. As a result, for macOS, we now embed the
QEMU binaries with the helper and launch them instead of using dylib. With this
change we also add a suffix to all the built dylibs in order to avoid collision
with macOS system libraries.
This allows multiple VMs to be run at the same time. It also isolates QEMU into
its own process which improves stability and security.
To support App Sandbox, URL bookmarks must be passed to the XPC process before
it can access the data.