From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] Add env variable as workaround for test issues in VMs
Date: Mon, 27 Apr 2020 05:06:58 -0400 (EDT) [thread overview]
Message-ID: <96306598.10298812.1587978418983.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CAEemH2daE69UT7mFGXOFQaj3bjqq8CRJr6bnhssyK3_7JPdHng@mail.gmail.com>
----- Original Message -----
> On Mon, Apr 27, 2020 at 3:31 PM Jan Stancek <jstancek@redhat.com> wrote:
>
> >
> >
> > ----- Original Message -----
> > > Hi Martin,
> > >
> > > > Timer tests often fail on sleep overrun when LTP is running inside a
> > VM.
> > > > The main cause is usually that the VM doesn't get enough CPU time to
> > wake
> > > > up
> > > > the test process in time.
> > > Cannot we detect presence of "hypervisor" in flags in /proc/cpuinfo?
> > > I though it was quite reliable for detecting VM.
> >
> > We have tst_is_virt().
> >
>
> I take a rough look and doubt there is a bug in try_systemd_detect_virt().
> Shouldn't strncmp() return zero the 'kvm'/'xen' is found? I guess they
> wanted:
Yes, that looks like bug.
>
> --- a/lib/tst_virt.c
> +++ b/lib/tst_virt.c
> @@ -93,10 +93,10 @@ static int try_systemd_detect_virt(void)
> if (ret)
> return 0;
>
> - if (strncmp("kvm", virt_type, 3))
> + if (!strncmp("kvm", virt_type, 3))
> return VIRT_KVM;
>
> - if (strncmp("xen", virt_type, 3))
> + if (!strncmp("xen", virt_type, 3))
> return VIRT_XEN;
>
> return 0;
>
> Apart from that two(kvm/xen) , we need to detect more virtualization tech
> for ppc/s390 I think.
We could return VIRT_OTHER by default. We don't really need to
differentiate which one it is for purpose of this patch.
next prev parent reply other threads:[~2020-04-27 9:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-24 15:04 [LTP] [PATCH] Add env variable as workaround for test issues in VMs Martin Doucha
2020-04-27 5:31 ` Petr Vorel
2020-04-27 7:31 ` Jan Stancek
2020-04-27 7:41 ` Petr Vorel
2020-04-27 8:49 ` Li Wang
2020-04-27 9:06 ` Jan Stancek [this message]
2020-04-27 9:19 ` Petr Vorel
2020-04-27 9:23 ` Martin Doucha
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=96306598.10298812.1587978418983.JavaMail.zimbra@redhat.com \
--to=jstancek@redhat.com \
--cc=ltp@lists.linux.it \
/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