On June 18, 2025 3:01 pm, Fiona Ebner wrote: > With '-blockdev', it is necessary to activate the volumes to generate > the command line, because it can be necessary to check whether the > volume is a block device or a regular file. > > Do not deactivate after commandline generation for 'qm showcmd', > because there can be concurrent operations acting on the volumes. > > Signed-off-by: Fiona Ebner <f.eb...@proxmox.com> > --- > > Changes in v2: > * Do not deactivate after showcmd, because it might not be safe. > > src/PVE/QemuServer.pm | 60 +++++++++++++++++++++------- > src/test/run_config2command_tests.pl | 10 +++++ > 2 files changed, 55 insertions(+), 15 deletions(-) > > diff --git a/src/test/run_config2command_tests.pl > b/src/test/run_config2command_tests.pl > index 590f80f5..cbd8cd8b 100755 > --- a/src/test/run_config2command_tests.pl > +++ b/src/test/run_config2command_tests.pl > @@ -256,6 +256,16 @@ $qemu_server_module->mock( > }, > ); > > +my $storage_module = Test::MockModule->new("PVE::Storage"); > +$storage_module->mock( > + activate_volumes => sub { > + return; > + }, > + deactivate_volumes => sub { > + return; > + }, > +); > +
potential for some follow ups here - we could actually track what the tests trigger here, and thus that - only actively referenced volumes are activated, and unused volumes for example are not - backing chains are properly activated (once those are a thing) - showcmd doesn't deactivate - ..? > my $zfsplugin_module = Test::MockModule->new("PVE::Storage::ZFSPlugin"); > $zfsplugin_module->mock( > zfs_get_lu_name => sub { > -- > 2.39.5 > > > > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > > > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel