diff --git a/Configuration/UTMQemuConfiguration.swift b/Configuration/UTMQemuConfiguration.swift index a5ca6ff33..b561ca838 100644 --- a/Configuration/UTMQemuConfiguration.swift +++ b/Configuration/UTMQemuConfiguration.swift @@ -212,12 +212,14 @@ extension UTMQemuConfiguration { let fileManager = FileManager.default let imagesURL = packageURL.appendingPathComponent(QEMUPackageFileName.images.rawValue) let dataURL = packageURL.appendingPathComponent(Self.dataDirectoryName) - guard !fileManager.fileExists(atPath: dataURL.path) && fileManager.fileExists(atPath: imagesURL.path) else { - throw UTMQemuConfigurationError.migrationFailed + if fileManager.fileExists(atPath: imagesURL.path) { + guard !fileManager.fileExists(atPath: dataURL.path) else { + throw UTMQemuConfigurationError.migrationFailed + } + try await Task.detached { + try fileManager.moveItem(at: imagesURL, to: dataURL) + }.value } - try await Task.detached { - try fileManager.moveItem(at: imagesURL, to: dataURL) - }.value // update any drives for i in 0..