From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id F1E6A1FF0B0 for ; Tue, 27 Oct 2026 11:13:42 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 312AD21669; Tue, 27 Oct 2026 11:13:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=genua.de; s=202307; t=1793095949; bh=mTn6I8BvGrDMOAttZvFTqqtcXX8O6c6aXfUjwIvDBFA=; h=Date:From:To:Subject:References:In-Reply-To:From; b=ohyIw8ObtnSgtGUsFTg+qOTUafttRYozHnToWZynzcOUelALdaBEXof91YzePNOoG uK+2k/JY2So4XEyMwZxtwOpo7D0j7m5psTwQqLDhWS3ifX1+yw963ygG3z97RYKAzA R+RK9blb2+XThbKV6zlXR1S9q0prANRvFUoPzG7v3b+bGVKZfg6rQxe85Il4APwPs7 Xvm4wvUMMVBtsKghoWuFmW5YEIuMPvcGiMKN37wxNrZ2dDy9gO7UJb0PjjBwm1n7Fd SS5BswaxZx9uk2G8TlyUqnEv/7IKS9Dt66QWoF9ueNtsuy3O64uS6CyGdsYvs4T2eK CAFv6DmjyYrFA== Date: Tue, 27 Oct 2026 11:12:28 +0100 From: Christian Ludwig To: Subject: [PATCH qemu-server v3 13/19] test: custom firmware volumes in replication and migration Message-ID: <46dbdb47c9ab5ac2ba37f96c422f3cb2e9c18337.1793029144.git@genua.de> References: MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [192.168.217.185] X-ClientProxiedBy: kch1-mta09.win.genua.de (10.208.16.109) To kch1-mta07.win.genua.de (10.208.16.107) Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline X-SPAM-LEVEL: Spam detection results: 0 AWL 0.068 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy SPF_HELO_PASS -0.001 SPF: HELO matches SPF record SPF_PASS -0.001 SPF: sender matches SPF record UNPARSEABLE_RELAY 0.001 Informational: message has unparseable relay lines Message-ID-Hash: P7XTDJMIV5HMJWWYOSKPQ4MYRCVZCJIK X-Message-ID-Hash: P7XTDJMIV5HMJWWYOSKPQ4MYRCVZCJIK X-MailFrom: christian_ludwig@genua.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Test that custom firmware images are excluded from volume replication, and that migration is refused for images on a local storage but works for images on a shared storage. Signed-off-by: Christian Ludwig --- src/test/run_qemu_migrate_tests.pl | 61 +++++++++++++++++++++++ src/test/test_get_replicatable_volumes.pl | 10 ++++ 2 files changed, 71 insertions(+) diff --git a/src/test/run_qemu_migrate_tests.pl b/src/test/run_qemu_migrate_tests.pl index 05eed1d9..69f2cc1f 100755 --- a/src/test/run_qemu_migrate_tests.pl +++ b/src/test/run_qemu_migrate_tests.pl @@ -77,6 +77,7 @@ my $storage_config = { "local-dir" => { content => { images => 1, + 'efi-firmware' => 1, }, path => "/some/dir/", type => "dir", @@ -88,6 +89,15 @@ my $storage_config = { path => "/some/other/dir/", type => "dir", }, + "shared-dir" => { + content => { + images => 1, + 'efi-firmware' => 1, + }, + path => "/mnt/pve/shared-dir/", + type => "dir", + shared => 1, + }, "zfs-alias-1" => { content => { images => 1, @@ -1259,6 +1269,57 @@ my $tests = [ }, }, }, + { + name => '105_local_firmware', + target => 'pve1', + vmid => 105, + vm_status => { + running => 0, + }, + config_patch => { + bios => 'ovmf,firmware=local-dir:efi-firmware/custom.fd', + }, + expected_calls => {}, + expect_die => "local custom firmware image - use a shared storage", + expected => { + source_volids => local_volids_for_vm(105), + target_volids => {}, + vm_config => get_patched_config( + 105, + { + bios => 'ovmf,firmware=local-dir:efi-firmware/custom.fd', + }, + ), + vm_status => { + running => 0, + }, + }, + }, + { + name => '105_shared_firmware', + target => 'pve1', + vmid => 105, + vm_status => { + running => 0, + }, + config_patch => { + bios => 'ovmf,firmware=shared-dir:efi-firmware/custom.fd', + }, + expected_calls => $default_expected_calls_offline, + expected => { + source_volids => {}, + target_volids => local_volids_for_vm(105), + vm_config => get_patched_config( + 105, + { + bios => 'ovmf,firmware=shared-dir:efi-firmware/custom.fd', + }, + ), + vm_status => { + running => 0, + }, + }, + }, { name => '149_running_missing_option_withlocaldisks', target => 'pve1', diff --git a/src/test/test_get_replicatable_volumes.pl b/src/test/test_get_replicatable_volumes.pl index 6a3d0338..c693ee06 100755 --- a/src/test/test_get_replicatable_volumes.pl +++ b/src/test/test_get_replicatable_volumes.pl @@ -22,6 +22,7 @@ my $storecfg = { 'backup' => 1, 'images' => 1, 'rootdir' => 1, + 'efi-firmware' => 1, }, path => "/var/lib/vz", }, @@ -159,5 +160,14 @@ $conf = PVE::QemuServer::parse_vm_config("/qemu-server/$vmid.conf", $rawconf); eval { $volumes = PVE::QemuConfig->get_replicatable_volumes($storecfg, $vmid, $conf, 0, 0); }; is($@, "missing replicate feature on volume 'local:900/vm-900-disk-2.raw'\n", $test_name); +$test_name = "custom firmware is shared, not owned by VM"; +$rawconf = <<__EOD__; +bios: ovmf,firmware=local:efi-firmware/custom.fd +__EOD__ + +$conf = PVE::QemuServer::parse_vm_config("/qemu-server/$vmid.conf", $rawconf); +$volumes = PVE::QemuConfig->get_replicatable_volumes($storecfg, $vmid, $conf, 0, 0); +is_deeply($volumes, {}, $test_name); + done_testing(); exit(0); -- 2.34.1