]> git.proxmox.com Git - qemu-server.git/commitdiff
api: restore: start and live-restore do not conflict
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 6 Apr 2021 08:12:47 +0000 (10:12 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 6 Apr 2021 08:12:49 +0000 (10:12 +0200)
if live-restore is set then the VM is actually started before, so we
can just skip it..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/API2/Qemu.pm

index c7b5ca753854e0916450de2580812b149ad62922..4755917c89b78b9854b774d4719f7f6f7237e53a 100644 (file)
@@ -575,9 +575,6 @@ __PACKAGE__->register_method({
        my $unique = extract_param($param, 'unique');
        my $live_restore = extract_param($param, 'live-restore');
 
-       raise_param_exc({ 'start' => "cannot specify 'start' with 'live-restore'" })
-           if $start_after_create && $live_restore;
-
        if (defined(my $ssh_keys = $param->{sshkeys})) {
                $ssh_keys = URI::Escape::uri_unescape($ssh_keys);
                PVE::Tools::validate_ssh_public_keys($ssh_keys);
@@ -686,7 +683,7 @@ __PACKAGE__->register_method({
 
            PVE::QemuConfig->lock_config_full($vmid, 1, $realcmd);
 
-           if ($start_after_create) {
+           if ($start_after_create && !$live_restore) {
                print "Execute autostart\n";
                eval { PVE::API2::Qemu->vm_start({ vmid => $vmid, node => $node }) };
                warn $@ if $@;