Skip to content

Commit

Permalink
config(qemu): indicate no agent support on isapc and others
Browse files Browse the repository at this point in the history
Fixes #5280
  • Loading branch information
osy committed May 6, 2023
1 parent 036f587 commit f073b88
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions Configuration/QEMUConstant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,14 @@ enum QEMUPackageFileName: String {
extension QEMUArchitecture {
var hasAgentSupport: Bool {
switch self {
case .avr: return false
case .cris: return false
case .m68k: return false
case .microblaze, .microblazeel: return false
case .nios2: return false
case .rx: return false
case .sparc, .sparc64: return false
case .tricore: return false
default: return true
}
}
Expand Down Expand Up @@ -446,4 +453,11 @@ extension QEMUTarget {
default: return true
}
}

var hasAgentSupport: Bool {
switch self.rawValue {
case "isapc": return false
default: return true
}
}
}
4 changes: 2 additions & 2 deletions Configuration/UTMQemuConfiguration+Arguments.swift
Original file line number Diff line number Diff line change
Expand Up @@ -794,14 +794,14 @@ import Foundation
}

private var isSpiceAgentUsed: Bool {
guard system.architecture.hasAgentSupport else {
guard system.architecture.hasAgentSupport && system.target.hasAgentSupport else {
return false
}
return sharing.hasClipboardSharing || sharing.directoryShareMode == .webdav || displays.contains(where: { $0.isDynamicResolution })
}

@QEMUArgumentBuilder private var sharingArguments: [QEMUArgument] {
if system.architecture.hasAgentSupport {
if system.architecture.hasAgentSupport && system.target.hasAgentSupport {
f("-device")
f("virtio-serial")
f("-device")
Expand Down

0 comments on commit f073b88

Please sign in to comment.