CocoaSpice: fix typing into the built-in serial terminal - #7900
Merged
Merged
Conversation
Keystrokes typed into a QEMU VM's built-in terminal never reached the guest. SPICE sends port writes by reference after CSPort returns, and since the CocoaSpice update in cebbab9 drains an autorelease pool on every SPICE loop iteration, the bytes were freed before they were sent. Pull in the CocoaSpice fix that keeps the data alive until the write completes. Fixes #7814 Assisted-by: Claude:claude-opus-5-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since UTM 5.0.4, keystrokes typed into a QEMU VM's built-in serial terminal never reach the guest. Output still works, and a TCP or pseudo-TTY serial port works.
SPICE sends port writes by reference:
spice_port_channel_write_async()adds the caller's buffer to the outgoing message and only reads it later, when the channel coroutine sends it.CSPortpassed the bytes of anNSDatathat was released right away. That worked only because the SPICE thread never drained an autorelease pool. The CocoaSpice change pulled in by cebbab9 (fixing a graphics memory leak) now drains a pool on every SPICE loop iteration, so the bytes are freed before they are sent.This pulls in utmapp/CocoaSpice@d8d29fc, which copies the data and keeps it alive until the write completes.
Resolves #7814
Testing: Tested by a human on macOS 27.0, MacBook Air (M3), iOS 26.7, iPhone 16 Pro, and visionOS 27.0, Apple Vision Pro Simulator. The author acknowledges that this change has been tested and/or reviewed by a human in accordance with UTM's AI contribution guidelines.