From: Dietmar Maurer Date: Wed, 29 May 2013 09:18:54 +0000 (+0200) Subject: allow to clone VM when name is not set X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=c55fee03a0b532fe0e087cd21ccb0f1cdfa151d1;hp=152fe752c4d68deabea415b90dfc3e054dc6b0e1;p=qemu-server.git allow to clone VM when name is not set --- diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index e546002..99391aa 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -2000,7 +2000,11 @@ __PACKAGE__->register_method({ if ($param->{name}) { $newconf->{name} = $param->{name}; } else { - $newconf->{name} = "Copy-of-$oldconf->{name}"; + if ($oldconf->{name}) { + $newconf->{name} = "Copy-of-$oldconf->{name}"; + } else { + $newconf->{name} = "Copy-of-VM-$vmid"; + } } if ($param->{description}) {