From: "Alex Bennée" <alex.bennee@linaro.org>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>, Cleber Rosa <crosa@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v1 14/14] scripts/qemu.py: allow arches use KVM for their 32bit cousins
Date: Sat, 26 Jan 2019 07:37:45 +0000 [thread overview]
Message-ID: <CAHDbmO38Z48eypv2b5R-+6huSY0zzzBGMrPb3+w5QQDo_o1gtw@mail.gmail.com> (raw)
In-Reply-To: <20190126033712.GQ4136@habkost.net>
Good point. I should fall through.
On Sat, 26 Jan 2019, 03:37 Eduardo Habkost <ehabkost@redhat.com wrote:
> On Fri, Jan 25, 2019 at 02:00:17PM +0000, Alex Bennée wrote:
> > A lot of architectures can run their 32 bit cousins on KVM so the
> > kvm_available function needs to be a little less restricting when
> > deciding if KVM is available.
> >
> > Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> > ---
> > scripts/qemu.py | 11 ++++++++++-
> > 1 file changed, 10 insertions(+), 1 deletion(-)
> >
> > diff --git a/scripts/qemu.py b/scripts/qemu.py
> > index 0a5e02eb56..2934ee12c5 100644
> > --- a/scripts/qemu.py
> > +++ b/scripts/qemu.py
> > @@ -25,9 +25,18 @@ import tempfile
> >
> > LOG = logging.getLogger(__name__)
> >
> > +# Mapping host architecture to any additional architectures it can
> > +# support which often includes its 32 bit cousin.
> > +ADDITIONAL_ARCHES = {
> > + "x86_64" : "i386",
> > + "aarch64" : "armhf"
> > +}
> >
> > def kvm_available(target_arch=None):
> > - if target_arch and target_arch != os.uname()[4]:
> > + host_arch = os.uname()[4]
> > + if target_arch and target_arch != host_arch:
> > + if target_arch == ADDITIONAL_ARCHES[host_arch]:
>
> This will crash host_arch isn't "x86_64" or "aarch64". I suggest
> ADDITIONAL_ARCHES.get(host_arch)
>
> > + return True
>
> I don't think we should skip the /dev/kvm check here.
>
>
> > return False
> > return os.access("/dev/kvm", os.R_OK | os.W_OK)
> >
> > --
> > 2.17.1
> >
>
> --
> Eduardo
>
next prev parent reply other threads:[~2019-01-26 7:38 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-25 14:00 [Qemu-devel] [PATCH v1 00/14] testing/next (binfmt_misc, vm-build and BSD CI) Alex Bennée
2019-01-25 14:00 ` [Qemu-devel] [PATCH v1 01/14] .cirrus.yml: basic compile and test for FreeBSD Alex Bennée
2019-01-25 14:00 ` [Qemu-devel] [PATCH v1 02/14] travis: stop requesting libffi & gettext from homebrew Alex Bennée
2019-01-25 14:00 ` [Qemu-devel] [PATCH v1 03/14] MAINTAINERS: Add an entry for scripts/archive-source.sh Alex Bennée
2019-01-25 14:00 ` [Qemu-devel] [PATCH v1 04/14] archive-source.sh: Clone the submodules locally Alex Bennée
2019-01-30 15:11 ` Daniel P. Berrangé
2019-01-25 14:00 ` [Qemu-devel] [PATCH v1 05/14] docker: disable Xen on CentOS 7 Alex Bennée
2019-01-25 14:04 ` Paolo Bonzini
2019-01-25 15:26 ` Alex Bennée
2019-01-25 15:27 ` Paolo Bonzini
2019-01-25 14:00 ` [Qemu-devel] [PATCH v1 06/14] tests: make docker.py update use configured binfmt path Alex Bennée
2019-01-25 14:00 ` [Qemu-devel] [PATCH v1 07/14] tests: make docker.py check for persistent configs Alex Bennée
2019-01-25 14:00 ` [Qemu-devel] [PATCH v1 08/14] tests: docker.py be even smarter with persistent binfmt_misc Alex Bennée
2019-01-25 14:00 ` [Qemu-devel] [PATCH v1 09/14] tests: PEP8 cleanup of docker.py, mostly white space Alex Bennée
2019-01-25 14:00 ` [Qemu-devel] [PATCH v1 10/14] tests/vm: move images to $HOME/.cache/qemu-vm/images Alex Bennée
2019-01-25 14:00 ` [Qemu-devel] [PATCH v1 11/14] tests/vm: call make check directly for netbsd/freebsd/ubuntu.i386 Alex Bennée
2019-01-31 11:03 ` Philippe Mathieu-Daudé
2019-01-25 14:00 ` [Qemu-devel] [PATCH v1 12/14] tests/vm: add --build-target option Alex Bennée
2019-01-31 11:02 ` Philippe Mathieu-Daudé
2019-01-25 14:00 ` [Qemu-devel] [PATCH v1 13/14] tests/vm: expose BUILD_TARGET, TARGET_LIST and EXTRA_CONFIGURE_OPTS Alex Bennée
2019-01-31 11:03 ` Philippe Mathieu-Daudé
2019-01-25 14:00 ` [Qemu-devel] [PATCH v1 14/14] scripts/qemu.py: allow arches use KVM for their 32bit cousins Alex Bennée
2019-01-26 3:37 ` Eduardo Habkost
2019-01-26 7:37 ` Alex Bennée [this message]
2019-02-01 5:02 ` [Qemu-devel] [PATCH v1 00/14] testing/next (binfmt_misc, vm-build and BSD CI) no-reply
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=CAHDbmO38Z48eypv2b5R-+6huSY0zzzBGMrPb3+w5QQDo_o1gtw@mail.gmail.com \
--to=alex.bennee@linaro.org \
--cc=crosa@redhat.com \
--cc=ehabkost@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).