Skip to content

Commit

Permalink
scripting: drop file urls from qemu arguments
Browse files Browse the repository at this point in the history
If file urls were be supported, handle file permissions before use (app sandbox)
  • Loading branch information
naveenrajm7 committed Nov 21, 2024
1 parent 7c8f656 commit f101cce
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
3 changes: 0 additions & 3 deletions Scripting/UTM.sdef
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,6 @@
<record-type name="qemu argument" code="QeAr" description="QEMU argument configuration.">
<property name="argument string" code="ArSt" type="text"
description="The QEMU argument as a string."/>

<property name="file urls" code="FlUr" type="file" list="yes"
description="Optional URLs associated with this argument."/>
</record-type>

<record-type name="apple configuration" code="ApCf" description="Apple virtual machine configuration.">
Expand Down
12 changes: 1 addition & 11 deletions Scripting/UTMScriptingConfigImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,6 @@ extension UTMScriptingConfigImpl {
"argumentString": argument.string
]

// Only add fileUrls if it is not nil and contains URLs
if let fileUrls = argument.fileUrls, !fileUrls.isEmpty {
serializedArgument["fileUrls"] = fileUrls.map({ $0 as AnyHashable })
}

return serializedArgument
}

Expand Down Expand Up @@ -522,12 +517,7 @@ extension UTMScriptingConfigImpl {
let additionalArguments = records.compactMap { record -> QEMUArgument? in
guard let argumentString = record["argumentString"] as? String else { return nil }
var argument = QEMUArgument(argumentString)
// Qemu Additional Arguments in UI, only takes strings
// So, fileUrls of arguments will never be used
// This is here if they support in future
if let fileUrls = record["fileUrls"] as? [URL] {
argument.fileUrls = fileUrls
}

return argument
}
// Update entire additional arguments with new one.
Expand Down

0 comments on commit f101cce

Please sign in to comment.