On June 12, 2025 4:02 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. > > Signed-off-by: Fiona Ebner <f.eb...@proxmox.com> > --- > PVE/QemuServer.pm | 61 +++++++++++++++++++++++--------- > test/run_config2command_tests.pl | 10 ++++++ > 2 files changed, 55 insertions(+), 16 deletions(-) > > diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm > index 934adf60..82304096 100644 > --- a/PVE/QemuServer.pm > +++ b/PVE/QemuServer.pm
[..] > @@ -6030,6 +6038,27 @@ sub get_vm_volumes { > return $vollist; > } > > +# Get volumes defined in the current VM configuration, including the VM > state file. > +sub get_current_vm_volumes { > + my ($storecfg, $conf) = @_; > + > + my $volumes = []; > + > + PVE::QemuConfig->foreach_volume($conf, sub { > + my ($ds, $drive) = @_; > + > + if (PVE::Storage::parse_volume_id($drive->{file}, 1)) { > + check_volume_storage_type($storecfg, $drive->{file}); > + push $volumes->@*, $drive->{file}; > + } > + }); > + if (my $vmstate = $conf->{vmstate}) { > + push $volumes->@*, $vmstate; could be handled with `extra_keys => ['vmstate']` and switching to `foreach_volume_full`, like we do in `foreach_volid`? > + } > + > + return $volumes; > +} > + _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel