From nobody Mon Apr 29 11:36:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1493902686371502.98694439456483; Thu, 4 May 2017 05:58:06 -0700 (PDT) Received: from localhost ([::1]:41839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6GKa-0003Ad-58 for importer@patchew.org; Thu, 04 May 2017 08:58:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6GHM-0000NJ-NZ for qemu-devel@nongnu.org; Thu, 04 May 2017 08:54:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6GHL-0006FB-SN for qemu-devel@nongnu.org; Thu, 04 May 2017 08:54:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59906) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6GHL-0006Ey-MR for qemu-devel@nongnu.org; Thu, 04 May 2017 08:54:43 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 90B8F4E8AB for ; Thu, 4 May 2017 12:54:42 +0000 (UTC) Received: from localhost (ovpn-117-244.ams2.redhat.com [10.36.117.244]) by smtp.corp.redhat.com (Postfix) with ESMTP id D6C7717507; Thu, 4 May 2017 12:54:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 90B8F4E8AB Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 90B8F4E8AB From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 4 May 2017 16:54:29 +0400 Message-Id: <20170504125432.21653-2-marcandre.lureau@redhat.com> In-Reply-To: <20170504125432.21653-1-marcandre.lureau@redhat.com> References: <20170504125432.21653-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 04 May 2017 12:54:42 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/4] qmp-shell: add -N option to skip negotiate X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" qemu-ga doesn't have negotiate phase. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Eric Blake --- scripts/qmp/qmp-shell | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell index eccb88a4e8..f80d02312a 100755 --- a/scripts/qmp/qmp-shell +++ b/scripts/qmp/qmp-shell @@ -256,8 +256,8 @@ class QMPShell(qmp.QEMUMonitorProtocol): self._print(resp) return True =20 - def connect(self): - self._greeting =3D qmp.QEMUMonitorProtocol.connect(self) + def connect(self, negotiate): + self._greeting =3D qmp.QEMUMonitorProtocol.connect(self, negotiate) self.__completer_setup() =20 def show_banner(self, msg=3D'Welcome to the QMP low-level shell!'): @@ -369,7 +369,7 @@ def die(msg): def fail_cmdline(option=3DNone): if option: sys.stderr.write('ERROR: bad command-line option \'%s\'\n' % optio= n) - sys.stderr.write('qemu-shell [ -v ] [ -p ] [ -H ] < UNIX socket path> = | < TCP address:port >\n') + sys.stderr.write('qemu-shell [ -v ] [ -p ] [ -H ] [ -N ] < UNIX socket= path> | < TCP address:port >\n') sys.exit(1) =20 def main(): @@ -378,6 +378,7 @@ def main(): hmp =3D False pretty =3D False verbose =3D False + negotiate =3D True =20 try: for arg in sys.argv[1:]: @@ -387,6 +388,8 @@ def main(): hmp =3D True elif arg =3D=3D "-p": pretty =3D True + elif arg =3D=3D "-N": + negotiate =3D False elif arg =3D=3D "-v": verbose =3D True else: @@ -404,7 +407,7 @@ def main(): die('bad port number in command-line') =20 try: - qemu.connect() + qemu.connect(negotiate) except qmp.QMPConnectError: die('Didn\'t get QMP greeting message') except qmp.QMPCapabilitiesError: --=20 2.12.0.191.gc5d8de91d From nobody Mon Apr 29 11:36:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1493902583804788.6903926966469; Thu, 4 May 2017 05:56:23 -0700 (PDT) Received: from localhost ([::1]:41834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6GIv-0001VF-J0 for importer@patchew.org; Thu, 04 May 2017 08:56:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6GHS-0000RY-8x for qemu-devel@nongnu.org; Thu, 04 May 2017 08:54:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6GHR-0006Hl-Ik for qemu-devel@nongnu.org; Thu, 04 May 2017 08:54:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41248) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6GHR-0006Hc-CD for qemu-devel@nongnu.org; Thu, 04 May 2017 08:54:49 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4B87BC04B948 for ; Thu, 4 May 2017 12:54:48 +0000 (UTC) Received: from localhost (ovpn-117-244.ams2.redhat.com [10.36.117.244]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4AEE91748C; Thu, 4 May 2017 12:54:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4B87BC04B948 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4B87BC04B948 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 4 May 2017 16:54:30 +0400 Message-Id: <20170504125432.21653-3-marcandre.lureau@redhat.com> In-Reply-To: <20170504125432.21653-1-marcandre.lureau@redhat.com> References: <20170504125432.21653-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 04 May 2017 12:54:48 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/4] qmp-shell: ignore query-commands error X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" qemu-ga doesn't implement it. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Eric Blake --- scripts/qmp/qmp-shell | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell index f80d02312a..04b8fa3eae 100755 --- a/scripts/qmp/qmp-shell +++ b/scripts/qmp/qmp-shell @@ -126,7 +126,10 @@ class QMPShell(qmp.QEMUMonitorProtocol): return arg =20 def _fill_completion(self): - for cmd in self.cmd('query-commands')['return']: + cmds =3D self.cmd('query-commands') + if cmds.has_key('error'): + return + for cmd in cmds['return']: self._completer.append(cmd['name']) =20 def __completer_setup(self): --=20 2.12.0.191.gc5d8de91d From nobody Mon Apr 29 11:36:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149390269729717.548044789982896; Thu, 4 May 2017 05:58:17 -0700 (PDT) Received: from localhost ([::1]:41840 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6GKk-0003Xc-Rc for importer@patchew.org; Thu, 04 May 2017 08:58:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6GHX-0000V4-GW for qemu-devel@nongnu.org; Thu, 04 May 2017 08:54:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6GHW-0006It-Q3 for qemu-devel@nongnu.org; Thu, 04 May 2017 08:54:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43244) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6GHW-0006Il-Ji for qemu-devel@nongnu.org; Thu, 04 May 2017 08:54:54 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6CBDC61D38 for ; Thu, 4 May 2017 12:54:53 +0000 (UTC) Received: from localhost (ovpn-117-244.ams2.redhat.com [10.36.117.244]) by smtp.corp.redhat.com (Postfix) with ESMTP id 09EE4183A0; Thu, 4 May 2017 12:54:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6CBDC61D38 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6CBDC61D38 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 4 May 2017 16:54:31 +0400 Message-Id: <20170504125432.21653-4-marcandre.lureau@redhat.com> In-Reply-To: <20170504125432.21653-1-marcandre.lureau@redhat.com> References: <20170504125432.21653-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 04 May 2017 12:54:53 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/4] qmp-shell: don't show version greeting if unavailable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" qemu-ga doesn't have greeting. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Eric Blake --- scripts/qmp/qmp-shell | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell index 04b8fa3eae..db24c87cdd 100755 --- a/scripts/qmp/qmp-shell +++ b/scripts/qmp/qmp-shell @@ -265,6 +265,9 @@ class QMPShell(qmp.QEMUMonitorProtocol): =20 def show_banner(self, msg=3D'Welcome to the QMP low-level shell!'): print msg + if not self._greeting: + print 'Connected' + return version =3D self._greeting['QMP']['version']['qemu'] print 'Connected to QEMU %d.%d.%d\n' % (version['major'],version['= minor'],version['micro']) =20 --=20 2.12.0.191.gc5d8de91d From nobody Mon Apr 29 11:36:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 14939026999511006.4640857129186; Thu, 4 May 2017 05:58:19 -0700 (PDT) Received: from localhost ([::1]:41841 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6GKn-0003gA-LF for importer@patchew.org; Thu, 04 May 2017 08:58:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6GHc-0000Z2-JQ for qemu-devel@nongnu.org; Thu, 04 May 2017 08:55:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6GHb-0006Jy-UF for qemu-devel@nongnu.org; Thu, 04 May 2017 08:55:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35870) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6GHb-0006Jn-Oq for qemu-devel@nongnu.org; Thu, 04 May 2017 08:54:59 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A140B7D4E1 for ; Thu, 4 May 2017 12:54:58 +0000 (UTC) Received: from localhost (ovpn-117-244.ams2.redhat.com [10.36.117.244]) by smtp.corp.redhat.com (Postfix) with ESMTP id 26EC918EFF; Thu, 4 May 2017 12:54:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A140B7D4E1 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A140B7D4E1 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 4 May 2017 16:54:32 +0400 Message-Id: <20170504125432.21653-5-marcandre.lureau@redhat.com> In-Reply-To: <20170504125432.21653-1-marcandre.lureau@redhat.com> References: <20170504125432.21653-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 04 May 2017 12:54:58 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 4/4] qmp-shell: improve help X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Describe the arguments & fix the tool name. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Eric Blake --- scripts/qmp/qmp-shell | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell index db24c87cdd..fce1ab6c49 100755 --- a/scripts/qmp/qmp-shell +++ b/scripts/qmp/qmp-shell @@ -375,7 +375,11 @@ def die(msg): def fail_cmdline(option=3DNone): if option: sys.stderr.write('ERROR: bad command-line option \'%s\'\n' % optio= n) - sys.stderr.write('qemu-shell [ -v ] [ -p ] [ -H ] [ -N ] < UNIX socket= path> | < TCP address:port >\n') + sys.stderr.write('qmp-shell [ -v ] [ -p ] [ -H ] [ -N ] < UNIX socket = path> | < TCP address:port >\n') + sys.stderr.write(' -v Verbose (echo command sent and received)\= n') + sys.stderr.write(' -p Pretty-print JSON\n') + sys.stderr.write(' -H Use HMP interface\n') + sys.stderr.write(' -N Skip negotiate (for qemu-ga)\n') sys.exit(1) =20 def main(): --=20 2.12.0.191.gc5d8de91d