From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 63D2D6627E for ; Thu, 5 Nov 2020 12:18:07 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5BC471760A for ; Thu, 5 Nov 2020 12:18:07 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id DF96317602 for ; Thu, 5 Nov 2020 12:18:06 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 9925446041 for ; Thu, 5 Nov 2020 12:18:06 +0100 (CET) From: Stefan Reiter To: pve-devel@lists.proxmox.com Date: Thu, 5 Nov 2020 12:17:59 +0100 Message-Id: <20201105111759.20569-4-s.reiter@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201105111759.20569-1-s.reiter@proxmox.com> References: <20201105111759.20569-1-s.reiter@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.037 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [qemuserver.pm, qm.pm] Subject: [pve-devel] [PATCH qemu-server 3/3] print query-proxmox-support result in 'full' status X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Nov 2020 11:18:07 -0000 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 --- PVE/CLI/qm.pm | 2 +- PVE/QemuServer.pm | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm index b3b9251..b9b6051 100755 --- a/PVE/CLI/qm.pm +++ b/PVE/CLI/qm.pm @@ -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 { diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index fb68ce5..8b94ab0 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -2754,6 +2754,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}; -- 2.20.1