File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -968,7 +968,18 @@ extension UTMAppleVirtualMachine {
968968 }
969969
970970 @MainActor func updateConfigFromRegistry( ) {
971- config. sharedDirectories = registryEntry. sharedDirectories. map ( { UTMAppleConfigurationSharedDirectory ( directoryURL: $0. url, isReadOnly: $0. isReadOnly ) } )
971+ // Only update shared directories if they actually changed to avoid unnecessary virtiofs reconnections
972+ let newShares = registryEntry. sharedDirectories. map ( { UTMAppleConfigurationSharedDirectory ( directoryURL: $0. url, isReadOnly: $0. isReadOnly ) } )
973+
974+ let sharesChanged = newShares. count != config. sharedDirectories. count ||
975+ zip ( newShares, config. sharedDirectories) . contains { new, old in
976+ new. directoryURL != old. directoryURL || new. isReadOnly != old. isReadOnly
977+ }
978+
979+ if sharesChanged {
980+ config. sharedDirectories = newShares
981+ }
982+
972983 for i in config. drives. indices {
973984 let id = config. drives [ i] . id
974985 if config. drives [ i] . isExternal {
You can’t perform that action at this time.
0 commit comments