mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-07 14:53:38 +00:00
print query-proxmox-support result in 'full' status
Extends print_recursive_hash for the CLI to handle JSON booleans so the result will actually show up in 'qm status --verbose'. Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
parent
1b535ca9f9
commit
6891fd70ed
@ -110,7 +110,7 @@ sub print_recursive_hash {
|
|||||||
foreach my $item (@$hash) {
|
foreach my $item (@$hash) {
|
||||||
print_recursive_hash("\t$prefix", $item);
|
print_recursive_hash("\t$prefix", $item);
|
||||||
}
|
}
|
||||||
} elsif (!ref($hash) && defined($hash)) {
|
} elsif ((!ref($hash) && defined($hash)) || ref($hash) eq 'JSON::PP::Boolean') {
|
||||||
if (defined($key)) {
|
if (defined($key)) {
|
||||||
print "$prefix$key: $hash\n";
|
print "$prefix$key: $hash\n";
|
||||||
} else {
|
} else {
|
||||||
|
@ -2748,6 +2748,14 @@ sub vmstatus {
|
|||||||
|
|
||||||
$qmpclient->queue_execute(undef, 2);
|
$qmpclient->queue_execute(undef, 2);
|
||||||
|
|
||||||
|
foreach my $vmid (keys %$list) {
|
||||||
|
next if $opt_vmid && ($vmid ne $opt_vmid);
|
||||||
|
# we can't use the $qmpclient since it might have already aborted on
|
||||||
|
# 'query-balloon', but this might also fail for older versions...
|
||||||
|
my $qemu_support = eval { mon_cmd($vmid, "query-proxmox-support") };
|
||||||
|
$res->{$vmid}->{'proxmox-support'} = $qemu_support // {};
|
||||||
|
}
|
||||||
|
|
||||||
foreach my $vmid (keys %$list) {
|
foreach my $vmid (keys %$list) {
|
||||||
next if $opt_vmid && ($vmid ne $opt_vmid);
|
next if $opt_vmid && ($vmid ne $opt_vmid);
|
||||||
$res->{$vmid}->{qmpstatus} = $res->{$vmid}->{status} if !$res->{$vmid}->{qmpstatus};
|
$res->{$vmid}->{qmpstatus} = $res->{$vmid}->{status} if !$res->{$vmid}->{qmpstatus};
|
||||||
|
Loading…
Reference in New Issue
Block a user