Commit Graph
5 Commits
Author SHA1 Message Date
osy 3359543d2c ios: run qemu-img in a helper extension on iOS 26
QEMU tools cannot run in the app process on iOS: a process may load QEMU
only once and qemu-img calls exit(). So disk snapshots of a stopped VM,
reclaiming space, compression, resizing and conversion on import were
macOS-only.

iOS 26 brings ExtensionKit, so qemu-img now runs in an ExtensionKit
extension (iOSHelper, and iOSHelper-SE for UTM SE since an extension's
bundle identifier must be prefixed by its host's). The helper speaks the
same QEMUHelperProtocol as the macOS XPC helper but loads the tool into
its own process, one tool per process. UTMProcess accepts an injected
connection so the remote path is shared with macOS, including file
access through bookmarks, whose implicit security scope grants the
resolving process access. UTMHelperProcess launches the helper and,
because the system hands a process that is still exiting to a launch
that comes too soon, tears it down with a handshake on the interruption
callback and runs helpers one at a time.

UTMQemuImage now reads the tool's output until it ends instead of
racing the exit message, resumes its continuations off the XPC reply
queue (a call made from that queue blocks in NSXPC), and stops the
process explicitly since the connection's exported object kept it from
ever being deallocated on macOS. The last stderr line becomes the error
text when the tool gives none.

Assisted-by: Claude:claude-fable-5-1
2026-09-23 23:10:06 -05:00
osy ea4dccccdd process: log the QEMU launch arguments 2023-07-14 01:19:56 -07:00
osy 52506771a9 swtpm: add support for SWTPM 2023-07-12 23:18:36 -07:00
osy bd78994000 process: change current directory to socket destination
When we use AF_UNIX, the path has a maximum length of 104 characters. In the
past, we dependend on buggy behaviour that truncates the path length and both
QEMU and SPICE used the truncated path as the destination. This can result in
collisions between different VMs as well as other issues.

Now, we change the current working directory to where the AF_UNIX socket file
will reside and use relative addresses for both processes.
2023-07-12 23:18:36 -07:00
osy 7f80bf8fa6 services: rename UTMQemu to UTMProcess 2023-07-12 23:18:36 -07:00