Skip to content

[BUG] Update displays produces new id for displays #7145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
naveenrajm7 opened this issue Apr 21, 2025 · 0 comments
Open

[BUG] Update displays produces new id for displays #7145

naveenrajm7 opened this issue Apr 21, 2025 · 0 comments
Milestone

Comments

@naveenrajm7
Copy link
Contributor

Describe the issue
Updating/removing displays results in id of the display object being changed

Configuration

  • UTM Version: 4.5.6
  • macOS Version:
  • Mac Chip (Intel, M1, ...):

Debug

# Add first display
%osascript add_qemu_display.applescript F0B3F201-7C68-41F8-BDE6-9C63A6EC70E7 --hardware "virtio-gpu-pci"            
000D1CC3-61B4-4A0D-B60E-AE6151248467

# Get display , the id is same 
%osascript display_qemu_get.applescript alpine-3
downscaling filter:linear, upscaling filter:nearest, dynamic resolution:true, hardware:virtio-gpu-pci, id:000D1CC3-61B4-4A0D-B60E-AE6151248467, native resolution:false

# add second display
%osascript add_qemu_display.applescript F0B3F201-7C68-41F8-BDE6-9C63A6EC70E7 --hardware "virtio-ramfb"  
C3329FF7-B083-425C-B022-4E709650B270

# get display, first display id is different  
%osascript display_qemu_get.applescript alpine-3
native resolution:false, upscaling filter:nearest, downscaling filter:linear, hardware:virtio-gpu-pci, id:DF475EE4-9BA5-4D23-AFC7-67D6D2B48B27, dynamic resolution:true, id:C3329FF7-B083-425C-B022-4E709650B270, downscaling filter:linear, upscaling filter:nearest, hardware:virtio-ramfb, dynamic resolution:true, native resolution:false

# remove display
%osascript remove_qemu_display.applescript F0B3F201-7C68-41F8-BDE6-9C63A6EC70E7 C3329FF7-B083-425C-B022-4E709650B270

# get display, id changed again
%osascript display_qemu_get.applescript alpine-3
downscaling filter:linear, upscaling filter:nearest, native resolution:false, hardware:virtio-gpu-pci, id:87C7F14D-8FF0-4D5B-9194-10EA07C67429, dynamic resolution:true

I tried the solution below,
In updateQemuDisplays use updateIdentifiedElements instead of updateElements.
Do same in updateAppleDisplays.

I am not sure what is contributing to cause new id to be generated for every update, this make it harder to track the added display.
Any pointers appreciated.

Script used :

on run argv
  set vmName to item 1 of argv

  tell application "UTM"
      set vm to virtual machine named vmName
      set config to configuration of vm
      set currentDisplay to displays of config

      set newDisplay to ¬
          { ¬
              hardware: "virtio-gpu-pci", ¬
              dynamic resolution: false, ¬
              native resolution: true, ¬
              upscaling filter: "QsLi", ¬
              downscaling filter: "QsNe" ¬
          }
      
      set end of currentDisplay to newDisplay
      set displays of config to currentDisplay
      


      update configuration of vm with config
  end tell
end run
@osy osy added this to the Future milestone May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants