Return-Path: Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by mail.openembedded.org (Postfix) with ESMTP id 9B0117858B for ; Wed, 6 Dec 2017 03:11:24 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail.windriver.com (8.15.2/8.15.1) with ESMTPS id vB63BPwU029881 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 5 Dec 2017 19:11:25 -0800 (PST) Received: from localhost.corp.ad.wrs.com (128.224.162.229) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.361.1; Tue, 5 Dec 2017 19:11:24 -0800 To: "Burton, Ross" References: <2b4e2875e667df753c33418eefc437d9d0da6216.1512104695.git.liezhi.yang@windriver.com> <0c0d8839-930b-4124-bab8-58e33274c8af@windriver.com> From: Robert Yang Message-ID: Date: Wed, 6 Dec 2017 11:11:00 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <0c0d8839-930b-4124-bab8-58e33274c8af@windriver.com> Cc: OE-core Subject: Re: [PATCH 1/1 V2] targetcontrol.py: use oe.types.boolean for QEMU_USE_KVM X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Dec 2017 03:11:24 -0000 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit On 12/06/2017 09:37 AM, Robert Yang wrote: > > On 12/06/2017 12:10 AM, Burton, Ross wrote: >> On 1 December 2017 at 05:13, Robert Yang > > wrote: >> >>     So that both QEMU_USE_KVM = "True" and "1" will work. >> >>     [YOCTO #12343] >> >>     Signed-off-by: Robert Yang >     > >>     --- >>       meta/classes/testimage.bbclass | 2 +- >>       meta/lib/oeqa/targetcontrol.py | 2 +- >>       2 files changed, 2 insertions(+), 2 deletions(-) >> >>     diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass >>     index 45bb2bd..7260ad4 100644 >>     --- a/meta/classes/testimage.bbclass >>     +++ b/meta/classes/testimage.bbclass >>     @@ -215,7 +215,7 @@ def testimage_main(d): >>           # Get use_kvm >>           qemu_use_kvm = d.getVar("QEMU_USE_KVM") >>           if qemu_use_kvm and \ >>     -       (qemu_use_kvm == 'True' and 'x86' in machine or \ >>     +       (oe.types.boolean(qemu_use_kvm) and 'x86' in machine or \ >>               d.getVar('MACHINE') in qemu_use_kvm.split()): >>               kvm = True >>           else: >>     diff --git a/meta/lib/oeqa/targetcontrol.py b/meta/lib/oeqa/targetcontrol.py >>     index f63936c..3fc3870 100644 >>     --- a/meta/lib/oeqa/targetcontrol.py >>     +++ b/meta/lib/oeqa/targetcontrol.py >>     @@ -107,7 +107,7 @@ class QemuTarget(BaseTarget): >>               dump_dir = d.getVar("TESTIMAGE_DUMP_DIR") >>               qemu_use_kvm = d.getVar("QEMU_USE_KVM") >>               if qemu_use_kvm and \ >>     -           (qemu_use_kvm == "True" and "x86" in d.getVar("MACHINE") or \ >>     +           (oe.types.boolean(qemu_use_kvm) and "x86" in d.getVar("MACHINE") >>     or \ >>                   d.getVar("MACHINE") in qemu_use_kvm.split()): >>                   use_kvm = True >>               else: >> >> >> https://autobuilder.yocto.io/builders/nightly-oe-selftest/builds/665/steps/Running%20oe-selftest/logs/stdio >> >> >>    File >> "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/targetcontrol.py", >> line 110, in __init__ >>      (oe.types.boolean(qemu_use_kvm) and "x86" in d.getVar("MACHINE") or \ >> UnboundLocalError: local variable 'oe' referenced before assignment > > Sorry, I had tried testimage and oe-selftest before and just now locally, > didn't see this error, need more investigations. I can reproduce it now: Add QEMU_USE_KVM = "1" to con/local.conf $ oe-selftest -r devtool.DevtoolTests.test_devtool_deploy_target // Robert > > // Robert > >> >> Ross