From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <o.bektas@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 0C8C771434
 for <pve-devel@lists.proxmox.com>; Thu, 10 Jun 2021 14:04:36 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id F11D82EE60
 for <pve-devel@lists.proxmox.com>; Thu, 10 Jun 2021 14:04:35 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS id 810BE2EE54
 for <pve-devel@lists.proxmox.com>; Thu, 10 Jun 2021 14:04:35 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 45BC346754
 for <pve-devel@lists.proxmox.com>; Thu, 10 Jun 2021 14:04:35 +0200 (CEST)
Date: Thu, 10 Jun 2021 14:04:33 +0200
From: Oguz Bektas <o.bektas@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Message-ID: <20210610120433.GA13807@gaia.proxmox.com>
Mail-Followup-To: Oguz Bektas <o.bektas@proxmox.com>,
 Proxmox VE development discussion <pve-devel@lists.proxmox.com>
References: <20210527092601.148400-1-o.bektas@proxmox.com>
 <20210527092601.148400-2-o.bektas@proxmox.com>
 <1623325310.d7m8o7zpwa.astroid@nora.none>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1623325310.d7m8o7zpwa.astroid@nora.none>
User-Agent: Mutt/1.10.1 (2018-07-13)
X-SPAM-LEVEL: Spam detection results:  0
 AWL 2.021 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more
 information. [base.pm]
Subject: Re: [pve-devel] [PATCH v3 container 1/2] setup: clear
 /etc/machine-id for newly created containers
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Thu, 10 Jun 2021 12:04:36 -0000

hi,

> +sub clear_machine_id {
> > +    my ($self, $conf, $clone) = @_;
> > +
> > +    my $code = sub {
> > +	$self->{plugin}->clear_machine_id($self->{conf}, $clone);
> > +    };
> > +    $self->protected_call($code);
> > +
> > +}
> 
> maybe it would make more sense to call this "post_clone_hook", so it is 
> re-usable for other, similar changes (like optionally regenerating SSH 
> keys, or ...) in the future without polluting the entry-point namespace 
> too much?

yes i was also thinking why we don't have a post_clone_hook :D

i'll change that accordingly :)

> 
> > +
> >  sub post_create_hook {
> >      my ($self, $root_password, $ssh_keys) = @_;
> >  
> > diff --git a/src/PVE/LXC/Setup/Base.pm b/src/PVE/LXC/Setup/Base.pm
> > index d73335b..21074b7 100644
> > --- a/src/PVE/LXC/Setup/Base.pm
> > +++ b/src/PVE/LXC/Setup/Base.pm
> > @@ -476,6 +476,30 @@ sub set_timezone {
> >      }
> >  }