* [PATCH 0/1] targetcontrol.py: make QEMU_USE_KVM = "1" work @ 2017-11-14 6:57 Robert Yang 2017-11-14 6:57 ` [PATCH 1/1] " Robert Yang 0 siblings, 1 reply; 4+ messages in thread From: Robert Yang @ 2017-11-14 6:57 UTC (permalink / raw) To: openembedded-core The following changes since commit a17f3ec910366e9e7551fa24fbc07929b9584341: dhcp: fix build issue with libxml2 support (2017-11-10 14:44:31 +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: make QEMU_USE_KVM = "1" work meta/classes/testimage.bbclass | 2 +- meta/lib/oeqa/targetcontrol.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1] targetcontrol.py: make QEMU_USE_KVM = "1" work 2017-11-14 6:57 [PATCH 0/1] targetcontrol.py: make QEMU_USE_KVM = "1" work Robert Yang @ 2017-11-14 6:57 ` Robert Yang 2017-11-30 10:57 ` Burton, Ross 0 siblings, 1 reply; 4+ messages in thread From: Robert Yang @ 2017-11-14 6:57 UTC (permalink / raw) To: openembedded-core It only could be set to "True", which was not common in oe, e.g.: * Works QEMU_USE_KVM = "True" * Didn't work, this would surprise user. QEMU_USE_KVM = "1" Make it work with both 1 and True now, the "True" is for compatibility. [YOCTO #12343] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> --- 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..66b4baf 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 \ + (qemu_use_kvm in ('True', '1') 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..1625569 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 \ + (qemu_use_kvm in ("True", "1") and "x86" in d.getVar("MACHINE") or \ d.getVar("MACHINE") in qemu_use_kvm.split()): use_kvm = True else: -- 2.7.4 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] targetcontrol.py: make QEMU_USE_KVM = "1" work 2017-11-14 6:57 ` [PATCH 1/1] " Robert Yang @ 2017-11-30 10:57 ` Burton, Ross 2017-12-01 5:06 ` Robert Yang 0 siblings, 1 reply; 4+ messages in thread From: Burton, Ross @ 2017-11-30 10:57 UTC (permalink / raw) To: Robert Yang; +Cc: OE-core [-- Attachment #1: Type: text/plain, Size: 2422 bytes --] There are two neater ways of doing this: 1) oe.types.boolean() which handles all the common aliases for true or false. 2)bitbake typed variables. Do QEMU_USE_KVM[type]="boolean" where it gets a default value, and then use oe.data.typed_value('QEMU_USE_KVM', d) to get the value. Both ways move the actual value parsing to dedicated code so its less error prone and more consistent. Ross On 14 November 2017 at 06:57, Robert Yang <liezhi.yang@windriver.com> wrote: > It only could be set to "True", which was not common in oe, e.g.: > * Works > QEMU_USE_KVM = "True" > > * Didn't work, this would surprise user. > QEMU_USE_KVM = "1" > > Make it work with both 1 and True now, the "True" is for compatibility. > > [YOCTO #12343] > > Signed-off-by: Robert Yang <liezhi.yang@windriver.com> > --- > 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..66b4baf 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 \ > + (qemu_use_kvm in ('True', '1') 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..1625569 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 \ > + (qemu_use_kvm in ("True", "1") and "x86" in > d.getVar("MACHINE") or \ > d.getVar("MACHINE") in qemu_use_kvm.split()): > use_kvm = True > else: > -- > 2.7.4 > > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core > [-- Attachment #2: Type: text/html, Size: 3614 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] targetcontrol.py: make QEMU_USE_KVM = "1" work 2017-11-30 10:57 ` Burton, Ross @ 2017-12-01 5:06 ` Robert Yang 0 siblings, 0 replies; 4+ messages in thread From: Robert Yang @ 2017-12-01 5:06 UTC (permalink / raw) To: Burton, Ross; +Cc: OE-core On 11/30/2017 06:57 PM, Burton, Ross wrote: > There are two neater ways of doing this: > > 1) oe.types.boolean() which handles all the common aliases for true or false. > 2)bitbake typed variables. Do QEMU_USE_KVM[type]="boolean" where it gets a > default value, and then use oe.data.typed_value('QEMU_USE_KVM', d) to get the value. > > Both ways move the actual value parsing to dedicated code so its less error > prone and more consistent. Thanks, make sense, I will send V2 which uses oe.types.boolean(). // Robert > > Ross > > On 14 November 2017 at 06:57, Robert Yang <liezhi.yang@windriver.com > <mailto:liezhi.yang@windriver.com>> wrote: > > It only could be set to "True", which was not common in oe, e.g.: > * Works > QEMU_USE_KVM = "True" > > * Didn't work, this would surprise user. > QEMU_USE_KVM = "1" > > Make it work with both 1 and True now, the "True" is for compatibility. > > [YOCTO #12343] > > Signed-off-by: Robert Yang <liezhi.yang@windriver.com > <mailto:liezhi.yang@windriver.com>> > --- > 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..66b4baf 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 \ > + (qemu_use_kvm in ('True', '1') 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..1625569 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 \ > + (qemu_use_kvm in ("True", "1") and "x86" in d.getVar("MACHINE") or \ > d.getVar("MACHINE") in qemu_use_kvm.split()): > use_kvm = True > else: > -- > 2.7.4 > > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > <mailto:Openembedded-core@lists.openembedded.org> > http://lists.openembedded.org/mailman/listinfo/openembedded-core > <http://lists.openembedded.org/mailman/listinfo/openembedded-core> > > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-12-01 5:06 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-11-14 6:57 [PATCH 0/1] targetcontrol.py: make QEMU_USE_KVM = "1" work Robert Yang 2017-11-14 6:57 ` [PATCH 1/1] " Robert Yang 2017-11-30 10:57 ` Burton, Ross 2017-12-01 5:06 ` Robert Yang
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox