Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] oeqa: drop support of listing machines in QEMU_USE_KVM
@ 2018-12-05  9:34 Chen Qi
  2018-12-05  9:34 ` [PATCH 1/1] " Chen Qi
  0 siblings, 1 reply; 3+ messages in thread
From: Chen Qi @ 2018-12-05  9:34 UTC (permalink / raw)
  To: openembedded-core

Hi Yeoh Ee Peng,

meta/lib/oeqa/manual/bsp-qemu.json might need to be modified after this patch.
But I don't know how it is used. Could you please help take care of it?

Best Regards,
Chen Qi

The following changes since commit 016e3dda2d6acc9b457079d11b5346a5352a431d:

  btrfs-tools: update to 4.19 (2018-12-03 12:20:01 +0000)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib ChenQi/qemu_use_kvm
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/qemu_use_kvm

Chen Qi (1):
  oeqa: drop support of listing machines in QEMU_USE_KVM

 meta/classes/testimage.bbclass | 12 ++++++------
 meta/lib/oeqa/targetcontrol.py | 12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)

-- 
1.9.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] oeqa: drop support of listing machines in QEMU_USE_KVM
  2018-12-05  9:34 [PATCH 0/1] oeqa: drop support of listing machines in QEMU_USE_KVM Chen Qi
@ 2018-12-05  9:34 ` Chen Qi
  2018-12-05 17:53   ` Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Chen Qi @ 2018-12-05  9:34 UTC (permalink / raw)
  To: openembedded-core

We want QEMU_USE_KVM to only set to some boolean value, with possible
MACHINE override. Drop the support of listing machines in this variable,
and give users error message if they still do so.

Error message below is an example.

ERROR: core-image-minimal-1.0-r0 do_testimage: Invalid boolean value 'intel-corei7-64 intel-core2-32 qemux86 qemux86-64'
QEMU_USE_KVM needs to be set to a boolean value. It no longer supports accepting a list of machines.
  e.g.
    QEMU_USE_KVM_qemux86-64 = '1'
    ERROR: core-image-minimal-1.0-r0 do_testimage: Function failed: do_testimage

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/classes/testimage.bbclass | 12 ++++++------
 meta/lib/oeqa/targetcontrol.py | 12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 82cbb06..7c3bc0a 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -229,12 +229,12 @@ def testimage_main(d):
 
     # Get use_kvm
     qemu_use_kvm = d.getVar("QEMU_USE_KVM")
-    if qemu_use_kvm and \
-       (d.getVar('MACHINE') in qemu_use_kvm.split() or \
-        oe.types.boolean(qemu_use_kvm) and 'x86' in machine):
-        kvm = True
-    else:
-        kvm = False
+    try:
+        kvm = oe.types.boolean(qemu_use_kvm)
+    except ValueError as e:
+        bb.fatal("%s\nQEMU_USE_KVM needs to be set to a boolean value. It no longer supports accepting a list of machines.\n"
+                 "  e.g.\n"
+                 "  QEMU_USE_KVM_qemux86-64 = '1'" % e)
 
     slirp = False
     if d.getVar("QEMU_USE_SLIRP"):
diff --git a/meta/lib/oeqa/targetcontrol.py b/meta/lib/oeqa/targetcontrol.py
index 59a9c35..158a8b0 100644
--- a/meta/lib/oeqa/targetcontrol.py
+++ b/meta/lib/oeqa/targetcontrol.py
@@ -108,12 +108,12 @@ 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 \
-           (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:
-            use_kvm = False
+        try:
+            use_kvm = oe.types.boolean(qemu_use_kvm)
+        except ValueError as e:
+            bb.fatal("%s\nQEMU_USE_KVM needs to be set to a boolean value. It no longer supports accepting a list of machines.\n"
+                     "  e.g.\n"
+                     "  QEMU_USE_KVM_qemux86-64 = '1'" % e)
 
         # Log QemuRunner log output to a file
         import oe.path
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] oeqa: drop support of listing machines in QEMU_USE_KVM
  2018-12-05  9:34 ` [PATCH 1/1] " Chen Qi
@ 2018-12-05 17:53   ` Richard Purdie
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2018-12-05 17:53 UTC (permalink / raw)
  To: Chen Qi, openembedded-core

On Wed, 2018-12-05 at 17:34 +0800, Chen Qi wrote:
> We want QEMU_USE_KVM to only set to some boolean value, with possible
> MACHINE override. Drop the support of listing machines in this
> variable,
> and give users error message if they still do so.
> 
> Error message below is an example.
> 
> ERROR: core-image-minimal-1.0-r0 do_testimage: Invalid boolean value
> 'intel-corei7-64 intel-core2-32 qemux86 qemux86-64'
> QEMU_USE_KVM needs to be set to a boolean value. It no longer
> supports accepting a list of machines.
>   e.g.
>     QEMU_USE_KVM_qemux86-64 = '1'
>     ERROR: core-image-minimal-1.0-r0 do_testimage: Function failed:
> do_testimage
> 
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  meta/classes/testimage.bbclass | 12 ++++++------
>  meta/lib/oeqa/targetcontrol.py | 12 ++++++------
>  2 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/meta/classes/testimage.bbclass
> b/meta/classes/testimage.bbclass
> index 82cbb06..7c3bc0a 100644
> --- a/meta/classes/testimage.bbclass
> +++ b/meta/classes/testimage.bbclass
> @@ -229,12 +229,12 @@ def testimage_main(d):
>  
>      # Get use_kvm
>      qemu_use_kvm = d.getVar("QEMU_USE_KVM")
> -    if qemu_use_kvm and \
> -       (d.getVar('MACHINE') in qemu_use_kvm.split() or \
> -        oe.types.boolean(qemu_use_kvm) and 'x86' in machine):
> -        kvm = True
> -    else:
> -        kvm = False
> +    try:
> +        kvm = oe.types.boolean(qemu_use_kvm)
> +    except ValueError as e:
> +        bb.fatal("%s\nQEMU_USE_KVM needs to be set to a boolean
> value. It no longer supports accepting a list of machines.\n"
> +                 "  e.g.\n"
> +                 "  QEMU_USE_KVM_qemux86-64 = '1'" % e)

This drops the x86 piece above. The autobuilder sets:

QEMU_USE_KVM = "True"

which then fails for say qemuarm.

The x86 check is incorrect anyway, it needs to check the BUILD_ARCH is
compatible with TARGET_ARCH.

We can't quite merge this as is though due to the autobuilder breakage.

Cheers,

Richard



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-05 17:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-05  9:34 [PATCH 0/1] oeqa: drop support of listing machines in QEMU_USE_KVM Chen Qi
2018-12-05  9:34 ` [PATCH 1/1] " Chen Qi
2018-12-05 17:53   ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox