All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mathieu Dubois-Briand" <mathieu.dubois-briand@bootlin.com>
To: <antonin.godard@bootlin.com>, <openembedded-core@lists.openembedded.org>
Cc: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>
Subject: Re: [OE-core] [PATCH 05/13] lib/oe: move oe.types.{is_x86,qemu_use_kvm} to oe.qemu
Date: Tue, 17 Nov 2026 11:09:47 +0100	[thread overview]
Message-ID: <DMXEK4LWEZJH.2MIWDYR9RRMC7@bootlin.com> (raw)
In-Reply-To: <20261116-oe-lib-docstrings-v1-5-0c894f6a1064@bootlin.com>

On Mon Nov 16, 2026 at 5:09 PM CET, Antonin Godard via openembedded-core wrote:
> The oe.types library represents OpenEmbedded types such as booleans,
> integers, etc. which is unrelated to what these two functions do:
> is_x86() checks if a given arch matches the x86 architecture, and
> qemu_use_kvm() is used to return True to enable KVM based on the current
> target architecture.
>
> Move these two functions to oe.qemu which is more appropriate. Adapt
> usage in OE-Core as a consequence.
>
> Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
> ---

Hi Antonin,

Thanks for your patch.


> --- a/meta/lib/oe/qemu.py
> +++ b/meta/lib/oe/qemu.py
> @@ -52,3 +52,27 @@ def qemu_run_binary(d, rootfs_path, binary):
>      base_libdir = rootfs_path + d.getVar("base_libdir", False)
>  
>      return qemu_wrapper_cmdline(d, rootfs_path, [libdir, base_libdir]) + rootfs_path + binary
> +
> +def is_x86(arch):
> +    """
> +    Check whether ``arch`` is ``x86`` or ``x86_64``, return ``True`` if it is,
> +    ``False`` otherwise.
> +    """
> +    if arch.startswith('x86_') or re.match('i.*86', arch):
> +        return True
> +    else:
> +        return False
> +
> +def qemu_use_kvm(kvm, target_arch):
> +    """
> +    Enable kvm if target_arch == build_arch or both of them are x86 archs.
> +    """
> +
> +    use_kvm = False
> +    if kvm and boolean(kvm):

Missing import of oe.types here? We are probably also missing os and re.

https://autobuilder.yoctoproject.org/valkyrie/#/builders/50/builds/5078
https://autobuilder.yoctoproject.org/valkyrie/#/builders/95/builds/4956

Thanks,
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


  reply	other threads:[~2026-11-17 10:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 16:08 [PATCH 00/13] Improve or add oe.* library docstrings Antonin Godard
2026-11-16 16:08 ` [PATCH 01/13] lib/oe/path: rename "metadata" parameter to "d" Antonin Godard
2026-11-16 16:09 ` [PATCH 02/13] oe/path: simplify replace_absolute_symlinks() signature Antonin Godard
2026-11-16 16:09 ` [PATCH 03/13] lib/oe/utils: simplify str_filter*() signatures Antonin Godard
2026-11-16 16:09 ` [PATCH 04/13] lib/oe/utils: drop all_multilib_tune_list Antonin Godard
2026-11-16 16:09 ` [PATCH 05/13] lib/oe: move oe.types.{is_x86,qemu_use_kvm} to oe.qemu Antonin Godard
2026-11-17 10:09   ` Mathieu Dubois-Briand [this message]
2026-11-16 16:09 ` [PATCH 06/13] lib/oe/data: improve docstring for typed_value Antonin Godard
2026-11-16 16:09 ` [PATCH 07/13] lib/oe/go: detail map_arch() parameter Antonin Godard
2026-11-16 16:09 ` [PATCH 08/13] lib/oe/kernel: convert comments to docstrings and improve Antonin Godard
2026-11-16 16:09 ` [PATCH 09/13] lib/oe/lsb: improve docstrings Antonin Godard
2026-11-16 16:09 ` [PATCH 10/13] lib/oe/path: " Antonin Godard
2026-11-16 16:09 ` [PATCH 11/13] lib/oe/purl: " Antonin Godard
2026-11-16 16:09 ` [PATCH 12/13] lib/oe/utils: " Antonin Godard
2026-11-16 16:09 ` [PATCH 13/13] lib/oe/types: " Antonin Godard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DMXEK4LWEZJH.2MIWDYR9RRMC7@bootlin.com \
    --to=mathieu.dubois-briand@bootlin.com \
    --cc=antonin.godard@bootlin.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.