]> git.proxmox.com Git - qemu-server.git/commitdiff
print query-proxmox-support result in 'full' status
authorStefan Reiter <s.reiter@proxmox.com>
Tue, 24 Nov 2020 15:41:22 +0000 (16:41 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 24 Nov 2020 16:20:56 +0000 (17:20 +0100)
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>
PVE/CLI/qm.pm
PVE/QemuServer.pm

index b3b9251c0ad17598beafc8763b082c6e8ab1e95b..b9b60511f9d9366f8bdc00479ba962d0f71c35e0 100755 (executable)
@@ -110,7 +110,7 @@ sub print_recursive_hash {
        foreach my $item (@$hash) {
            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)) {
            print "$prefix$key: $hash\n";
        } else {
index 9704042c704c7f6c048d2307210288c62f91a6d7..6966717b06ba3a05d40fc8473b5b27e4ba17ca33 100644 (file)
@@ -2748,6 +2748,14 @@ sub vmstatus {
 
     $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) {
        next if $opt_vmid && ($vmid ne $opt_vmid);
        $res->{$vmid}->{qmpstatus} = $res->{$vmid}->{status} if !$res->{$vmid}->{qmpstatus};