From nobody Sat Feb 7 08:58:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562020248; cv=none; d=zoho.com; s=zohoarc; b=bWyio2vHniix4+h0HNaMjcJzLSt9iIi+YpE/52VxejbW/E9Ls3DY5qTMBL18LxftgOJ3Mld0Em8AQN9aY3PyFCnzuoReqEeoTSA+3M6UJZQ10DJoiB6i2I+7kyzCFBjP+8kdz/cJLRhGwoXzuiU/wx5XYZIs7A/SL5z34VFzXzs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562020248; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Xywa4H2pmgvt2aN1hsd+N19HnJf6GMmVHVx4PUAcNko=; b=BV6fFn3zHFBKzDnWVocWKy+b1Jret1sf2Ex3p9YOhAvpvfk+53MYN/ynX0Bf9s3Ibxnk21i1JN1XBwLe1guEMLgOPgBRRZhoeL7tLHSbNxT49Taev2xS3GYwaqD9//9KVpGK86vR0mQAdUeBZ5tfEpHSHfxBDjenbo0XKOoa7iU= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 156202024896449.7007396097722; Mon, 1 Jul 2019 15:30:48 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DD34A81F25; Mon, 1 Jul 2019 22:30:42 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 11A77100033F; Mon, 1 Jul 2019 22:30:42 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B890D206D1; Mon, 1 Jul 2019 22:30:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x61MTQkZ031376 for ; Mon, 1 Jul 2019 18:29:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5DF481812D; Mon, 1 Jul 2019 22:29:26 +0000 (UTC) Received: from localhost (ovpn-116-30.gru2.redhat.com [10.97.116.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A54784FA; Mon, 1 Jul 2019 22:29:21 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org, Cleber Rosa Date: Mon, 1 Jul 2019 19:29:09 -0300 Message-Id: <20190701222912.4703-2-ehabkost@redhat.com> In-Reply-To: <20190701222912.4703-1-ehabkost@redhat.com> References: <20190701222912.4703-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Fam Zheng , Kevin Wolf , Eduardo Habkost , qemu-block@nongnu.org, libvir-list@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Max Reitz , Aleksandar Rikalo , Aleksandar Markovic , Igor Mammedov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno Subject: [libvirt] [PULL 1/4] qmp: make qmp-shell work with python3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 01 Jul 2019 22:30:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" From: Igor Mammedov python3 doesn't have raw_input(), so qmp-shell breaks. Use input() instead and override it with raw_input() if running on python2. Signed-off-by: Igor Mammedov Message-Id: <20190620154035.30989-1-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- 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 7776c7b141..f1cddeafbc 100755 --- a/scripts/qmp/qmp-shell +++ b/scripts/qmp/qmp-shell @@ -78,6 +78,9 @@ import re sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) from qemu import qmp =20 +if sys.version_info[0] =3D=3D 2: + input =3D raw_input + class QMPCompleter(list): def complete(self, text, state): for cmd in self: @@ -308,7 +311,7 @@ class QMPShell(qmp.QEMUMonitorProtocol): @return True if execution was ok, return False if disconnected. """ try: - cmdline =3D raw_input(prompt) + cmdline =3D input(prompt) except EOFError: print() return False --=20 2.18.0.rc1.1.g3f1ff2140 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list