From f073b887ba0d46189f1000fbde240d913b6b5f1d Mon Sep 17 00:00:00 2001 From: osy <50960678+osy@users.noreply.github.com> Date: Fri, 5 May 2023 18:40:02 -0700 Subject: [PATCH] config(qemu): indicate no agent support on isapc and others Fixes #5280 --- Configuration/QEMUConstant.swift | 14 ++++++++++++++ Configuration/UTMQemuConfiguration+Arguments.swift | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Configuration/QEMUConstant.swift b/Configuration/QEMUConstant.swift index e628091d1..1385d5929 100644 --- a/Configuration/QEMUConstant.swift +++ b/Configuration/QEMUConstant.swift @@ -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 } } @@ -446,4 +453,11 @@ extension QEMUTarget { default: return true } } + + var hasAgentSupport: Bool { + switch self.rawValue { + case "isapc": return false + default: return true + } + } } diff --git a/Configuration/UTMQemuConfiguration+Arguments.swift b/Configuration/UTMQemuConfiguration+Arguments.swift index c4fd6f4af..7612d8aaf 100644 --- a/Configuration/UTMQemuConfiguration+Arguments.swift +++ b/Configuration/UTMQemuConfiguration+Arguments.swift @@ -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")