targetcontrol.py: use oe.types.boolean for QEMU_USE_KVM
v2 cover targetcontrol.py: use oe.types.boolean for QEMU_USE_KVM
The following changes since commit addf309165059a113a6d02ea5fb29a0f495c1485:
usbutils: remove uclibc-specific patch (2017-11-29 23:41:38 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib rbt/use_qemu
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/use_qemu
Robert Yang (1):
targetcontrol.py: use oe.types.boolean for QEMU_USE_KVM
meta/classes/testimage.bbclass | 2 +- meta/lib/oeqa/targetcontrol.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.7.4
PATCH v2 1/1 targetcontrol.py: use oe.types.boolean for QEMU_USE_KVM
So that both QEMU_USE_KVM = "True" and "1" will work.
[YOCTO #12343]
--- meta/classes/testimage.bbclass | 2 +- meta/lib/oeqa/targetcontrol.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
meta/classes/testimage.bbclass +1 -1
@@ -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:
meta/lib/oeqa/targetcontrol.py +1 -1
@@ -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:
Signature · 1 line
2.7.4
Quoted 38 lines · Robert Yang
So that both
QEMU_USE_KVM= "True" and "1" will work.[YOCTO #12343]
Signed-off-by Robert Yang <[email protected]>--- meta/classes/testimage.bbclass | 2 +- meta/lib/oeqa/targetcontrol.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)meta/classes/testimage. renamed from meta/classes/testimage.bbclass +0
-0bbclass
index 45bb2bd..7260ad4 100644meta/classes/testimage.bbclass +1
-1@@ -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:meta/lib/oeqa/targetcontrol. renamed from meta/lib/oeqa/targetcontrol.py +0
-0py
index f63936c..3fc3870 100644meta/lib/oeqa/targetcontrol.py +1
-1@@ -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
Quoted 2 lines
else:
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
Ross
Quoted 42 lines · Ross
On 1 December 2017 at 05:13, Robert Yang <[email protected] <mailto:[email protected]>> wrote:
So that both QEMU_USE_KVM = "True" and "1" will work. [YOCTO #12343] Signed-off-by: Robert Yang <[email protected] <mailto:[email protected]>> --- 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:
Quoted 6 lines
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" ind.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.
// Robert
Quoted 2 lines
Ross
Quoted 47 lines · Robert Yang
Quoted 45 lines · Ross
On 1 December 2017 at 05:13, Robert Yang <[email protected] <mailto:[email protected]>> wrote:
So that both
QEMU_USE_KVM= "True" and "1" will work.[YOCTO #12343]
Signed-off-by Robert Yang <[email protected]<mailto:[email protected]>>
---
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 @@ deftestimage_main(d):
# Getuse_kvm
qemu_use_kvm =d.getVar("QEMU_USE_KVM")
ifqemu_use_kvmand \
- (qemu_use_kvm == 'True' and 'x86' in machine or \
+ (oe.types.boolean(qemu_use_kvm) and 'x86' in machine or \
d.getVar('MACHINE') inqemu_use_kvm.split()):
kvm = True
else:
diff --gita/meta/lib/oeqa/targetcontrol.pyb/meta/lib/oeqa/targetcontrol.pyindex 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")
ifqemu_use_kvmand \
- (qemu_use_kvm == "True" and "x86" ind.getVar("MACHINE")or \
+ (oe.types.boolean(qemu_use_kvm) and "x86" ind.getVar("MACHINE")or \
d.getVar("MACHINE") inqemu_use_kvm.split()):
use_kvm = True
else:
Quoted 6 lines
Quoted 3 lines
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" ind.getVar("MACHINE")or \
UnboundLocalError: local variable 'oe' referenced before assignmentSorry, 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
Quoted 5 lines
// Robert
Quoted 2 lines
Ross
Hi Ross,
Quoted 54 lines · Robert Yang
Quoted 51 lines · Robert Yang
Quoted 48 lines · Ross
On 1 December 2017 at 05:13, Robert Yang <[email protected] <mailto:[email protected]>> wrote:
So that both
QEMU_USE_KVM= "True" and "1" will work.[YOCTO #12343]
Signed-off-by Robert Yang <[email protected]<mailto:[email protected]>>
---
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 @@ deftestimage_main(d):
# Getuse_kvm
qemu_use_kvm =d.getVar("QEMU_USE_KVM")
ifqemu_use_kvmand \
- (qemu_use_kvm == 'True' and 'x86' in machine or \
+ (oe.types.boolean(qemu_use_kvm) and 'x86' in machine or \
d.getVar('MACHINE') inqemu_use_kvm.split()):
kvm = True
else:
diff --gita/meta/lib/oeqa/targetcontrol.pyb/meta/lib/oeqa/targetcontrol.pyindex 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")
ifqemu_use_kvmand \
- (qemu_use_kvm == "True" and "x86" ind.getVar("MACHINE")or \
+ (oe.types.boolean(qemu_use_kvm) and "x86" ind.getVar("MACHINE")or \
d.getVar("MACHINE") inqemu_use_kvm.split()):
use_kvm = True
else: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" ind.getVar("MACHINE")or \
UnboundLocalError: local variable 'oe' referenced before assignment
Quoted 7 lines
Quoted 2 lines
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" tocon/local.conf$ oe-selftest -r devtool.DevtoolTests.test_devtool_deploy_target
I fixed it in the repo:
git://git.openembedded.org/openembedded-core-contrib rbt/use_qemu
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/use_qemu
Robert Yang (1):
targetcontrol.py: use oe.types.boolean for QEMU_USE_KVM
meta/classes/testimage.bbclass +1 -1
@@ -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:
meta/lib/oeqa/targetcontrol.py +3 -1
@@ -91,6 +91,8 @@ class QemuTarget(BaseTarget): def __init__(self, d, logger, image_fstype=None): + import oe.types + super(QemuTarget, self).__init__(d, logger) self.rootfs = ''
@@ -107,7 +109,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:
// Robert
Quoted 8 lines
// Robert
Quoted 5 lines
// Robert
Quoted 2 lines
Ross