all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Alexandre Derumier <aderumier@odiso.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server] cloudinit: remove pending delete on online regenerate image
Date: Sat,  6 Feb 2021 14:39:54 +0100	[thread overview]
Message-ID: <20210206133954.2406921-1-aderumier@odiso.com> (raw)

currently only pending changes are applied when we regenerate
image on a running vm, but not the pending delete.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 PVE/QemuServer.pm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 4d4efd9..f401baf 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -4462,6 +4462,13 @@ sub vmconfig_hotplug_pending {
 	    $conf->{$opt} = delete $conf->{pending}->{$opt};
 	}
 
+	my $pending_delete_hash = PVE::QemuConfig->parse_pending_delete($conf->{pending}->{delete});
+	foreach my $opt (sort keys %$pending_delete_hash) {
+	    next if !grep { $_ eq $opt } @cloudinit_opts;
+	    PVE::QemuConfig->remove_from_pending_delete($conf, $opt);
+	    delete $conf->{$opt};
+	}
+
 	my $new_conf = { %$conf };
 	$new_conf->{$key} = $value;
 	PVE::QemuServer::Cloudinit::generate_cloudinitconfig($new_conf, $vmid);
-- 
2.20.1




             reply	other threads:[~2021-02-06 13:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-06 13:39 Alexandre Derumier [this message]
2021-02-06 13:45 ` [pve-devel] applied: " 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=20210206133954.2406921-1-aderumier@odiso.com \
    --to=aderumier@odiso.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