mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-06-14 11:47:33 +00:00
move assertion so that we have all checks at the same place.
This commit is contained in:
parent
75e7e997e7
commit
35c5fdefce
@ -2398,6 +2398,9 @@ __PACKAGE__->register_method({
|
||||
die "you can't convert a template to a template\n"
|
||||
if PVE::QemuServer::is_template($conf) && !$disk;
|
||||
|
||||
die "you can't convert a VM to template if VM is running\n"
|
||||
if check_running($vmid);
|
||||
|
||||
my $realcmd = sub {
|
||||
PVE::QemuServer::template_create($vmid, $conf, $disk);
|
||||
};
|
||||
|
@ -4441,9 +4441,6 @@ sub has_feature {
|
||||
sub template_create {
|
||||
my ($vmid, $conf, $disk) = @_;
|
||||
|
||||
my $running = check_running($vmid);
|
||||
die "you can't convert a vm to template if vm is running vm\n" if $running;
|
||||
|
||||
my $storecfg = PVE::Storage::config();
|
||||
|
||||
foreach_drive($conf, sub {
|
||||
|
Loading…
Reference in New Issue
Block a user