[pve-devel] [PATCH qemu-server 05/10] tests: update QmMock to support vtypes
Wolfgang Bumiller
w.bumiller at proxmox.com
Tue Jul 29 13:15:47 CEST 2025
This currently breaks the tests.
The accompanying test case fixes happen automated via shell commands
in the next commit.
Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
src/test/MigrationTest/QmMock.pm | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/test/MigrationTest/QmMock.pm b/src/test/MigrationTest/QmMock.pm
index 78be47d3..e98b38d6 100644
--- a/src/test/MigrationTest/QmMock.pm
+++ b/src/test/MigrationTest/QmMock.pm
@@ -89,12 +89,14 @@ my $disk_counter = 10;
$MigrationTest::Shared::storage_module->mock(
vdisk_alloc => sub {
- my ($cfg, $storeid, $vmid, $fmt, $name, $size) = @_;
+ my ($cfg, $storeid, $vmid, $fmt, $name, $size, $vtype) = @_;
die "vdisk_alloc (mocked) - name is not expected to be set - implement me\n"
if defined($name);
- my $name_without_extension = "vm-${vmid}-disk-${disk_counter}";
+ my $prefix = ($vtype && $vtype eq 'vm-vol') ? 'vol-vm' : 'vm';
+
+ my $name_without_extension = "${prefix}-${vmid}-disk-${disk_counter}";
$disk_counter++;
my $volid;
--
2.47.2
More information about the pve-devel
mailing list