all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Reiter <s.reiter@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server 3/3] live-restore: hold 'create' lock during operation
Date: Wed, 21 Apr 2021 16:25:25 +0200	[thread overview]
Message-ID: <20210421142525.2159-3-s.reiter@proxmox.com> (raw)
In-Reply-To: <20210421142525.2159-1-s.reiter@proxmox.com>

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
---
 PVE/QemuServer.pm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index d042a7e..8b9c40d 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6376,6 +6376,11 @@ sub restore_proxmox_backup_archive {
 	die $err;
     }
 
+    if ($options->{live}) {
+	# keep lock during live-restore
+	$new_conf_raw .= "\nlock: create";
+    }
+
     PVE::Tools::file_set_contents($conffile, $new_conf_raw);
 
     PVE::Cluster::cfs_update(); # make sure we read new file
@@ -6397,6 +6402,8 @@ sub restore_proxmox_backup_archive {
 	die "cannot do live-restore for template\n" if PVE::QemuConfig->is_template($conf);
 
 	pbs_live_restore($vmid, $conf, $storecfg, $devinfo, $repo, $keyfile, $pbs_backup_name);
+
+	PVE::QemuConfig->remove_lock($vmid, "create");
     }
 }
 
-- 
2.20.1





  parent reply	other threads:[~2021-04-21 14:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21 14:25 [pve-devel] [PATCH qemu-server 1/3] qmrestore: add live-restore option Stefan Reiter
2021-04-21 14:25 ` [pve-devel] [PATCH qemu-server 2/3] live-restore: don't remove VM on error Stefan Reiter
2021-04-21 14:25 ` Stefan Reiter [this message]
2021-04-21 15:56 ` [pve-devel] applied-series: [PATCH qemu-server 1/3] qmrestore: add live-restore option Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210421142525.2159-3-s.reiter@proxmox.com \
    --to=s.reiter@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal