From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 892D378A36 for ; Wed, 29 Jun 2022 14:02:08 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7ECF024B0C for ; Wed, 29 Jun 2022 14:02:08 +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) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Wed, 29 Jun 2022 14:02:07 +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 A8F2343D4C for ; Wed, 29 Jun 2022 14:02:07 +0200 (CEST) Date: Wed, 29 Jun 2022 14:02:06 +0200 From: Wolfgang Bumiller To: Dominik Csapak Cc: pve-devel@lists.proxmox.com Message-ID: <20220629120206.ct6zokyc75y52qy6@casey.proxmox.com> References: <20220622125735.4185653-1-d.csapak@proxmox.com> <20220622125735.4185653-3-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220622125735.4185653-3-d.csapak@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.300 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 T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] applied: [PATCH qemu-server 1/1] fix #4119: give namespace parameter to live-restore X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jun 2022 12:02:08 -0000 just ran into this again and noticed this patch was still missing applied On Wed, Jun 22, 2022 at 02:57:35PM +0200, Dominik Csapak wrote: > we forgot to give the namespace parameter here, so do that. > while we're at it, give the pbs options as a hash instead of adding > another parameter. > > Signed-off-by: Dominik Csapak > --- > PVE/QemuServer.pm | 22 ++++++++++++++++------ > 1 file changed, 16 insertions(+), 6 deletions(-) > > diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm > index b3964bc..09c0df4 100644 > --- a/PVE/QemuServer.pm > +++ b/PVE/QemuServer.pm > @@ -1717,6 +1717,7 @@ sub print_pbs_blockdev { > my ($pbs_conf, $pbs_name) = @_; > my $blockdev = "driver=pbs,node-name=$pbs_name,read-only=on"; > $blockdev .= ",repository=$pbs_conf->{repository}"; > + $blockdev .= ",namespace=$pbs_conf->{namespace}" if $pbs_conf->{namespace}; > $blockdev .= ",snapshot=$pbs_conf->{snapshot}"; > $blockdev .= ",archive=$pbs_conf->{archive}"; > $blockdev .= ",keyfile=$pbs_conf->{keyfile}" if $pbs_conf->{keyfile}; > @@ -6652,6 +6653,7 @@ sub restore_proxmox_backup_archive { > my $keyfile = PVE::Storage::PBSPlugin::pbs_encryption_key_file_name($storecfg, $storeid); > > my $repo = PVE::PBSClient::get_repository($scfg); > + my $namespace = $scfg->{namespace}; > > # This is only used for `pbs-restore` and the QEMU PBS driver (live-restore) > my $password = PVE::Storage::PBSPlugin::pbs_get_password($scfg, $storeid); > @@ -6842,28 +6844,36 @@ sub restore_proxmox_backup_archive { > # these special drives are already restored before start > delete $devinfo->{'drive-efidisk0'}; > delete $devinfo->{'drive-tpmstate0-backup'}; > - pbs_live_restore($vmid, $conf, $storecfg, $devinfo, $repo, $keyfile, $pbs_backup_name); > + > + my $pbs_opts = { > + repo => $repo, > + keyfile => $keyfile, > + snapshot => $pbs_backup_name, > + namespace => $namespace, > + }; > + pbs_live_restore($vmid, $conf, $storecfg, $devinfo, $pbs_opts); > > PVE::QemuConfig->remove_lock($vmid, "create"); > } > } > > sub pbs_live_restore { > - my ($vmid, $conf, $storecfg, $restored_disks, $repo, $keyfile, $snap) = @_; > + my ($vmid, $conf, $storecfg, $restored_disks, $opts) = @_; > > print "starting VM for live-restore\n"; > - print "repository: '$repo', snapshot: '$snap'\n"; > + print "repository: '$opts->{repo}', snapshot: '$opts->{snapshot}'\n"; > > my $pbs_backing = {}; > for my $ds (keys %$restored_disks) { > $ds =~ m/^drive-(.*)$/; > my $confname = $1; > $pbs_backing->{$confname} = { > - repository => $repo, > - snapshot => $snap, > + repository => $opts->{repo}, > + snapshot => $opts->{snapshot}, > archive => "$ds.img.fidx", > }; > - $pbs_backing->{$confname}->{keyfile} = $keyfile if -e $keyfile; > + $pbs_backing->{$confname}->{keyfile} = $opts->{keyfile} if -e $opts->{keyfile}; > + $pbs_backing->{$confname}->{namespace} = $opts->{namespace} if defined($opts->{namespace}); > > my $drive = parse_drive($confname, $conf->{$confname}); > print "restoring '$ds' to '$drive->{file}'\n"; > -- > 2.30.2