[OE-core] [PATCH 01/10] oeqa/targetcontrol.py: simplify checking for qemu_use_kvm

Richard Purdie richard.purdie at linuxfoundation.org
Tue Aug 8 15:30:46 UTC 2017


On Mon, 2017-07-31 at 02:50 -0700, Robert Yang wrote:
> The "if qemu_use_kvm" is not needed.
> 
> Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
> ---
>  meta/lib/oeqa/targetcontrol.py | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/lib/oeqa/targetcontrol.py
> b/meta/lib/oeqa/targetcontrol.py
> index 3255e3a5c63..11e6c820e85 100644
> --- a/meta/lib/oeqa/targetcontrol.py
> +++ b/meta/lib/oeqa/targetcontrol.py
> @@ -132,9 +132,8 @@ class QemuTarget(BaseTarget):
>          dump_host_cmds = d.getVar("testimage_dump_host")
>          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 \
> -            d.getVar("MACHINE") in qemu_use_kvm.split()):
> +        if qemu_use_kvm == "True" and "x86" in d.getVar("MACHINE") or \
> +            d.getVar("MACHINE") in qemu_use_kvm.split():
>              use_kvm = True
>          else:
>              use_kvm = False
> 

It is needed since qemu_use_kvm could be None and None.split() will
cause an error.

Cheers,

Richard



More information about the Openembedded-core mailing list