From 0742ac509183b6be3fcaf4095af219eef1254fb4 Mon Sep 17 00:00:00 2001 From: Pavel Boldyrev <627562+bpg@users.noreply.github.com> Date: Wed, 8 Sep 2021 18:27:36 -0400 Subject: [PATCH] Fix SIGSEGV if cloned VM is in a different storage. closes #1 --- proxmox/virtual_environment_vm.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/proxmox/virtual_environment_vm.go b/proxmox/virtual_environment_vm.go index d5bf7398..c8881ad6 100644 --- a/proxmox/virtual_environment_vm.go +++ b/proxmox/virtual_environment_vm.go @@ -161,12 +161,12 @@ func (c *VirtualEnvironmentClient) GetVMStatus(nodeName string, vmID int) (*Virt func (c *VirtualEnvironmentClient) MoveVMDisk(nodeName string, vmID int, d *VirtualEnvironmentVMMoveDiskRequestBody, timeout int) error { taskID, err := c.MoveVMDiskAsync(nodeName, vmID, d) - if strings.Contains(err.Error(), "you can't move to the same storage with same format") { - // if someone tries to move to the same storage, the move is considered to be successful - return nil - } - if err != nil { + if strings.Contains(err.Error(), "you can't move to the same storage with same format") { + // if someone tries to move to the same storage, the move is considered to be successful + return nil + } + return err }