[pve-devel] [PATCH qemu-server 3/3] live-restore: ignore missing efidisk

Stefan Reiter s.reiter at proxmox.com
Thu Jul 8 13:25:35 CEST 2021


Don't attempt to restore a configured efidisk for SeaBIOS VMs when it is
missing. This can happen, as configured efidisks do not get backed up if
the BIOS setting is not OVMF.

Note that in case of OVMF VMs a missing efidisk is still treated as an
error, as that indicates a broken backup in general.

Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
---
 PVE/QemuServer.pm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 4082e69..a86a2a4 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6471,6 +6471,13 @@ sub restore_proxmox_backup_archive {
 	my $conf = PVE::QemuConfig->load_config($vmid);
 	die "cannot do live-restore for template\n" if PVE::QemuConfig->is_template($conf);
 
+	if ((!$conf->{bios} || $conf->{bios} ne 'ovmf') && !exists($devinfo->{'drive-efidisk0'})) {
+	    # VMs with SeaBIOS don't include efidisks in the backup, so ignore
+	    # it here for starting
+	    delete $conf->{efidisk0};
+	    $rpcenv->warn("efidisk0 in config, but not backed up - ignoring for live-restore");
+	}
+
 	delete $devinfo->{'drive-efidisk0'}; # this special drive is already restored before start
 	pbs_live_restore($vmid, $conf, $storecfg, $devinfo, $repo, $keyfile, $pbs_backup_name);
 
-- 
2.30.2






More information about the pve-devel mailing list