diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index bf6f6fd7..efac2c77 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -228,6 +228,11 @@ __PACKAGE__->register_method({ additionalProperties => 0, properties => { node => get_standard_option('pve-node'), + full => { + type => 'boolean', + optional => 1, + description => "Determine the full status of active VMs.", + }, }, }, returns => { @@ -244,7 +249,7 @@ __PACKAGE__->register_method({ my $rpcenv = PVE::RPCEnvironment::get(); my $authuser = $rpcenv->get_user(); - my $vmstatus = PVE::QemuServer::vmstatus(); + my $vmstatus = PVE::QemuServer::vmstatus(undef, $param->{full}); my $res = []; foreach my $vmid (keys %$vmstatus) { diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm index fdac3d57..0dd81590 100755 --- a/PVE/CLI/qm.pm +++ b/PVE/CLI/qm.pm @@ -119,7 +119,7 @@ __PACKAGE__->register_method ({ # test if VM exists my $conf = PVE::QemuServer::load_config ($param->{vmid}); - my $vmstatus = PVE::QemuServer::vmstatus($param->{vmid}); + my $vmstatus = PVE::QemuServer::vmstatus($param->{vmid}, 1); my $stat = $vmstatus->{$param->{vmid}}; if ($param->{verbose}) { foreach my $k (sort (keys %$stat)) { @@ -129,7 +129,7 @@ __PACKAGE__->register_method ({ print "$k: $v\n"; } } else { - my $status = $stat->{status} || 'unknown'; + my $status = $stat->{qmpstatus} || 'unknown'; print "status: $status\n"; } @@ -392,7 +392,7 @@ our $cmddef = { foreach my $rec (sort { $a->{vmid} <=> $b->{vmid} } @$vmlist) { printf "%10s %-20s %-10s %-10s %12.2f %-10s\n", $rec->{vmid}, $rec->{name}, - $rec->{status}, + $rec->{qmpstatus} || $rec->{status}, ($rec->{maxmem} || 0)/(1024*1024), ($rec->{maxdisk} || 0)/(1024*1024*1024), $rec->{pid}||0;