public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server 2/6] Partially-revert "cloudinit: add cloudinit section for current generated config"
Date: Wed, 16 Nov 2022 18:14:04 +0100	[thread overview]
Message-ID: <20221116171408.216775-3-w.bumiller@proxmox.com> (raw)
In-Reply-To: <20221116171408.216775-1-w.bumiller@proxmox.com>

This partially reverts commit 95a5135dad974c7eae249cf92b62b06fe911af33.
Particularly the unprotected write to the config when
generating the cloudinit file. We leave the rest as is for
now and update the callers to deal with the config later.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
---
 PVE/QemuServer/Cloudinit.pm | 31 -------------------------------
 1 file changed, 31 deletions(-)

diff --git a/PVE/QemuServer/Cloudinit.pm b/PVE/QemuServer/Cloudinit.pm
index b616c7b..f9bcbbc 100644
--- a/PVE/QemuServer/Cloudinit.pm
+++ b/PVE/QemuServer/Cloudinit.pm
@@ -576,37 +576,6 @@ sub generate_cloudinitconfig {
 
 	$generator->($conf, $vmid, $drive, $volname, $storeid);
     });
-
-    my $cloudinitconf = delete $conf->{cloudinit};
-    $cloudinitconf = {};
-
-    my @cloudinit_opts = keys %{PVE::QemuServer::cloudinit_config_properties()};
-    push @cloudinit_opts, 'name';
-
-    for my $opt (@cloudinit_opts) {
-
-	if ($opt =~ m/^ipconfig(\d+)/) {
-	    my $netid = "net$1";
-	    next if !defined($conf->{$netid});
-	    $conf->{cloudinit}->{$netid} = $conf->{$netid};
-	}
-
-	$conf->{cloudinit}->{$opt} = $conf->{$opt} if $conf->{$opt};
-    }
-
-    $conf->{cloudinit}->{name} = "VM$vmid" if !$conf->{cloudinit}->{name};
-
-    for my $opt (keys %{$conf}) {
-	if (PVE::QemuServer::is_valid_drivename($opt)) {
-	    my $drive = PVE::QemuServer::parse_drive($opt, $conf->{$opt});
-	    if (PVE::QemuServer::drive_is_cloudinit($drive)) {
-		$conf->{cloudinit}->{$opt} = $conf->{$opt};
-	    }
-	}
-    }
-
-    PVE::QemuConfig->write_config($vmid, $conf);
-
 }
 
 sub dump_cloudinit_config {
-- 
2.30.2





  parent reply	other threads:[~2022-11-16 17:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16 17:14 [pve-devel] [PATCH qemu-server 0/6] Manage [special:cloudinit] in hotplug code Wolfgang Bumiller
2022-11-16 17:14 ` [pve-devel] [PATCH qemu-server 1/6] Revert "cloudinit: avoid unsafe write of VM config" Wolfgang Bumiller
2022-11-16 17:14 ` Wolfgang Bumiller [this message]
2022-11-16 17:14 ` [pve-devel] [PATCH qemu-server 3/6] delay cloudinit generation in hotplug Wolfgang Bumiller
2022-11-16 17:14 ` [pve-devel] [PATCH qemu-server 4/6] record cloud-init changes in the cloudinit section Wolfgang Bumiller
2022-11-16 17:14 ` [pve-devel] [PATCH qemu-server 5/6] don't call 'cleanup_config' " Wolfgang Bumiller
2022-11-16 17:14 ` [pve-devel] [PATCH qemu-server 6/6] drop get_pending_changes and simplify cloudinit_pending api call Wolfgang Bumiller
2022-11-16 17:41 ` [pve-devel] applied-series: [PATCH qemu-server 0/6] Manage [special:cloudinit] in hotplug code 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=20221116171408.216775-3-w.bumiller@proxmox.com \
    --to=w.bumiller@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal