[PATCH V2] detect AWS arm virtual instance as kvm

Frank Liang xiliang at redhat.com
Tue Aug 9 03:00:58 UTC 2022


Hi Richard,

Do you have time to review this patch for the AWS arm instance to fix a
similar issue on GCP(2114997)? Thanks

Rgs,
Frank

On Wed, May 25, 2022 at 4:26 PM Frank Liang <xiliang at redhat.com> wrote:

> Thanks, Daniel
>
> Removed the outdated comments following your suggestion.
>
> Rgs,
> Frank
>
> On Wed, May 25, 2022 at 4:06 PM Daniel P. Berrangé <berrange at redhat.com>
> wrote:
>
>> On Wed, May 25, 2022 at 02:34:53PM +0800, Frank Liang wrote:
>> > Hello,
>> >
>> > aws arm virtual instances are running on top of Nitro
>> hypervisor(KVM-based
>> > hypervisor).
>> > I am proposing this patch to keep virt-what output consistent with x86
>> > virtual instances.
>> > Please review it. Thanks
>> >
>> > With this patch:
>> > $ sudo virt-what
>> > kvm
>> > aws
>> > $ cat /sys/devices/virtual/dmi/id/product_name
>> > t4g.small
>> >
>> > Without it:
>> > $ sudo virt-what
>> > aws
>> >
>> > Here is the test pass log with this patch.
>> > # cat test-suite.log
>> > ======================================================
>> >    virt-what 1.22: tests/aws-kvm-arm/test-suite.log
>> > ======================================================
>> >
>> > # TOTAL: 1
>> > # PASS:  1
>> > # SKIP:  0
>> > # XFAIL: 0
>> > # FAIL:  0
>> > # XPASS: 0
>> > # ERROR: 0
>> >
>> > .. contents:: :depth: 2
>> >
>> > Rgs,
>> > Frank
>>
>> > From 931e5f24b9e7e6e61cebe3213166bd691df80db0 Mon Sep 17 00:00:00 2001
>> > From: Xiao Liang <xiliang at redhat.com>
>> > Date: Tue, 24 May 2022 17:34:52 +0800
>> > Subject: [PATCH] detect AWS arm virtual instance as kvm
>> >
>> > AWS arm virtual instance is KVM based hypervisor.
>> > With this patch:
>> > $ sudo virt-what
>> > kvm
>> > aws
>> > $ cat /sys/devices/virtual/dmi/id/product_name
>> > t4g.small
>> >
>> > Without it:
>> > $ sudo virt-what
>> > aws
>> >
>> > Signed-off-by: Xiao Liang <xiliang at redhat.com>
>> > ---
>> >  tests/aws-kvm-arm/test.sh | 3 ++-
>> >  virt-what.in              | 5 +++++
>> >  2 files changed, 7 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/tests/aws-kvm-arm/test.sh b/tests/aws-kvm-arm/test.sh
>> > index 5d31995..d469a99 100755
>> > --- a/tests/aws-kvm-arm/test.sh
>> > +++ b/tests/aws-kvm-arm/test.sh
>> > @@ -18,7 +18,8 @@
>> >  output="$(PATH=../..:$PATH virt-what --test-root=. 2>&1)"
>> >  # XXX At the moment KVM cannot be detected on this platform.
>> >  # We hope to fix that, but for now the only fact printed is "aws".
>>
>> This comment looks outdated given the change you made
>>
>> > -expected="aws"
>> > +expected="kvm
>> > +aws"
>> >
>> >  if [ "$output" != "$expected" ]; then
>> >      echo "$0: test failed because output did not match expected"
>> > diff --git a/virt-what.in b/virt-what.in
>> > index b59714e..9afbd40 100644
>> > --- a/virt-what.in
>> > +++ b/virt-what.in
>> > @@ -339,6 +339,11 @@ if ! "$skip_qemu_kvm"; then
>> >              echo qemu
>> >              skip_lkvm=true
>> >          fi
>> > +        if echo "$dmi" | grep -q 'Amazon EC2' &&
>> > +            echo "$dmi" | grep -q 'System is a virtual machine'; then
>> > +            echo kvm
>> > +            skip_lkvm=true
>> > +        fi
>> >      elif [ -d ${root}/proc/device-tree/hypervisor ] &&
>> >           grep -q "linux,kvm" /proc/device-tree/hypervisor/compatible;
>> then
>> >          # We are running as a spapr KVM guest on ppc64
>> > --
>> > 2.36.1
>> >
>>
>>
>> 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 :|
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20220809/68b913c7/attachment.htm>


More information about the virt-tools-list mailing list