public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH container] fix: avoid invalid config creation on hotplug failure
Date: Tue, 19 Nov 2024 12:53:38 +0100	[thread overview]
Message-ID: <s8ozflv30bo.fsf@proxmox.com> (raw)
In-Reply-To: <20241119112913.211216-1-g.goller@proxmox.com>


Gabriel Goller <g.goller@proxmox.com> writes:

> @@ -1066,7 +1061,12 @@ sub update_net {
>  		if ($have_sdn && $bridge_changed) {
>  		    PVE::Network::SDN::Vnets::add_next_free_cidr($newnet->{bridge}, $conf->{hostname}, $newnet->{hwaddr}, $vmid, undef, 1);
>  		}
> -		PVE::LXC::net_tap_plug($veth, $newnet);
> +		eval { PVE::LXC::net_tap_plug($veth, $newnet) };
> +		if ($@) {
> +		    my $err = $@;

		if (my $err = $@) {

Small nit, is a bit nicer.

> +		    PVE::LXC::net_tap_plug($veth, $oldnet);
> +		    die "$err\n";
> +		}
>
>  		# This includes the rate:
>  		foreach (qw(bridge tag firewall rate link_down)) {



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  reply	other threads:[~2024-11-19 11:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-19 11:29 Gabriel Goller
2024-11-19 11:53 ` Maximiliano Sandoval [this message]
2024-11-19 13:07 ` [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=s8ozflv30bo.fsf@proxmox.com \
    --to=m.sandoval@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