Network handling and MacOS optimization
This commit is contained in:
@@ -472,4 +472,25 @@ public class VmManagementService
|
||||
{
|
||||
return await _processManager.GetPerformanceHistoryAsync(vmName, maxSamples);
|
||||
}
|
||||
|
||||
public async Task UpdateVmConfigurationAsync(string vmName, VmConfiguration updatedConfig)
|
||||
{
|
||||
if (!_vmConfigurations.ContainsKey(vmName))
|
||||
{
|
||||
throw new ArgumentException($"VM configuration '{vmName}' not found");
|
||||
}
|
||||
|
||||
// Ensure name consistency
|
||||
updatedConfig.Name = vmName;
|
||||
updatedConfig.LastModified = DateTime.UtcNow;
|
||||
|
||||
// Validate configuration
|
||||
ValidateConfiguration(updatedConfig);
|
||||
|
||||
// Save updated configuration
|
||||
await SaveVmConfigurationAsync(updatedConfig);
|
||||
|
||||
// Update in-memory cache
|
||||
_vmConfigurations[vmName] = updatedConfig;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user