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 DAA00639A5 for ; Wed, 25 Nov 2020 12:03:22 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D2E98189E5 for ; Wed, 25 Nov 2020 12:03:22 +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 0A273189DB for ; Wed, 25 Nov 2020 12:03:22 +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 BFB4743E9D for ; Wed, 25 Nov 2020 12:03:21 +0100 (CET) Date: Wed, 25 Nov 2020 12:03:14 +0100 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20201124154122.22202-1-s.reiter@proxmox.com> <20201124154122.22202-4-s.reiter@proxmox.com> In-Reply-To: <20201124154122.22202-4-s.reiter@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid) Message-Id: <1606302042.n87mxnfv4h.astroid@nora.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.024 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. [proxmox.com, qm.pm, qemuserver.pm] Subject: [pve-devel] applied: [PATCH v3 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: Wed, 25 Nov 2020 11:03:22 -0000 with mentioned followup On November 24, 2020 4:41 pm, Stefan Reiter wrote: > Extends print_recursive_hash for the CLI to handle JSON booleans so the > result will actually show up in 'qm status --verbose'. >=20 > Signed-off-by: Stefan Reiter > --- >=20 > v3: unchanged >=20 > PVE/CLI/qm.pm | 2 +- > PVE/QemuServer.pm | 8 ++++++++ > 2 files changed, 9 insertions(+), 1 deletion(-) >=20 > 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 9704042..6966717 100644 > --- a/PVE/QemuServer.pm > +++ b/PVE/QemuServer.pm > @@ -2748,6 +2748,14 @@ sub vmstatus { > =20 > $qmpclient->queue_execute(undef, 2); > =20 > + 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 =3D eval { mon_cmd($vmid, "query-proxmox-support") }; > + $res->{$vmid}->{'proxmox-support'} =3D $qemu_support // {}; > + } > + > foreach my $vmid (keys %$list) { > next if $opt_vmid && ($vmid ne $opt_vmid); > $res->{$vmid}->{qmpstatus} =3D $res->{$vmid}->{status} if !$res->{$vmid= }->{qmpstatus}; > --=20 > 2.20.1 >=20 >=20 >=20 > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel >=20 >=20 >=20 =