diff --git a/.vscode/launch.json b/.vscode/launch.json index 03ed70a..daee80b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,7 +11,9 @@ "preLaunchTask": "build", // Se i framework di destinazione sono stati modificati, assicurarsi di aggiornare il percorso del programma. "program": "${workspaceFolder}/src/Corsinvest.ProxmoxVE.Pepper/bin/Debug/net8.0/cv4pve-pepper.dll", - "args": [], + "args": [ + "@Parm.parm" + ], "cwd": "${workspaceFolder}/src/Corsinvest.ProxmoxVE.Pepper", // Per ulteriori informazioni sul campo 'console', vedere https://aka.ms/VSCode-CS-LaunchJson-Console "console": "internalConsole", diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/Corsinvest.ProxmoxVE.Pepper/Corsinvest.ProxmoxVE.Pepper.csproj b/src/Corsinvest.ProxmoxVE.Pepper/Corsinvest.ProxmoxVE.Pepper.csproj index 84698d6..343ca71 100644 --- a/src/Corsinvest.ProxmoxVE.Pepper/Corsinvest.ProxmoxVE.Pepper.csproj +++ b/src/Corsinvest.ProxmoxVE.Pepper/Corsinvest.ProxmoxVE.Pepper.csproj @@ -1,7 +1,7 @@  Exe - 1.7.0 + 1.7.2 net8.0 cv4pve-pepper Corsinvest Srl @@ -15,7 +15,9 @@ - - + + \ No newline at end of file diff --git a/src/Corsinvest.ProxmoxVE.Pepper/Program.cs b/src/Corsinvest.ProxmoxVE.Pepper/Program.cs index 81d7e6f..d7a338f 100644 --- a/src/Corsinvest.ProxmoxVE.Pepper/Program.cs +++ b/src/Corsinvest.ProxmoxVE.Pepper/Program.cs @@ -5,6 +5,7 @@ using System; using System.CommandLine; +using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; @@ -65,7 +66,13 @@ app.SetHandler(async (ctx) => if (app.DebugIsActive()) { await Console.Out.WriteLineAsync($"VM is {vm.Status}."); } } - var (success, reasonPhrase, content) = await client.Nodes[vm.Node].Qemu[vm.VmId].Spiceproxy.GetSpiceFileVVAsync(proxy); + var (success, reasonPhrase, content) = vm.VmType switch + { + VmType.Qemu => await client.Nodes[vm.Node].Qemu[vm.VmId].Spiceproxy.GetSpiceFileVVAsync(proxy), + VmType.Lxc => await client.Nodes[vm.Node].Lxc[vm.VmId].Spiceproxy.GetSpiceFileVVAsync(proxy), + _ => throw new InvalidEnumArgumentException(), + }; + if (success) { //proxy force