From patchwork Sun May 31 16:38:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 281596 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5622C433DF for ; Sun, 31 May 2020 16:42:20 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F1AC2074A for ; Sun, 31 May 2020 16:42:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="HrBc+Rfn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F1AC2074A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:57620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfR2R-0006AV-Os for qemu-devel@archiver.kernel.org; Sun, 31 May 2020 12:42:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfQzJ-0000vb-Ie for qemu-devel@nongnu.org; Sun, 31 May 2020 12:39:05 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:27371 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jfQzI-0006et-PP for qemu-devel@nongnu.org; Sun, 31 May 2020 12:39:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590943144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C/VDoQzlI3PMEip7rZs9mnHodIncfMhzQDNkbQhv2i8=; b=HrBc+RfnUyN+2cMol2wvSFsEXguNkdPTYEHArcXcZafDlVconFtGN/yO/wWhV7J0o8mnTY Yl9gbB+bnskmX2liS8+K6x6Yi/MQkDfYJj3ASB0pixL7mDaQMcsmfnXxePVLp/aqKkwxVe 0n3JT04X0Iw3K6EwDr4Z1j88gQcExI0= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-468-v20ZcIOeOsCxvQ5ZU-IkHA-1; Sun, 31 May 2020 12:39:01 -0400 X-MC-Unique: v20ZcIOeOsCxvQ5ZU-IkHA-1 Received: by mail-wm1-f71.google.com with SMTP id u11so1912763wmc.7 for ; Sun, 31 May 2020 09:39:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C/VDoQzlI3PMEip7rZs9mnHodIncfMhzQDNkbQhv2i8=; b=K/JWNvgFwAoZqRQICT9kZ13cLE/SVoOUxe4QmLfXDOEgolIaZ/VG9EdDPjiFR09qvw fjmli14XaIC2EyGRCI6nMzbovaMAyDeDBsoFxMaNmuc573IPU55Ntk9ZqJeMHtGTsC53 CENUJnF/pE9SIA/xPGHhTip+g2vcDVn9B4EuIWBcF613SN0sJiwgv4BDpR73YTbfyMTw FNCq8Wvl8vzSorzpKKaTdVQ+leFu9P1pCGFEnKIS6Sqeeg3lc3JPUiF+hqbnF+228Tzj C0jo4oPGFNbKTUPIXR5/8/7hYsb7L7t0VQ8bPqU3v7RDmlXwCIhjVEJMfIglOSSZLctt 3oHQ== X-Gm-Message-State: AOAM530AUNSE4jM1E0cICeY0FiZxakPGyTNXIwxjmalYufEFQUr9ELk1 TtW+Irw3i7rLZhvOLGWoSGDoy0/w6yHtkHxiuaHG/GOyDYJrF0mc3s3tprjt8Bpzk4UCJFc34pX 3soUiVglZe8l+Ovk= X-Received: by 2002:a1c:29c4:: with SMTP id p187mr17760836wmp.73.1590943140357; Sun, 31 May 2020 09:39:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIEiALGuV93Ro6dhnxfm0LVwVkfTLG/HYDNsHae0Cpu2iwY0tKkx4JmUw+UJ4NEDJTtGPkpg== X-Received: by 2002:a1c:29c4:: with SMTP id p187mr17760818wmp.73.1590943140155; Sun, 31 May 2020 09:39:00 -0700 (PDT) Received: from localhost.localdomain (43.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.43]) by smtp.gmail.com with ESMTPSA id d2sm17217183wrs.95.2020.05.31.09.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 May 2020 09:38:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 02/25] scripts/qemu-gdb: Use Python 3 interpreter Date: Sun, 31 May 2020 18:38:23 +0200 Message-Id: <20200531163846.25363-3-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200531163846.25363-1-philmd@redhat.com> References: <20200531163846.25363-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=205.139.110.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/31 11:09:45 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Fam Zheng , Eduardo Habkost , kvm@vger.kernel.org, =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Marcelo Tosatti , Markus Armbruster , Max Reitz , John Snow , Stefan Hajnoczi , Cleber Rosa , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: John Snow Reviewed-by: Kevin Wolf Message-Id: <20200512103238.7078-3-philmd@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- scripts/qemu-gdb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/qemu-gdb.py b/scripts/qemu-gdb.py index f2a305c42e..e0bfa7b5a4 100644 --- a/scripts/qemu-gdb.py +++ b/scripts/qemu-gdb.py @@ -1,5 +1,5 @@ -#!/usr/bin/python - +#!/usr/bin/env python3 +# # GDB debugging support # # Copyright 2012 Red Hat, Inc. and/or its affiliates From patchwork Sun May 31 16:38:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 281597 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28E70C433E0 for ; Sun, 31 May 2020 16:40:38 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EB7EC2074A for ; Sun, 31 May 2020 16:40:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Txazxr2A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EB7EC2074A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:50164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfR0n-00030U-0k for qemu-devel@archiver.kernel.org; Sun, 31 May 2020 12:40:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfQzP-00011i-61 for qemu-devel@nongnu.org; Sun, 31 May 2020 12:39:11 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:60587 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jfQzN-0006fA-0A for qemu-devel@nongnu.org; Sun, 31 May 2020 12:39:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590943148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yBN0He0hnRiO6mOUWUzXjmIAL9Om1ymVuyqwTdVM/HE=; b=Txazxr2ARYnX8O+IdPGDS0Bl40FOjSbD25QITJXgWHe4mZlZzp9R05b5WRisVjn48HRnG6 65L6uoWhZEloj5ZrzSGfSIHZlOvAVX5ygexm5/t+hiYnbQOcQWclDSzg2duHnErPsM95aB gfPaWqs36HniTS4dNfE3eOGXULNpkmQ= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-188-16JEslUKPqa6Uoiq5BsMzg-1; Sun, 31 May 2020 12:39:06 -0400 X-MC-Unique: 16JEslUKPqa6Uoiq5BsMzg-1 Received: by mail-wr1-f71.google.com with SMTP id e1so3634105wrm.3 for ; Sun, 31 May 2020 09:39:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yBN0He0hnRiO6mOUWUzXjmIAL9Om1ymVuyqwTdVM/HE=; b=q+d99xjW3rhOW8iYs5e348ZKW4LFOov3RBhMGY+F3UzoYVXC87fVf/Kz+I5I0Eb5hy BWGVi90NecZwxjmuNb+9//mAj2icHczSmjxBWu/t9fM28+bVEweiyvJ8sKsrPXxUV716 PtZHSRuZqaDp8AoiMooLUdOIJvlQEYHiQz5TOuFtIPcKoEOfJQkQIJGBJh8PD5vhhri9 BNsd0dAzFQRQRbGxAwKroLbtGc8d8LiIsQxxJipT6mAEvP+QCQXPaIzz/AXcvGpxeTRp VNrPdQAPFVrGrGVdvnwvsX96P+8Cbg1d0292zkC/CARiSYXbQHVNHws1B0iMRHmFlEdV u2fw== X-Gm-Message-State: AOAM533OAfDw/vnWF5MljjfxMSuOa2YlZWfBKiFvlNtA1EYdLHjoH191 PCIA9rmgvD88vomsaBq7PqNUAXVC+oKd02xnL3XMj0wYJCodu5o4BaQTPInollBwa60hIP1RGI+ 4ZlvCtZyoMYR/smM= X-Received: by 2002:adf:f0d2:: with SMTP id x18mr17834383wro.250.1590943145500; Sun, 31 May 2020 09:39:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+gCJF6HcUNgazMBl80tT6OrlhUIFDpGWEUH3j0u8boakYALkjhYWx7zPVPFdQkkPf5lo8sQ== X-Received: by 2002:adf:f0d2:: with SMTP id x18mr17834358wro.250.1590943145303; Sun, 31 May 2020 09:39:05 -0700 (PDT) Received: from localhost.localdomain (43.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.43]) by smtp.gmail.com with ESMTPSA id 5sm7692633wmz.16.2020.05.31.09.39.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 May 2020 09:39:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 03/25] scripts/qmp: Use Python 3 interpreter Date: Sun, 31 May 2020 18:38:24 +0200 Message-Id: <20200531163846.25363-4-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200531163846.25363-1-philmd@redhat.com> References: <20200531163846.25363-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=205.139.110.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/31 11:09:45 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Fam Zheng , Eduardo Habkost , kvm@vger.kernel.org, =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Marcelo Tosatti , Markus Armbruster , Max Reitz , John Snow , Stefan Hajnoczi , Cleber Rosa , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: John Snow Reviewed-by: Kevin Wolf Message-Id: <20200512103238.7078-4-philmd@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- scripts/qmp/qom-get | 2 +- scripts/qmp/qom-list | 2 +- scripts/qmp/qom-set | 2 +- scripts/qmp/qom-tree | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/qmp/qom-get b/scripts/qmp/qom-get index 007b4cd442..7c5ede91bb 100755 --- a/scripts/qmp/qom-get +++ b/scripts/qmp/qom-get @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 ## # QEMU Object Model test tools # diff --git a/scripts/qmp/qom-list b/scripts/qmp/qom-list index 03bda3446b..bb68fd65d4 100755 --- a/scripts/qmp/qom-list +++ b/scripts/qmp/qom-list @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 ## # QEMU Object Model test tools # diff --git a/scripts/qmp/qom-set b/scripts/qmp/qom-set index c37fe78b00..19881d85e9 100755 --- a/scripts/qmp/qom-set +++ b/scripts/qmp/qom-set @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 ## # QEMU Object Model test tools # diff --git a/scripts/qmp/qom-tree b/scripts/qmp/qom-tree index 1c8acf61e7..fa91147a03 100755 --- a/scripts/qmp/qom-tree +++ b/scripts/qmp/qom-tree @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 ## # QEMU Object Model test tools # From patchwork Sun May 31 16:38:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 281595 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3E43C433DF for ; Sun, 31 May 2020 16:42:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 905362074A for ; Sun, 31 May 2020 16:42:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cE15pxvR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 905362074A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfR2i-0006fV-NY for qemu-devel@archiver.kernel.org; Sun, 31 May 2020 12:42:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfQza-000197-I3 for qemu-devel@nongnu.org; Sun, 31 May 2020 12:39:22 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:51519 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jfQzU-0006gk-NW for qemu-devel@nongnu.org; Sun, 31 May 2020 12:39:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590943155; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sMv0WAWso8oUAufIgFUwjed/SkQYQOJci7UGvUEGULg=; b=cE15pxvRiqkc/NU4pvs3nnWDZKb6HIQdJ7y78MjgIRTMu9dD4O1kkQA2pTp9Qx5BOFT2BA 8oBz1gFPJJYx5aCy4+25mCvcDZ54Avc/FzsD2oPPA8rpzd2stzMzbmZWTtb2ecsJOPneoj UL/ru94byQsQlrmS4twdQTeGSYc/60g= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-62-uNXenVtOMGK0ECoTk_yG2w-1; Sun, 31 May 2020 12:39:11 -0400 X-MC-Unique: uNXenVtOMGK0ECoTk_yG2w-1 Received: by mail-wr1-f72.google.com with SMTP id s17so3598612wrt.7 for ; Sun, 31 May 2020 09:39:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sMv0WAWso8oUAufIgFUwjed/SkQYQOJci7UGvUEGULg=; b=UeQKivVy2pV0x3xbNCHftVqlmQv7ftcvTIYQCKXiBIrK66F7seqM1p/w/p6gk5U3va ChHmca5raYuMRxO/iBkUEdqEoG5eKVGH8Lost3wO52Qn0oNihozvJ70EKVKpcxb2QU6w gnaZZEcCL8enyFejctpEoJ9PYKeGITxLx/e095CK3e6+VU1qbQ05IleamnZU9CvQPp2o +4zENlOXBt9i/0JBtb4E0fym8hC8J9l/390nlL4zzXG4u8EbmqHsem33bDAD+T6KEeU/ mD8fDTqjayEe20KqEIAu4zkA8bs3eWUEok8yxKHbNj5NO+2kL6wIS0SZ66lnHlVAzIx8 pprw== X-Gm-Message-State: AOAM532mU7n45IAIIMA0oGnpAxem3KaeOb6+djlwLNRbEX4L55i0nrQH 9PgZ0eAa7FFVxY96zJjpQInyi5BnQz7EYIBGgerAveDDNtBi9aYwOzujGEEBl0g7KIU59FCFKCD BIDlQyu6cfwVeFOA= X-Received: by 2002:a5d:514f:: with SMTP id u15mr19116180wrt.132.1590943150626; Sun, 31 May 2020 09:39:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyG/iDkpGxrVd4v54lbHxHsAujyHTlU/e7fh0d4gw7L74BATUg8tOFaSEYyfJzJ1sFZwdHjKQ== X-Received: by 2002:a5d:514f:: with SMTP id u15mr19116175wrt.132.1590943150481; Sun, 31 May 2020 09:39:10 -0700 (PDT) Received: from localhost.localdomain (43.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.43]) by smtp.gmail.com with ESMTPSA id v7sm8920858wme.46.2020.05.31.09.39.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 May 2020 09:39:09 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 04/25] scripts/kvm/vmxcap: Use Python 3 interpreter and add pseudo-main() Date: Sun, 31 May 2020 18:38:25 +0200 Message-Id: <20200531163846.25363-5-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200531163846.25363-1-philmd@redhat.com> References: <20200531163846.25363-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=205.139.110.61; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/31 12:39:08 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Fam Zheng , Eduardo Habkost , kvm@vger.kernel.org, =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Marcelo Tosatti , Markus Armbruster , Max Reitz , John Snow , Stefan Hajnoczi , Cleber Rosa , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Acked-by: Paolo Bonzini Reviewed-by: John Snow Reviewed-by: Kevin Wolf Message-Id: <20200512103238.7078-5-philmd@redhat.com> --- scripts/kvm/vmxcap | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/kvm/vmxcap b/scripts/kvm/vmxcap index 971ed0e721..6fe66d5f57 100755 --- a/scripts/kvm/vmxcap +++ b/scripts/kvm/vmxcap @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # tool for querying VMX capabilities # @@ -275,5 +275,6 @@ controls = [ ), ] -for c in controls: - c.show() +if __name__ == '__main__': + for c in controls: + c.show() From patchwork Sun May 31 16:38:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 281594 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AFDDC433DF for ; Sun, 31 May 2020 16:44:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 621BA2074A for ; Sun, 31 May 2020 16:44:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VK0pEc+U" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 621BA2074A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfR4W-0001TU-Ef for qemu-devel@archiver.kernel.org; Sun, 31 May 2020 12:44:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfQzb-0001Aj-6j for qemu-devel@nongnu.org; Sun, 31 May 2020 12:39:23 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:28129 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jfQza-0006hA-A1 for qemu-devel@nongnu.org; Sun, 31 May 2020 12:39:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590943158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z30VvxAdMFSGdKMqEcqqUvnaAOKiyK2ObUonHxxh/Vo=; b=VK0pEc+U32sXaS/XI22yRdHsemPkGU09nPaFU3JYVmDB9pBhyV+TSQkawZXC/DXJTCVCOS g5ymL/awY/iD09uiMoQ4ljbwsseMVwF1cXbFORqrmlypoasGQOfVTKuQ8himpA6kccn4JN GTGNpEYvPWw5vZRZfo2WSCSwsUUMa7Q= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-251-osGQnmjkP9OJKBYOu3oiaQ-1; Sun, 31 May 2020 12:39:16 -0400 X-MC-Unique: osGQnmjkP9OJKBYOu3oiaQ-1 Received: by mail-wr1-f72.google.com with SMTP id e7so3139123wrp.14 for ; Sun, 31 May 2020 09:39:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Z30VvxAdMFSGdKMqEcqqUvnaAOKiyK2ObUonHxxh/Vo=; b=nfZnEX1amM/xyjnZi/lQ7P6d08mHgt6eI9yuZ8NBlGuHxLRkLepNsSUN/j+ZDOGKuk 9EPJozozn+391+jnoZ4k7ogQWomt5i/qJ53OdQjOpWtI7xJyYWZRh7N28kpaIzFrTH3e W7BYKz06p+pEG+xUJqPy3OIl/MXgpoICcqXCVB4H95VqQizdDxv5dSISmbUKA4o+memW nJSIoiDT5uF1rLMl6AxIC3EgkcH7v4xBUf2Izfj67UKINZObB6FVZiZ4XqAEfIK78V6S LZB0EMuOFqEwi9Sen0Fi1lM9zon49DpJiUuakk5MIiXkLLmSOEVfBaFeoLKuVcdDbab2 4tGw== X-Gm-Message-State: AOAM5319XgOjvCUo3jmgEUUeL+wz1mkVvzxvApQHJQ4reh0ER9AXzRnh Wam6dV4Jf6lmNOy8zL7tdpHu2hb93dl7IRFve2jogn0kysCe4KVF77UscbbJKyrL59s2v30Phpx mlzbj1y5rOYyrCWc= X-Received: by 2002:a1c:29c2:: with SMTP id p185mr16889176wmp.7.1590943155577; Sun, 31 May 2020 09:39:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOLd8dSnD3qnmQhUEm/Dn1hZEFh70mX5LIcVUN2qnXfZwKc4kvuMmAfTDZzOM7VoEzCzWu+g== X-Received: by 2002:a1c:29c2:: with SMTP id p185mr16889160wmp.7.1590943155392; Sun, 31 May 2020 09:39:15 -0700 (PDT) Received: from localhost.localdomain (43.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.43]) by smtp.gmail.com with ESMTPSA id l204sm9390658wmf.19.2020.05.31.09.39.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 May 2020 09:39:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 05/25] scripts/modules/module_block: Use Python 3 interpreter & add pseudo-main Date: Sun, 31 May 2020 18:38:26 +0200 Message-Id: <20200531163846.25363-6-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200531163846.25363-1-philmd@redhat.com> References: <20200531163846.25363-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.81; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/31 12:39:18 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Fam Zheng , Eduardo Habkost , kvm@vger.kernel.org, =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Marcelo Tosatti , Markus Armbruster , Max Reitz , John Snow , Stefan Hajnoczi , Cleber Rosa , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: John Snow Reviewed-by: Kevin Wolf Message-Id: <20200512103238.7078-6-philmd@redhat.com> --- scripts/modules/module_block.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/scripts/modules/module_block.py b/scripts/modules/module_block.py index f23191fac1..1109df827d 100644 --- a/scripts/modules/module_block.py +++ b/scripts/modules/module_block.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Module information generator # @@ -80,19 +80,20 @@ def print_bottom(fheader): #endif ''') -# First argument: output file -# All other arguments: modules source files (.c) -output_file = sys.argv[1] -with open(output_file, 'w') as fheader: - print_top(fheader) +if __name__ == '__main__': + # First argument: output file + # All other arguments: modules source files (.c) + output_file = sys.argv[1] + with open(output_file, 'w') as fheader: + print_top(fheader) - for filename in sys.argv[2:]: - if os.path.isfile(filename): - process_file(fheader, filename) - else: - print("File " + filename + " does not exist.", file=sys.stderr) - sys.exit(1) + for filename in sys.argv[2:]: + if os.path.isfile(filename): + process_file(fheader, filename) + else: + print("File " + filename + " does not exist.", file=sys.stderr) + sys.exit(1) - print_bottom(fheader) + print_bottom(fheader) -sys.exit(0) + sys.exit(0) From patchwork Sun May 31 16:38:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 281593 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D04DCC433E0 for ; Sun, 31 May 2020 16:45:38 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 97F3A2074A for ; Sun, 31 May 2020 16:45:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OyAcnKsy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97F3A2074A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfR5d-0002a4-L6 for qemu-devel@archiver.kernel.org; Sun, 31 May 2020 12:45:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55304) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfR07-0002IB-Ku for qemu-devel@nongnu.org; Sun, 31 May 2020 12:39:55 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:35292 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jfR06-0006qU-NW for qemu-devel@nongnu.org; Sun, 31 May 2020 12:39:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590943194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7aysy7LnzzU/PowJNv/vyjVqjvAz/h8eLbGuZ+OSeO4=; b=OyAcnKsyHIEC+qIaQGyWnUeA2mc8+DHPl7cODUexvoc4KdTvCxg8uUaZdOXmi54q28FUTF g0i1tijkl6IdB6t+Qg+SaheupCBU1bDLr1ANEUZKRXiGKfzxlCrJPTRSFLIUdValYYg7Lg 4gqy7Y1U+Cia326+WnEEpYIhl0tw2is= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-192-8CTkyKwTN3-RV-OIcULHpQ-1; Sun, 31 May 2020 12:39:52 -0400 X-MC-Unique: 8CTkyKwTN3-RV-OIcULHpQ-1 Received: by mail-wr1-f70.google.com with SMTP id p10so3619681wrn.19 for ; Sun, 31 May 2020 09:39:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7aysy7LnzzU/PowJNv/vyjVqjvAz/h8eLbGuZ+OSeO4=; b=SScVdRbmzbJD6aUuH6pvvAHlAa8uCcsrAqHKPnEc94eB/kLNQeAOcqGKEwUam8exWx kyTUEl8kyA2NdyAJrt26vSwj3uibC+rPU8Ie76pi2rQ9lo4hw6AyiA71Gc9AAevqvCo1 zxTocw5iUJdMtGgkD03eZ4Pue56bYL1kO1V1NvZg9XGB82XoZ5JGPLsLKtDcvDElBwdB F51JggJUAaGMDzdzetx2soS4a2dZAXuOk3zlyBfEbEJFAgqpcyfp+PFahVPgzBEaD9aN KLhBZBE1/ZMmkl+GoGNXKyFDADkMX3+7SWMWumiYGgLN8uZArqqDTG/1Ab9g7XRNRKr+ JsZA== X-Gm-Message-State: AOAM531KDTPx46SXuFyf5qgH2CvyxOjAUJvbJvO7X71SrvJDmSgD6vac Uo9AOpBv2N5GX6ZMCGZgpld3B6TpBHPUSUu4ubsc7bWIBbhMZ0aO+XJlBglg43fBrPOeid89Gim fGqV6K7yYbXAzreo= X-Received: by 2002:a7b:cae2:: with SMTP id t2mr18047619wml.150.1590943190881; Sun, 31 May 2020 09:39:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyk81obw3iwl5cmks4QKQu+FzG80vqvlMOpxZsa5rTowYPRYxGfXszL5E/IQCa/DUJwBl8aug== X-Received: by 2002:a7b:cae2:: with SMTP id t2mr18047608wml.150.1590943190702; Sun, 31 May 2020 09:39:50 -0700 (PDT) Received: from localhost.localdomain (43.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.43]) by smtp.gmail.com with ESMTPSA id q1sm5415572wmc.15.2020.05.31.09.39.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 May 2020 09:39:50 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 12/25] python/qemu: remove Python2 style super() calls Date: Sun, 31 May 2020 18:38:33 +0200 Message-Id: <20200531163846.25363-13-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200531163846.25363-1-philmd@redhat.com> References: <20200531163846.25363-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=205.139.110.61; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/31 12:39:08 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Fam Zheng , Eduardo Habkost , kvm@vger.kernel.org, =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Marcelo Tosatti , Markus Armbruster , Max Reitz , John Snow , Stefan Hajnoczi , Cleber Rosa , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: John Snow Use the Python3 style instead. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200514055403.18902-12-jsnow@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- python/qemu/machine.py | 2 +- python/qemu/qtest.py | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 187790ce9e..95a20a17f9 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -55,7 +55,7 @@ def __init__(self, reply): desc = reply["error"]["desc"] except KeyError: desc = reply - super(MonitorResponseError, self).__init__(desc) + super().__init__(desc) self.reply = reply diff --git a/python/qemu/qtest.py b/python/qemu/qtest.py index 53d814c064..7943487c2b 100644 --- a/python/qemu/qtest.py +++ b/python/qemu/qtest.py @@ -101,29 +101,28 @@ def __init__(self, binary, args=None, name=None, test_dir="/var/tmp", name = "qemu-%d" % os.getpid() if sock_dir is None: sock_dir = test_dir - super(QEMUQtestMachine, - self).__init__(binary, args, name=name, test_dir=test_dir, - socket_scm_helper=socket_scm_helper, - sock_dir=sock_dir) + super().__init__(binary, args, name=name, test_dir=test_dir, + socket_scm_helper=socket_scm_helper, + sock_dir=sock_dir) self._qtest = None self._qtest_path = os.path.join(sock_dir, name + "-qtest.sock") def _base_args(self): - args = super(QEMUQtestMachine, self)._base_args() + args = super()._base_args() args.extend(['-qtest', 'unix:path=' + self._qtest_path, '-accel', 'qtest']) return args def _pre_launch(self): - super(QEMUQtestMachine, self)._pre_launch() + super()._pre_launch() self._qtest = QEMUQtestProtocol(self._qtest_path, server=True) def _post_launch(self): - super(QEMUQtestMachine, self)._post_launch() + super()._post_launch() self._qtest.accept() def _post_shutdown(self): - super(QEMUQtestMachine, self)._post_shutdown() + super()._post_shutdown() self._remove_if_exists(self._qtest_path) def qtest(self, cmd): From patchwork Sun May 31 16:38:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 281592 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E026C433DF for ; Sun, 31 May 2020 16:47:22 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CD0352074A for ; Sun, 31 May 2020 16:47:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TSu9kky/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CD0352074A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfR7I-0005Zm-T7 for qemu-devel@archiver.kernel.org; Sun, 31 May 2020 12:47:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfR0H-0002dh-D9 for qemu-devel@nongnu.org; Sun, 31 May 2020 12:40:05 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:29260 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jfR0D-0006tG-DR for qemu-devel@nongnu.org; Sun, 31 May 2020 12:40:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590943200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZGJCD3WtpxESapRsldRYyPkWs2bF0ehM3T5fdkPvFFk=; b=TSu9kky/5xdS9F+dCqW/bNd8nnphs8gjD2hzz42LaISvch537aUNHyIIewvfI9W8sHSYzk EwggN1GgaNVRu2yKgk0N1eRxRyMI7YVXC4OLIHkOR6II8Hg6iHj/phY+zpJ0n6CVoQZ7jR pIx9cD1wH3LK0eoDwaF3jzgtnV3ySag= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-214-at6wA1JqMreU_Jt8MehhQw-1; Sun, 31 May 2020 12:39:57 -0400 X-MC-Unique: at6wA1JqMreU_Jt8MehhQw-1 Received: by mail-wr1-f71.google.com with SMTP id s7so3619086wrm.16 for ; Sun, 31 May 2020 09:39:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZGJCD3WtpxESapRsldRYyPkWs2bF0ehM3T5fdkPvFFk=; b=iVSQq9+C2npHNSNNy/u+s/vNZHESmq80uEmgtwN9PnieXQAEL81UZHMmGrkyEbjJnd Hn6yMVUqevd57wNbyRtDoagzwu8UN9XhD4l+F66cHIP2Bi8CKnnMcSdLpupWjvxe1BIs hyldv8ibKQ2wNwGBixECKJlhflsRgNwp2T/Ekt3deOwbqvsdATLvEu2jldtGDdcWZB6p AkMjiPf3Fy+kmVLPPorfHpoj0+89UFIoZ8NR/N8dmaagm15FikeqIX4vIcp3z9r6Xr+4 FNzJPkhI7QaqQUh2xiIAE41x5W6SKAVP1Aapzw9uReFlaXU6+CnIMOH+YWoC6fJh+7qC SgPw== X-Gm-Message-State: AOAM532It77JBfTr/H/UxRBWoMpP+TTLSSD8CYIZaCegk8W0hjHGK+SG iQhqpbhr5k8R+7Pqv/ShpVmvdDexD5CE5x3EnjZlvrVIJZR711hx5yl0+mhJU/gOPKNn/2PjyhJ 3k3Hk3AozNjvTSD4= X-Received: by 2002:a7b:c201:: with SMTP id x1mr17564255wmi.58.1590943195858; Sun, 31 May 2020 09:39:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOEXwNNL/vFr901ND3jDCNFYuC5Y9R8OiJUy3KhCsCICPZclc2nGHqbOnLRtzqs9ghv2iSEA== X-Received: by 2002:a7b:c201:: with SMTP id x1mr17564238wmi.58.1590943195679; Sun, 31 May 2020 09:39:55 -0700 (PDT) Received: from localhost.localdomain (43.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.43]) by smtp.gmail.com with ESMTPSA id d13sm8387945wmb.39.2020.05.31.09.39.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 May 2020 09:39:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 13/25] python/qemu: fix socket.makefile() typing Date: Sun, 31 May 2020 18:38:34 +0200 Message-Id: <20200531163846.25363-14-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200531163846.25363-1-philmd@redhat.com> References: <20200531163846.25363-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=205.139.110.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/31 11:09:45 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, T_DKIM_INVALID=0.01, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Fam Zheng , Eduardo Habkost , kvm@vger.kernel.org, =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Marcelo Tosatti , Markus Armbruster , Max Reitz , John Snow , Stefan Hajnoczi , Cleber Rosa , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: John Snow Note: A bug in typeshed (https://github.com/python/typeshed/issues/3977) misinterprets the type of makefile(). Work around this by explicitly stating that we are opening a text-mode file. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200514055403.18902-13-jsnow@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- python/qemu/qmp.py | 10 +++++++--- python/qemu/qtest.py | 12 ++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py index 6ae7693965..73d49050ed 100644 --- a/python/qemu/qmp.py +++ b/python/qemu/qmp.py @@ -11,6 +11,10 @@ import errno import socket import logging +from typing import ( + Optional, + TextIO, +) class QMPError(Exception): @@ -61,7 +65,7 @@ def __init__(self, address, server=False, nickname=None): self.__events = [] self.__address = address self.__sock = self.__get_sock() - self.__sockfile = None + self.__sockfile: Optional[TextIO] = None self._nickname = nickname if self._nickname: self.logger = logging.getLogger('QMP').getChild(self._nickname) @@ -157,7 +161,7 @@ def connect(self, negotiate=True): @raise QMPCapabilitiesError if fails to negotiate capabilities """ self.__sock.connect(self.__address) - self.__sockfile = self.__sock.makefile() + self.__sockfile = self.__sock.makefile(mode='r') if negotiate: return self.__negotiate_capabilities() return None @@ -180,7 +184,7 @@ def accept(self, timeout=15.0): """ self.__sock.settimeout(timeout) self.__sock, _ = self.__sock.accept() - self.__sockfile = self.__sock.makefile() + self.__sockfile = self.__sock.makefile(mode='r') return self.__negotiate_capabilities() def cmd_obj(self, qmp_cmd): diff --git a/python/qemu/qtest.py b/python/qemu/qtest.py index 7943487c2b..4c88590eb0 100644 --- a/python/qemu/qtest.py +++ b/python/qemu/qtest.py @@ -19,6 +19,7 @@ import socket import os +from typing import Optional, TextIO from .machine import QEMUMachine @@ -40,7 +41,7 @@ class QEMUQtestProtocol: def __init__(self, address, server=False): self._address = address self._sock = self._get_sock() - self._sockfile = None + self._sockfile: Optional[TextIO] = None if server: self._sock.bind(self._address) self._sock.listen(1) @@ -59,7 +60,7 @@ def connect(self): @raise socket.error on socket connection errors """ self._sock.connect(self._address) - self._sockfile = self._sock.makefile() + self._sockfile = self._sock.makefile(mode='r') def accept(self): """ @@ -68,7 +69,7 @@ def accept(self): @raise socket.error on socket connection errors """ self._sock, _ = self._sock.accept() - self._sockfile = self._sock.makefile() + self._sockfile = self._sock.makefile(mode='r') def cmd(self, qtest_cmd): """ @@ -76,6 +77,7 @@ def cmd(self, qtest_cmd): @param qtest_cmd: qtest command text to be sent """ + assert self._sockfile is not None self._sock.sendall((qtest_cmd + "\n").encode('utf-8')) resp = self._sockfile.readline() return resp @@ -83,7 +85,9 @@ def cmd(self, qtest_cmd): def close(self): """Close this socket.""" self._sock.close() - self._sockfile.close() + if self._sockfile: + self._sockfile.close() + self._sockfile = None def settimeout(self, timeout): """Set a timeout, in seconds.""" From patchwork Sun May 31 16:38:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 281591 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 466DDC433DF for ; Sun, 31 May 2020 16:48:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 142822074A for ; Sun, 31 May 2020 16:48:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bshl83C/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 142822074A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:50478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfR89-0006gj-5t for qemu-devel@archiver.kernel.org; Sun, 31 May 2020 12:48:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfR0S-00032V-0p for qemu-devel@nongnu.org; Sun, 31 May 2020 12:40:16 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:33198 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jfR0Q-0006vz-Qx for qemu-devel@nongnu.org; Sun, 31 May 2020 12:40:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590943214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZYPUmQb4YdG6fVvlkNEcNWtgTrI955nKbvTxVdHF9pE=; b=bshl83C/7Rd4/EGppnliWsORBjZq3h/J/Zq/5aVZos9R7CE6yzPyvvkk21ZFh47nYhxyqW YMvzzZqKsWVhA3z8tPtqsReWtc+VPpxJRZaGv4CNPoUTF/LvVztsTrUaxpIANiVsAODU05 Cv23t9rJW79+YiL99TCyNpfxNMicCbA= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-479-8i0FtZ3EOaiPwxJz33IjHw-1; Sun, 31 May 2020 12:40:12 -0400 X-MC-Unique: 8i0FtZ3EOaiPwxJz33IjHw-1 Received: by mail-wr1-f69.google.com with SMTP id l18so3650587wrm.0 for ; Sun, 31 May 2020 09:40:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZYPUmQb4YdG6fVvlkNEcNWtgTrI955nKbvTxVdHF9pE=; b=c5yWa+5JUlXc/IRSZsv43GxvXIKVLMYpind+8IXcbsvujtXKIDXd9rOghcu4vbHzFa znNtpNom152ILMtC0EhZsPME6uQ3fUwI82826f9X87Qpc2gE1oh5tOSfXXcUlDkqEy6R jGa3GxsfF3Agym/ljqGbQm+o24fKEiK53dNdtmIHYUFqsavBew6ol+uozAwBeIFkUlg7 7mVPC3fmu0AtdJxxhjSurkN5El7zMZG6T61tftnzO7SpyIDfcCa+lEtFSCZHVoLU2V7j 5FdWn92goieUX0m12ngWfC6Ooa/eA2AnxUhhFFgSjvGJFRfndMDGUGe3gk8dqVxQ8B36 e8PA== X-Gm-Message-State: AOAM531sGIyDT9NyZ3IDtoJZb+mieBwIXhp43tATFny0wkUBAzZT9c5/ SnYetAwsGUn76NFCnCO67rCp8fLFb507Rby1cg5YYJrRaGaMwILCIQpuU17Q3pvAT9wuvL0PACr //K8GFUFUavgOLPM= X-Received: by 2002:a5d:6b85:: with SMTP id n5mr17895544wrx.11.1590943211355; Sun, 31 May 2020 09:40:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRd7yv6wPdWcd+XCZmDkbf6iSWHFTnRixvYzZNCu7K1dThRp4MzloCWxTm7st5mmh8HR0q3Q== X-Received: by 2002:a5d:6b85:: with SMTP id n5mr17895523wrx.11.1590943211151; Sun, 31 May 2020 09:40:11 -0700 (PDT) Received: from localhost.localdomain (43.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.43]) by smtp.gmail.com with ESMTPSA id s72sm8428958wme.35.2020.05.31.09.40.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 May 2020 09:40:10 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 16/25] python/qemu/qmp: assert sockfile is not None Date: Sun, 31 May 2020 18:38:37 +0200 Message-Id: <20200531163846.25363-17-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200531163846.25363-1-philmd@redhat.com> References: <20200531163846.25363-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/31 12:38:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Fam Zheng , Eduardo Habkost , kvm@vger.kernel.org, =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Marcelo Tosatti , Markus Armbruster , Max Reitz , John Snow , Stefan Hajnoczi , Cleber Rosa , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: John Snow In truth, if you don't do this, you'll just get a TypeError exception. Now, you'll get an AssertionError. Is this tangibly better? No. Does mypy complain less? Yes. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200514055403.18902-21-jsnow@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- python/qemu/qmp.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py index a634c4e26c..e64b6b5faa 100644 --- a/python/qemu/qmp.py +++ b/python/qemu/qmp.py @@ -94,6 +94,7 @@ def __negotiate_capabilities(self): raise QMPCapabilitiesError def __json_read(self, only_event=False): + assert self.__sockfile is not None while True: data = self.__sockfile.readline() if not data: From patchwork Sun May 31 16:38:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 187342 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp2340314ilb; Sun, 31 May 2020 09:48:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjhn0e6Q46IQR65EHfae7ES4vo5Jqd0FD0w8JdlQ7DqNf6bDZO5iLm6AGBTHE1hk9I8a3j X-Received: by 2002:a25:148b:: with SMTP id 133mr26651101ybu.38.1590943710220; Sun, 31 May 2020 09:48:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590943710; cv=none; d=google.com; s=arc-20160816; b=q7W4ciYO4YOJdoYxrdZ5d32VGNmHISMgyeyydaa2Evgqvh8XReaqrTjmv+mAeicBwJ vUi6zNoHr5aP7kiZ1KbeiVFWC9ljWpMQjuFB1SoA8vLGHY4rPM1szvo5LhhcSXYM9a27 IJbQNUMlXGm0N54i43e7mhrF0e/mT2+NCUx/DIWz1UMBiWI76B36mE4fpnTPg9dERQkM 81nwckMv70uklwMl9ia5pm7/e+kumHWy6VOZi+qbGIx7LirkF/5Pa94tGSOuHfmb7e0o SnPrx0s9FPUQBuXync1ZIceiUg9+CNKee18bQXaXOL+TeLbdGwta3/5daOPRjuUVCHEU 3Kzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Q4vVNWwGJ6X+mCxN22qm0JQKHOJ0PdAaDdcsNO2TkXQ=; b=frcGirz+kxpD87EibuS60FN/2L1VmUrGswwYyyfOp6e7tv5LWw+QdqtwMRZv185n/I 8sEyi43HtNYIjy7EuiNJM7S0L+WamakrFCrBQY9E3t7yu7XDSZZyf4CGynFt+WfY4zSN p7Pl0y/vKYQackcp5J8vuKBQ/I+GPtSFWNdkWQL7NE8o8AZEo5QVt8LlZcJBlWkMu61S 9mxwqru79TeFrb9VSuTa4rfB5/vwFb3qH+DE37ZcaTUKuN/gjPXSGzltY4dX/+BIIyig epxflIOSHvzfqGWlzELj9qsMyIIKKfHglVOIB00dbCOgoIx6QY1qFMZMdGXLiv5vgCAt jhlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=CB4lIwa6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 131si8794244ybe.185.2020.05.31.09.48.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 31 May 2020 09:48:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=CB4lIwa6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:52216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfR8P-0007Na-Ii for patch@linaro.org; Sun, 31 May 2020 12:48:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfR0b-0003QD-MU for qemu-devel@nongnu.org; Sun, 31 May 2020 12:40:25 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:25150 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jfR0a-000721-Np for qemu-devel@nongnu.org; Sun, 31 May 2020 12:40:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590943224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q4vVNWwGJ6X+mCxN22qm0JQKHOJ0PdAaDdcsNO2TkXQ=; b=CB4lIwa6Lnb5guiHSGOGs/5a3xowk44fIHL5Om/bfa816EEdzecYOxj3+2AOFGupnjPoTc 743hOlVri7Rsz5pCumrAMgjwJku3KcypR32X/MUOkMiwB7cvnxfgAUZWz2VYjGZCtP1MQA 7dZALHmB0zIwAoBKui70G4hw8uqcd5o= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-161-1b8HRgV4Nv6hHSwjLPJ7NQ-1; Sun, 31 May 2020 12:40:22 -0400 X-MC-Unique: 1b8HRgV4Nv6hHSwjLPJ7NQ-1 Received: by mail-wr1-f70.google.com with SMTP id o1so3590482wrm.17 for ; Sun, 31 May 2020 09:40:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q4vVNWwGJ6X+mCxN22qm0JQKHOJ0PdAaDdcsNO2TkXQ=; b=blqPPuFQgRPRq6xoAr4FKpci7b38mwK9VnrIjW78AJVA+cuRoX2yD9gvOUS10/beDU 0Zg3ijZW4BJ9SISTCXhlNulJr+8H+6oXWGDC5nv6rFI47b8BWqkJsYfR8aNrxFi1dlP5 6KrtkNWaWGiDoFyQ2skiLcioopqI93Ohb10pa222GVJxYIwltK5TOStGt5A3KVQhhWBk dMmh0KEUaKQZmU/GGrhi1CyKhofMQMqkTFpBcPPjKiFAAmAs26o1dayDeW4IMzCcMnti 4zonuZ8mxYre/K2gu3H4jCPRcYVaIiLLse7FS8jxWfnbHHmi5CYhA1gle6EUDGl/l66S I5og== X-Gm-Message-State: AOAM532W2M5rUS+ylQl6TRJ7bVk271xU783CGiH6MNcY1MiExWh7HAS0 06UL202S3QMr7V/U7B0/e2yw6ZM6zMFNhJ9MxTZWxDLRgX4Js0XiZLeARV+rFWs2hKIJc7VtRED aHhRsJWR9jO0dCm0= X-Received: by 2002:adf:eec2:: with SMTP id a2mr17399488wrp.136.1590943221349; Sun, 31 May 2020 09:40:21 -0700 (PDT) X-Received: by 2002:adf:eec2:: with SMTP id a2mr17399473wrp.136.1590943221141; Sun, 31 May 2020 09:40:21 -0700 (PDT) Received: from localhost.localdomain (43.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.43]) by smtp.gmail.com with ESMTPSA id a1sm10072069wmd.28.2020.05.31.09.40.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 May 2020 09:40:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 18/25] tests/vm: Pass --debug through for vm-boot-ssh Date: Sun, 31 May 2020 18:38:39 +0200 Message-Id: <20200531163846.25363-19-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200531163846.25363-1-philmd@redhat.com> References: <20200531163846.25363-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/31 12:38:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Fam Zheng , Robert Foley , Eduardo Habkost , kvm@vger.kernel.org, Peter Puhov , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Marcelo Tosatti , Markus Armbruster , Max Reitz , Stefan Hajnoczi , Cleber Rosa , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley This helps debug issues that occur during the boot sequence. Signed-off-by: Robert Foley Reviewed-by: Peter Puhov Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20200529203458.1038-5-robert.foley@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- tests/vm/Makefile.include | 1 + 1 file changed, 1 insertion(+) -- 2.21.3 diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index 74ab522c55..80f7f6bdee 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -91,6 +91,7 @@ vm-boot-ssh-%: $(IMAGES_DIR)/%.img $(call quiet-command, \ $(PYTHON) $(SRC_PATH)/tests/vm/$* \ $(if $(J),--jobs $(J)) \ + $(if $(V)$(DEBUG), --debug) \ --image "$<" \ --interactive \ false, \ From patchwork Sun May 31 16:38:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 187344 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp2341850ilb; Sun, 31 May 2020 09:51:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzV2CkraG88bUpgaHCl984rcGUnpiXHUwJ+B2bFIMyY3M4WmzGDfGglBVJDkHgacXC5GrT8 X-Received: by 2002:a25:83c1:: with SMTP id v1mr20509084ybm.280.1590943892072; Sun, 31 May 2020 09:51:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590943892; cv=none; d=google.com; s=arc-20160816; b=NlXr1F6iz/aJJ4dOFGJwnch3X5ST2zRYtik8T9KXZL+DIDU/O9CLbLdcj8EURw4b7B AF00mftjoDPgRbQyUMLAamIOYmrnRtJdUl5a4PJ8dpEgTrCUIg+SRu6K+cDfEsXjQ9QJ 6mc29DbSP6ngiAlkYruCkYmn7MKEDptxQFGDGOsQ/UUj+92HJ2lAKHn8ijRkV/oJjo+y 0TM7phN1C8eGVmy98OPNFGOd/8zevOJUXaJ3oBbMA1GnQx4vxfBX0+l6OThGuFXxDwJr 50Vq4OkIcalRJB3wUs3qP8lCzH93NETjJTsgV+hpA4RZJfBQzgi6DYnHte5lvp1Y0CDV WCPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=s8Rk2ct1SwmXVJV/wHXYbsX6rV3XnYQXBZW0Chu6BIg=; b=QJz8F+dTF/C/nalfbhK6kmlzc7RD7XpIllNC8MvfyLtjKxoDlrrBq0w//vxlqDZyDF d3md5CdK4yZ3FI9fe3OjtcS3aeT9NCi1mVioHCQYVs8TVLOdviOmVwV0ofgWJV3b6sh/ psUp7l9xla+Dc/+xoivBOvAX/xm6tvvXdnPmCIAIcWve5crzyKOTnWye6gYUbs+tOW6v T8UkK5iKYuk+OnnKqKvn5zUwvPpT6oXXNfNWn8utrt1/2Jwqi6bvqEl6Rj9llYGuvGNo O2fL3YX3O2AJa3/LqUt1xCiskLarycWhOXrtrWj5R93kP4BVgKpdyOKtCoGQ+znAp6cS /Hbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=fhf4PI9v; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b143si4243340ybg.70.2020.05.31.09.51.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 31 May 2020 09:51:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=fhf4PI9v; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:33146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfRBL-0002vp-DX for patch@linaro.org; Sun, 31 May 2020 12:51:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfR0m-0003fU-1C for qemu-devel@nongnu.org; Sun, 31 May 2020 12:40:36 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:46318 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jfR0h-00074l-MF for qemu-devel@nongnu.org; Sun, 31 May 2020 12:40:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590943230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=s8Rk2ct1SwmXVJV/wHXYbsX6rV3XnYQXBZW0Chu6BIg=; b=fhf4PI9vs31LS+Iorxow1wFT3sP1epGkjO9aNJLC/M80DKYrIFjn/+9HdF9s4TAEH5WGtq 9w67YAWh3r9qKmQNBay4nCzaev6+qPmmkH4Wz2fFHdtTgyABd1drMQeUljGAh5jZphjYyL fuHmNQ+bEVlfS6yyuw7Ee/0IRYurVLU= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-276-rwSre_RkM3u_yhMWRe1QpQ-1; Sun, 31 May 2020 12:40:27 -0400 X-MC-Unique: rwSre_RkM3u_yhMWRe1QpQ-1 Received: by mail-wr1-f71.google.com with SMTP id c14so3604197wrm.15 for ; Sun, 31 May 2020 09:40:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=s8Rk2ct1SwmXVJV/wHXYbsX6rV3XnYQXBZW0Chu6BIg=; b=FAXGJek6jaDPCo0056xRg9/SufTADAbQJdcto7y+/pd1Taam6+A/JvR+TEl+nA+qQn TUCyfmO/WlLBHt7Q05l39Off7Y2gYIsda871n8+Z1qlsGc79obMfC3XKUvGcTBwie+eY xqrKtGvtpGKxGYzStKN7HjzwwBHdUVubzIAEPTPddMOmKzC+x3qEO+ZaqUAZinYfG8OA 3XpJEmJVv82EF2uXlm0MrD1OAOaKmuuNY1DKtRjUVRhKf35d+2xUDRcKZYKZcIlpKkUW 1SbawOF7nMHoGltahuCoV3L3SI+MKZCibnZfquAwQxEQzzpdzdG/mC9eLSQ1QmoUXgr0 r7NA== X-Gm-Message-State: AOAM531B2GVo/bsNITlEjnH9nhKDqjMDj3MqtXfiPPpqul6M84uyO4Fr ctocKF7I3rhTND3+F2klr1Nz16BIkJI1zKyjvxAnkToTuoIy5YELzUB9MdGQhwo/AQhmt8Dl8dD nRpiEtBLXf+9KzMY= X-Received: by 2002:adf:fb0f:: with SMTP id c15mr19211122wrr.410.1590943226362; Sun, 31 May 2020 09:40:26 -0700 (PDT) X-Received: by 2002:adf:fb0f:: with SMTP id c15mr19211104wrr.410.1590943226147; Sun, 31 May 2020 09:40:26 -0700 (PDT) Received: from localhost.localdomain (43.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.43]) by smtp.gmail.com with ESMTPSA id y25sm9023876wmi.2.2020.05.31.09.40.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 May 2020 09:40:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 19/25] tests/vm: Add ability to select QEMU from current build Date: Sun, 31 May 2020 18:38:40 +0200 Message-Id: <20200531163846.25363-20-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200531163846.25363-1-philmd@redhat.com> References: <20200531163846.25363-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=205.139.110.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/31 11:09:45 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Fam Zheng , Robert Foley , Eduardo Habkost , kvm@vger.kernel.org, Peter Puhov , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Marcelo Tosatti , Markus Armbruster , Max Reitz , Stefan Hajnoczi , Cleber Rosa , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley Added a new special variable QEMU_LOCAL=1, which will indicate to take the QEMU binary from the current build. Signed-off-by: Robert Foley Reviewed-by: Peter Puhov Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20200529203458.1038-6-robert.foley@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- tests/vm/Makefile.include | 4 ++++ tests/vm/basevm.py | 28 +++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) -- 2.21.3 diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index 80f7f6bdee..a253aba457 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -41,6 +41,7 @@ endif @echo " J=[0..9]* - Override the -jN parameter for make commands" @echo " DEBUG=1 - Enable verbose output on host and interactive debugging" @echo " V=1 - Enable verbose ouput on host and guest commands" + @echo " QEMU_LOCAL=1 - Use QEMU binary local to this build." @echo " QEMU=/path/to/qemu - Change path to QEMU binary" @echo " QEMU_IMG=/path/to/qemu-img - Change path to qemu-img tool" @@ -57,6 +58,7 @@ $(IMAGES_DIR)/%.img: $(SRC_PATH)/tests/vm/% \ $(PYTHON) $< \ $(if $(V)$(DEBUG), --debug) \ $(if $(GENISOIMAGE),--genisoimage $(GENISOIMAGE)) \ + $(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \ --image "$@" \ --force \ --build-image $@, \ @@ -71,6 +73,7 @@ vm-build-%: $(IMAGES_DIR)/%.img $(if $(DEBUG), --interactive) \ $(if $(J),--jobs $(J)) \ $(if $(V),--verbose) \ + $(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \ --image "$<" \ $(if $(BUILD_TARGET),--build-target $(BUILD_TARGET)) \ --snapshot \ @@ -92,6 +95,7 @@ vm-boot-ssh-%: $(IMAGES_DIR)/%.img $(PYTHON) $(SRC_PATH)/tests/vm/$* \ $(if $(J),--jobs $(J)) \ $(if $(V)$(DEBUG), --debug) \ + $(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \ --image "$<" \ --interactive \ false, \ diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index a2d4054d72..5a3ce42281 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -61,9 +61,11 @@ class BaseVM(object): # 4 is arbitrary, but greater than 2, # since we found we need to wait more than twice as long. tcg_ssh_timeout_multiplier = 4 - def __init__(self, debug=False, vcpus=None, genisoimage=None): + def __init__(self, debug=False, vcpus=None, genisoimage=None, + build_path=None): self._guest = None self._genisoimage = genisoimage + self._build_path = build_path self._tmpdir = os.path.realpath(tempfile.mkdtemp(prefix="vm-test-", suffix=".tmp", dir=".")) @@ -184,15 +186,15 @@ def boot(self, img, extra_args=[]): "-device", "virtio-blk,drive=drive0,bootindex=0"] args += self._data_args + extra_args logging.debug("QEMU args: %s", " ".join(args)) - qemu_bin = os.environ.get("QEMU", "qemu-system-" + self.arch) - guest = QEMUMachine(binary=qemu_bin, args=args) + qemu_path = get_qemu_path(self.arch, self._build_path) + guest = QEMUMachine(binary=qemu_path, args=args) guest.set_machine('pc') guest.set_console() try: guest.launch() except: logging.error("Failed to launch QEMU, command line:") - logging.error(" ".join([qemu_bin] + args)) + logging.error(" ".join([qemu_path] + args)) logging.error("Log:") logging.error(guest.get_log()) logging.error("QEMU version >= 2.10 is required") @@ -391,6 +393,19 @@ def gen_cloud_init_iso(self): return os.path.join(cidir, "cloud-init.iso") +def get_qemu_path(arch, build_path=None): + """Fetch the path to the qemu binary.""" + # If QEMU environment variable set, it takes precedence + if "QEMU" in os.environ: + qemu_path = os.environ["QEMU"] + elif build_path: + qemu_path = os.path.join(build_path, arch + "-softmmu") + qemu_path = os.path.join(qemu_path, "qemu-system-" + arch) + else: + # Default is to use system path for qemu. + qemu_path = "qemu-system-" + arch + return qemu_path + def parse_args(vmcls): def get_default_jobs(): @@ -421,6 +436,9 @@ def get_default_jobs(): help="build QEMU from source in guest") parser.add_option("--build-target", help="QEMU build target", default="check") + parser.add_option("--build-path", default=None, + help="Path of build directory, "\ + "for using build tree QEMU binary. ") parser.add_option("--interactive", "-I", action="store_true", help="Interactively run command") parser.add_option("--snapshot", "-s", action="store_true", @@ -439,7 +457,7 @@ def main(vmcls): logging.basicConfig(level=(logging.DEBUG if args.debug else logging.WARN)) vm = vmcls(debug=args.debug, vcpus=args.jobs, - genisoimage=args.genisoimage) + genisoimage=args.genisoimage, build_path=args.build_path) if args.build_image: if os.path.exists(args.image) and not args.force: sys.stderr.writelines(["Image file exists: %s\n" % args.image, From patchwork Sun May 31 16:38:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 187343 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp2340791ilb; Sun, 31 May 2020 09:49:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeZogtuJ1OK216E2WjrMy4UboI7ivAhRYIPFbDr4RD7ezcJz8d/eXxEvUxip9X559JD0Pp X-Received: by 2002:a05:6902:102d:: with SMTP id x13mr9064920ybt.112.1590943771125; Sun, 31 May 2020 09:49:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590943771; cv=none; d=google.com; s=arc-20160816; b=etym7DtMXBWKWdv7Td00j9p0YCpg/E7z/jNGqtNJYtTeCOcXWEo35DtnCzJEZ+lzLx lcjDFzggh0HTeF8V3WEGnr/YYyhmtlcRnh1ZrVAMqdtDn2Xd8i+aKMuqbFpDnt1g6UAc 3W6vsxiVC+8D4afW+jn8ZqTT6ybQvKdkLR05EuZa36la2J4UhFKCgVpCjmtFBBVYxb7Y Xe15jNV6kibu+QAGZ6hU9fI5ZwFgBHMun9EnE3qP2DgT4iL8Do7pTjj6mHd2SZLCJBBo /GblFueZyXobzjCwiQV4VCOjOQFzn2t7NhzxMY5wUN9DcayBwrc15K9iWHYaFyjFJLNf MLHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=NeYhFc6juZkPrqvPgAt2uIQTGjMzeewfSJodiqWwwkw=; b=jeeifFjF5z406eRPc0drgeeQwnVC7ZTsRhor639y2BQJ3zsuA0G78nFuFRxHJVxAl5 IQ+uEOSImRcXG6gZmu6Vi0/Ce/GBIP7HPxkUML3C8RBBC5SOd0nEJ6pFu22IP3BY2hOD 99eQS12Xkw7XqgVxy0VfYCD4dl9utxKx55SbC6R0UvrLWzsWU3HlrOpS8IDhhejnhvxZ gHXmh4A1XeSXGRsuivFn6EtTvmRPGGFmfqEVkhlXdp4Hf5UESLneyTmVKu20QRg/V2oQ FN1et9kX3q6pxlpACbHc4EnHtPECZeeFGPa366Bp/TnQnlPx4e7otCayeDzDAXveuTR2 STYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=M6krOIEy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r22si13114529ybc.110.2020.05.31.09.49.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 31 May 2020 09:49:31 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=M6krOIEy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:55674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfR9O-0000La-KM for patch@linaro.org; Sun, 31 May 2020 12:49:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfR0m-0003fY-AT for qemu-devel@nongnu.org; Sun, 31 May 2020 12:40:36 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:47003 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jfR0k-00075g-Vv for qemu-devel@nongnu.org; Sun, 31 May 2020 12:40:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590943234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NeYhFc6juZkPrqvPgAt2uIQTGjMzeewfSJodiqWwwkw=; b=M6krOIEyp+NONDO30S7ZKr5lEfDMnujgBDcVgt3KSk5kdovvN84KQtLMPQd85iiCCyHsP1 nLT9sn0+xUm4f01nvBdcwBQ61pNKpsmxX7UI4u9zszOVGpLZuHR/Ex1XSgV+FyxlWrHFL0 yBKjjaqSFmWm54gTEly8w+vMClwWadM= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-368-GlhV1XoaO8aiRkjSiqQ3jQ-1; Sun, 31 May 2020 12:40:32 -0400 X-MC-Unique: GlhV1XoaO8aiRkjSiqQ3jQ-1 Received: by mail-wr1-f72.google.com with SMTP id l18so3650913wrm.0 for ; Sun, 31 May 2020 09:40:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NeYhFc6juZkPrqvPgAt2uIQTGjMzeewfSJodiqWwwkw=; b=pg6Q5/BJlc6i/iURgYsDx9L28Lu/PW0YRE/gA07kw2ShcK+97YnQ90tWStXjusw3en 6EaRUp4LNRgr3RM9LfPPus+XCnlMpBjLP4L0mE3O+Hj0RRF3rqOZZmSzvNnOGga326yJ UYq8tIsDpINTEl01a5KXi9FRBRQf5Ah3F5H7EZpcWsjOIP/zpVPeASLlnkt3WpmswyOk kkS8oTM6HtGbpX0HJ0/audRX3D0xeUa9rYwZzvHAz/UuRJ30dFjRi75kf2SAHrQArj1I PQH8HgS5qMAKa8yqwNc4EyNuGJurNrPkfo792/jwI51RxWs+ZfNXpsyc9f0EU3BnMxuZ JYFQ== X-Gm-Message-State: AOAM533RqkghEYKWLWHtIDSYoWogTg9l95IVkBV3rYRxQDrUR+VMrRD/ Hq5xTZIgJPPq3Dl1ZNSM26gQfLD3mt/qrqDeizjLk2QaGTv4JgkcpAFsP6TfBOowACc6/GBnQ8b t5qv0zV73zVJhgW0= X-Received: by 2002:a5d:628c:: with SMTP id k12mr17814523wru.211.1590943231326; Sun, 31 May 2020 09:40:31 -0700 (PDT) X-Received: by 2002:a5d:628c:: with SMTP id k12mr17814494wru.211.1590943231095; Sun, 31 May 2020 09:40:31 -0700 (PDT) Received: from localhost.localdomain (43.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.43]) by smtp.gmail.com with ESMTPSA id q4sm9026212wma.47.2020.05.31.09.40.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 May 2020 09:40:30 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 20/25] tests/vm: allow wait_ssh() to specify command Date: Sun, 31 May 2020 18:38:41 +0200 Message-Id: <20200531163846.25363-21-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200531163846.25363-1-philmd@redhat.com> References: <20200531163846.25363-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=205.139.110.61; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/31 12:39:08 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Fam Zheng , Robert Foley , Eduardo Habkost , kvm@vger.kernel.org, Peter Puhov , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Marcelo Tosatti , Markus Armbruster , Max Reitz , Stefan Hajnoczi , Cleber Rosa , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley This allows for waiting for completion of arbitrary commands. Signed-off-by: Robert Foley Reviewed-by: Peter Puhov Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20200529203458.1038-7-robert.foley@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- tests/vm/basevm.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.21.3 diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 5a3ce42281..a80b616a08 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -320,24 +320,24 @@ def console_sshd_config(self, prompt): def print_step(self, text): sys.stderr.write("### %s ...\n" % text) - def wait_ssh(self, wait_root=False, seconds=300): + def wait_ssh(self, wait_root=False, seconds=300, cmd="exit 0"): # Allow more time for VM to boot under TCG. if not kvm_available(self.arch): seconds *= self.tcg_ssh_timeout_multiplier starttime = datetime.datetime.now() endtime = starttime + datetime.timedelta(seconds=seconds) - guest_up = False + cmd_success = False while datetime.datetime.now() < endtime: - if wait_root and self.ssh_root("exit 0") == 0: - guest_up = True + if wait_root and self.ssh_root(cmd) == 0: + cmd_success = True break - elif self.ssh("exit 0") == 0: - guest_up = True + elif self.ssh(cmd) == 0: + cmd_success = True break seconds = (endtime - datetime.datetime.now()).total_seconds() logging.debug("%ds before timeout", seconds) time.sleep(1) - if not guest_up: + if not cmd_success: raise Exception("Timeout while waiting for guest ssh") def shutdown(self): From patchwork Sun May 31 16:38:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 281587 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08F15C433E1 for ; Sun, 31 May 2020 16:53:24 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C95692074A for ; Sun, 31 May 2020 16:53:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PQO9oomH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C95692074A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:40020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfRD8-0005ij-Vo for qemu-devel@archiver.kernel.org; Sun, 31 May 2020 12:53:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfR0s-0003lt-BL for qemu-devel@nongnu.org; Sun, 31 May 2020 12:40:42 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:27851 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jfR0r-00077Z-GS for qemu-devel@nongnu.org; Sun, 31 May 2020 12:40:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590943240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VtnVaYYGa7/aqTUYxIxdKhEN8NJpUIW8xv7x+iz9PNM=; b=PQO9oomHuKQXAetbNgAG2bFhyMYaVLgaIEhbWrbaxERj8G+zmR4/rsz9J7D9T6zvUPOb3k EQUVcTkbQX4GFgkpG5dAHWIpRXnynEXahueYwh4UkpyZaw6fpYeHg7FDfxsMIcFbX1u3hg 2w8eizMPrw4oDMLqyn8EVvg97QGo5NM= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-495-WYOkyo1POT6I94oeh47AYw-1; Sun, 31 May 2020 12:40:37 -0400 X-MC-Unique: WYOkyo1POT6I94oeh47AYw-1 Received: by mail-wr1-f69.google.com with SMTP id h6so3649462wrx.4 for ; Sun, 31 May 2020 09:40:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VtnVaYYGa7/aqTUYxIxdKhEN8NJpUIW8xv7x+iz9PNM=; b=AZD8Ilbz5Fyz/9qVoBwWNhQ5FfIScy2murvKY21qnfJCoIilWWOKA5mYzl38zoPQoe VUBmSPEPKeAUrhAtiKCgoIocOwFWzpL3Ydb8whI8brTn57mjHL9GmCRK8G+V07IkZ1O0 SxUGlxWODvdcNYKWYRkPZbExo7DU0ODPd1pzDCyJ81s5840livT/qwaGuurNZnwWtOD8 7veEDYAEm/vZ5QEKrZILW+qvOD7ANqPgYqfwOHxbaqeYHxCn6aP5h9mCiuEvpkNsQT27 IkJ2VivswpvgUFTjBD5wbrEsbTYsDiHfRgRGOb89BpoEatcvDywdfcxX6c2FHcOrVtk0 z/ZA== X-Gm-Message-State: AOAM533GxlGlzoOcXImw5CnZ+52WHnjgWqFV1FyVKPFBwv+1fgCnmhsm y9Cvbd8i6HPJFS+Lbdbbe8WO3HNktFQg9P5kP31Zppn9r3sTHldAZTHlLD6Q49xmE/ViQYzb3NP RGvmGX5kFWWyiazY= X-Received: by 2002:a5d:4484:: with SMTP id j4mr17681268wrq.325.1590943236590; Sun, 31 May 2020 09:40:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgZwwOTcr688HaliXjwVILCgXMwwdoueLVIOVtH/2dXXqGIkOpERxl7rjGuHjeNfqMMGldnQ== X-Received: by 2002:a5d:4484:: with SMTP id j4mr17681252wrq.325.1590943236436; Sun, 31 May 2020 09:40:36 -0700 (PDT) Received: from localhost.localdomain (43.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.43]) by smtp.gmail.com with ESMTPSA id d13sm8390301wmb.39.2020.05.31.09.40.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 May 2020 09:40:35 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 21/25] tests/migration/guestperf: Use Python 3 interpreter Date: Sun, 31 May 2020 18:38:42 +0200 Message-Id: <20200531163846.25363-22-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200531163846.25363-1-philmd@redhat.com> References: <20200531163846.25363-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/31 12:38:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Fam Zheng , Eduardo Habkost , kvm@vger.kernel.org, =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Marcelo Tosatti , Markus Armbruster , Max Reitz , John Snow , Stefan Hajnoczi , Cleber Rosa , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: John Snow Reviewed-by: Kevin Wolf Message-Id: <20200512103238.7078-7-philmd@redhat.com> --- tests/migration/guestperf-batch.py | 2 +- tests/migration/guestperf-plot.py | 2 +- tests/migration/guestperf.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/migration/guestperf-batch.py b/tests/migration/guestperf-batch.py index cb150ce804..f1e900908d 100755 --- a/tests/migration/guestperf-batch.py +++ b/tests/migration/guestperf-batch.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Migration test batch comparison invokation # diff --git a/tests/migration/guestperf-plot.py b/tests/migration/guestperf-plot.py index d70bb7a557..907151011a 100755 --- a/tests/migration/guestperf-plot.py +++ b/tests/migration/guestperf-plot.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Migration test graph plotting command # diff --git a/tests/migration/guestperf.py b/tests/migration/guestperf.py index 99b027e8ba..ba1c4bc4ca 100755 --- a/tests/migration/guestperf.py +++ b/tests/migration/guestperf.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Migration test direct invokation command # From patchwork Sun May 31 16:38:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 281586 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E83EEC433E0 for ; Sun, 31 May 2020 16:54:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AE80C2074A for ; Sun, 31 May 2020 16:54:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QVGuHUld" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE80C2074A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46384 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfREU-0008Qd-TJ for qemu-devel@archiver.kernel.org; Sun, 31 May 2020 12:54:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfR1D-0004Sr-40 for qemu-devel@nongnu.org; Sun, 31 May 2020 12:41:03 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:48351 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jfR1C-0007IL-0W for qemu-devel@nongnu.org; Sun, 31 May 2020 12:41:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590943261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j5BS+2d4i/ahG24dd/tHPN0fLUUFmd8jGntUYE3MrX0=; b=QVGuHUldABUXxW2N4Qro9bxjw+JGAAvcnmELyn3fiWYu3rGRi+xe68TTUeWrUgEgeapKUg COegbJ3W1QdthNyD0mMn8vqLOxGXyC5+kDl6V27JIy/ulO2E2+lUj3DbsBKRLxu2lY5LEa U+6Iet2pWrYr0nIwXDCxxAJl9RvA5ac= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-476-Vo9Ns-jYPfmWnb968jpDOA-1; Sun, 31 May 2020 12:40:58 -0400 X-MC-Unique: Vo9Ns-jYPfmWnb968jpDOA-1 Received: by mail-wr1-f69.google.com with SMTP id w16so3602882wru.18 for ; Sun, 31 May 2020 09:40:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=j5BS+2d4i/ahG24dd/tHPN0fLUUFmd8jGntUYE3MrX0=; b=UQo6A4yF+2mk8LUorBUiC6Q2O8Dpa0udrLh43RewdEc7B2BmssVO774GBdDES8nJkH Q58jtjStBZrydms9BTzLa/2iYFi2V2xvmkeoNHZzadq5tC5ZxQQrSicQjDAfCq3vBabv xELm/tz1LQDFSmY4eY6ZBAaup90wB+iTBS5gvDNe4S8E07LR4i68xC990Cpq4dxuvE60 PZjQlY2R/mIbrtlwPJEUOiMV8H0uIR4sIU/Z/Ur50D4EMLG3jG+0o3TmOgeDqMEZ806v HwfLXVvOpWemWnGgkitvddPtKHe4Sx35Xzzg7BW0BUqQQk9JNjG7DLxN+P4Dr5kB1Iae RZkQ== X-Gm-Message-State: AOAM530A6dof5+XLx780Mt6j9jtuts3HWCxx7LP9owDMB26H5gdZjiVO MT29W+BUOfNqtcYL5Y0YXBqvB6L26kUtvAAbLkXxUh+azdubMZMVLS9hOBdPNw3fwrXW1TZn6An N5WHA9ssgIGJDJUQ= X-Received: by 2002:adf:b354:: with SMTP id k20mr18137779wrd.412.1590943256927; Sun, 31 May 2020 09:40:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0HkzqO5UvunzkIevQCS8DP8RYc0sFupFoLUZyl6tgkem6GKu1Knj86ln8moQU3+6mIDc99g== X-Received: by 2002:adf:b354:: with SMTP id k20mr18137753wrd.412.1590943256749; Sun, 31 May 2020 09:40:56 -0700 (PDT) Received: from localhost.localdomain (43.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.43]) by smtp.gmail.com with ESMTPSA id d15sm18060321wrq.30.2020.05.31.09.40.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 May 2020 09:40:56 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 25/25] tests/acceptance: refactor boot_linux to allow code reuse Date: Sun, 31 May 2020 18:38:46 +0200 Message-Id: <20200531163846.25363-26-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200531163846.25363-1-philmd@redhat.com> References: <20200531163846.25363-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=205.139.110.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/31 11:09:45 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Fam Zheng , Eduardo Habkost , kvm@vger.kernel.org, Pavel Dovgalyuk , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Marcelo Tosatti , Markus Armbruster , Max Reitz , Pavel Dovgalyuk , Stefan Hajnoczi , Cleber Rosa , Paolo Bonzini , qemu-block@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Pavel Dovgalyuk This patch moves image downloading functions to the separate class to allow reusing them from record/replay tests. Signed-off-by: Pavel Dovgalyuk Tested-by: Philippe Mathieu-Daudé Message-Id: <159073593167.20809.17582679291556188984.stgit@pasha-ThinkPad-X280> Signed-off-by: Philippe Mathieu-Daudé --- tests/acceptance/boot_linux.py | 49 ++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/tests/acceptance/boot_linux.py b/tests/acceptance/boot_linux.py index 075a386300..3aa57e88b0 100644 --- a/tests/acceptance/boot_linux.py +++ b/tests/acceptance/boot_linux.py @@ -26,22 +26,8 @@ TCG_NOT_AVAILABLE = ACCEL_NOT_AVAILABLE_FMT % "TCG" -class BootLinux(Test): - """ - Boots a Linux system, checking for a successful initialization - """ - - timeout = 900 - chksum = None - - def setUp(self): - super(BootLinux, self).setUp() - self.vm.add_args('-smp', '2') - self.vm.add_args('-m', '1024') - self.prepare_boot() - self.prepare_cloudinit() - - def prepare_boot(self): +class BootLinuxBase(Test): + def download_boot(self): self.log.debug('Looking for and selecting a qemu-img binary to be ' 'used to create the bootable snapshot image') # If qemu-img has been built, use it, otherwise the system wide one @@ -60,17 +46,17 @@ def prepare_boot(self): if image_arch == 'ppc64': image_arch = 'ppc64le' try: - self.boot = vmimage.get( + boot = vmimage.get( 'fedora', arch=image_arch, version='31', checksum=self.chksum, algorithm='sha256', cache_dir=self.cache_dirs[0], snapshot_dir=self.workdir) - self.vm.add_args('-drive', 'file=%s' % self.boot.path) except: self.cancel('Failed to download/prepare boot image') + return boot.path - def prepare_cloudinit(self): + def download_cloudinit(self): self.log.info('Preparing cloudinit image') try: cloudinit_iso = os.path.join(self.workdir, 'cloudinit.iso') @@ -81,9 +67,32 @@ def prepare_cloudinit(self): # QEMU's hard coded usermode router address phone_home_host='10.0.2.2', phone_home_port=self.phone_home_port) - self.vm.add_args('-drive', 'file=%s,format=raw' % cloudinit_iso) except Exception: self.cancel('Failed to prepared cloudinit image') + return cloudinit_iso + +class BootLinux(BootLinuxBase): + """ + Boots a Linux system, checking for a successful initialization + """ + + timeout = 900 + chksum = None + + def setUp(self): + super(BootLinux, self).setUp() + self.vm.add_args('-smp', '2') + self.vm.add_args('-m', '1024') + self.prepare_boot() + self.prepare_cloudinit() + + def prepare_boot(self): + path = self.download_boot() + self.vm.add_args('-drive', 'file=%s' % path) + + def prepare_cloudinit(self): + cloudinit_iso = self.download_cloudinit() + self.vm.add_args('-drive', 'file=%s,format=raw' % cloudinit_iso) def launch_and_wait(self): self.vm.set_console()