mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-10 12:30:27 +00:00
Add 'runningmachine' support to vm_commandline
to allow 'qm showcmd --snapshot ...' to show the correct machine type. Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
parent
e85d01f282
commit
092868c4d1
@ -5626,11 +5626,15 @@ sub vm_commandline {
|
||||
my ($storecfg, $vmid, $snapname) = @_;
|
||||
|
||||
my $conf = PVE::QemuConfig->load_config($vmid);
|
||||
my $forcemachine;
|
||||
|
||||
if ($snapname) {
|
||||
my $snapshot = $conf->{snapshots}->{$snapname};
|
||||
die "snapshot '$snapname' does not exist\n" if !defined($snapshot);
|
||||
|
||||
# check for a 'runningmachine' in snapshot
|
||||
$forcemachine = $snapshot->{runningmachine} if $snapshot->{runningmachine};
|
||||
|
||||
$snapshot->{digest} = $conf->{digest}; # keep file digest for API
|
||||
|
||||
$conf = $snapshot;
|
||||
@ -5638,7 +5642,7 @@ sub vm_commandline {
|
||||
|
||||
my $defaults = load_defaults();
|
||||
|
||||
my $cmd = config_to_command($storecfg, $vmid, $conf, $defaults);
|
||||
my $cmd = config_to_command($storecfg, $vmid, $conf, $defaults, $forcemachine);
|
||||
|
||||
return PVE::Tools::cmd2string($cmd);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user