qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting qemu from guest on arm/hvf (apple arm)


From: Daniel P . Berrangé
Subject: Re: Detecting qemu from guest on arm/hvf (apple arm)
Date: Tue, 21 Feb 2023 10:06:32 +0000
User-agent: Mutt/2.2.9 (2022-11-12)

On Wed, Feb 15, 2023 at 03:48:46PM -0800, John-Mark Gurney wrote:
> Hello,
> 
> I was wondering what the best way to detect that FreeBSD is running
> under qemu/hvf on Apple ARM?  FreeBSD doesn't see the ACPI FADT table,
> so I'm wondering if keying off of something like the QEMU0002 device
> in ACPI is the best way?  Or is there another option?

Aside from Peter's suggestion to check for actual features that
matter, if you genuinely need to detect a specific platform,
the virt-what tool is generally what I point people to. It has
loads of checks in it. It can detect QEMU on aarch64, but doesn't
distinguish KVM unless SMBIOS is present too. The 'virt' machine
type will include SMBIOS, so I expect the KVM check will probably
trigger for HVF too.

  
http://git.annexia.org/?p=virt-what.git;a=blob;f=virt-what.in;h=01e9acaf689416d9bff6eaca1b849dc4e798a0af;hb=HEAD#l340

This is wrong from virt-what POV, but I presume for your needs,
you'd be happy to detect *any* hypervisor as you'll want to tweak
the clock frequency for both HVF and KVM VMs

If you do come up with any tweaks to it, patches would be welcome.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




reply via email to

[Prev in Thread] Current Thread [Next in Thread]