All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] lib/tst_virt.c: Add fallback when not using Microsoft Hyper-V hypervisor
@ 2021-06-10  4:02 Yang Xu
  2021-06-10  7:04 ` Krzysztof Kozlowski
  2021-06-10  7:22 ` Cyril Hrubis
  0 siblings, 2 replies; 5+ messages in thread
From: Yang Xu @ 2021-06-10  4:02 UTC (permalink / raw)
  To: ltp

If we don't use Microsoft Hyper-V hypervisorm, getrusage04 will report the
following error:
getrusage04    1  TBROK  :  tst_virt.c:175: invalid virt_type flag: 6
getrusage04    2  TBROK  :  tst_virt.c:175: Remaining cases broken

We should add is_hyperv() function when try_systemd_detect_virt returns -1.
But it is a bit complexd according to systemd-detect-virt implementation[1].
Microsoft Hyper-V hypervisor detection has been introduced since long time ago,
most system should support it.

[1]https://github.com/systemd/systemd/blob/main/src/basic/virt.c

Reported-by: Jinhui Huang <huangjh.jy@cn.fujitsu.com>
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 lib/tst_virt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/tst_virt.c b/lib/tst_virt.c
index 14c4d526c..d23d7f564 100644
--- a/lib/tst_virt.c
+++ b/lib/tst_virt.c
@@ -166,6 +166,7 @@ int tst_is_virt(int virt_type)
 	case VIRT_IBMZ_LPAR:
 	case VIRT_IBMZ_ZVM:
 		return is_ibmz(virt_type);
+	case VIRT_HYPERV:
 	case VIRT_OTHER:
 		return 0;
 	}
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [LTP] [PATCH] lib/tst_virt.c: Add fallback when not using Microsoft Hyper-V hypervisor
  2021-06-10  4:02 [LTP] [PATCH] lib/tst_virt.c: Add fallback when not using Microsoft Hyper-V hypervisor Yang Xu
@ 2021-06-10  7:04 ` Krzysztof Kozlowski
  2021-06-10  7:57   ` Petr Vorel
  2021-06-10  7:22 ` Cyril Hrubis
  1 sibling, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2021-06-10  7:04 UTC (permalink / raw)
  To: ltp

On 10/06/2021 06:02, Yang Xu wrote:
> If we don't use Microsoft Hyper-V hypervisorm, getrusage04 will report the

s/hypervisorm/hypervisor/

> following error:
> getrusage04    1  TBROK  :  tst_virt.c:175: invalid virt_type flag: 6
> getrusage04    2  TBROK  :  tst_virt.c:175: Remaining cases broken
> 
> We should add is_hyperv() function when try_systemd_detect_virt returns -1.
> But it is a bit complexd according to systemd-detect-virt implementation[1].

s/complexd/complex/

> Microsoft Hyper-V hypervisor detection has been introduced since long time ago,
> most system should support it.
> 
> [1]https://github.com/systemd/systemd/blob/main/src/basic/virt.c
> 
> Reported-by: Jinhui Huang <huangjh.jy@cn.fujitsu.com>
> Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>

Thanks for fixing this.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

Best regards,
Krzysztof

> ---
>  lib/tst_virt.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/tst_virt.c b/lib/tst_virt.c
> index 14c4d526c..d23d7f564 100644
> --- a/lib/tst_virt.c
> +++ b/lib/tst_virt.c
> @@ -166,6 +166,7 @@ int tst_is_virt(int virt_type)
>  	case VIRT_IBMZ_LPAR:
>  	case VIRT_IBMZ_ZVM:
>  		return is_ibmz(virt_type);
> +	case VIRT_HYPERV:
>  	case VIRT_OTHER:
>  		return 0;
>  	}
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP] [PATCH] lib/tst_virt.c: Add fallback when not using Microsoft Hyper-V hypervisor
  2021-06-10  4:02 [LTP] [PATCH] lib/tst_virt.c: Add fallback when not using Microsoft Hyper-V hypervisor Yang Xu
  2021-06-10  7:04 ` Krzysztof Kozlowski
@ 2021-06-10  7:22 ` Cyril Hrubis
  1 sibling, 0 replies; 5+ messages in thread
From: Cyril Hrubis @ 2021-06-10  7:22 UTC (permalink / raw)
  To: ltp

Hi!
> If we don't use Microsoft Hyper-V hypervisorm, getrusage04 will report the
> following error:
> getrusage04    1  TBROK  :  tst_virt.c:175: invalid virt_type flag: 6
> getrusage04    2  TBROK  :  tst_virt.c:175: Remaining cases broken
> 
> We should add is_hyperv() function when try_systemd_detect_virt returns -1.
> But it is a bit complexd according to systemd-detect-virt implementation[1].
> Microsoft Hyper-V hypervisor detection has been introduced since long time ago,
> most system should support it.

Sorry for missing this, Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP] [PATCH] lib/tst_virt.c: Add fallback when not using Microsoft Hyper-V hypervisor
  2021-06-10  7:04 ` Krzysztof Kozlowski
@ 2021-06-10  7:57   ` Petr Vorel
  2021-06-10  8:12     ` xuyang2018.jy
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2021-06-10  7:57 UTC (permalink / raw)
  To: ltp

Hi all,

> On 10/06/2021 06:02, Yang Xu wrote:
> > If we don't use Microsoft Hyper-V hypervisorm, getrusage04 will report the

> s/hypervisorm/hypervisor/
+1

> > following error:
> > getrusage04    1  TBROK  :  tst_virt.c:175: invalid virt_type flag: 6
> > getrusage04    2  TBROK  :  tst_virt.c:175: Remaining cases broken

> > We should add is_hyperv() function when try_systemd_detect_virt returns -1.
> > But it is a bit complexd according to systemd-detect-virt implementation[1].

> s/complexd/complex/
+1

Thanks!

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP] [PATCH] lib/tst_virt.c: Add fallback when not using Microsoft Hyper-V hypervisor
  2021-06-10  7:57   ` Petr Vorel
@ 2021-06-10  8:12     ` xuyang2018.jy
  0 siblings, 0 replies; 5+ messages in thread
From: xuyang2018.jy @ 2021-06-10  8:12 UTC (permalink / raw)
  To: ltp

Hi All
Thanks for your review. I have merged this patch with correcting two typos.

Best Regards
Yang Xu
> Hi all,
>
>> On 10/06/2021 06:02, Yang Xu wrote:
>>> If we don't use Microsoft Hyper-V hypervisorm, getrusage04 will report the
>
>> s/hypervisorm/hypervisor/
> +1
>
>>> following error:
>>> getrusage04    1  TBROK  :  tst_virt.c:175: invalid virt_type flag: 6
>>> getrusage04    2  TBROK  :  tst_virt.c:175: Remaining cases broken
>
>>> We should add is_hyperv() function when try_systemd_detect_virt returns -1.
>>> But it is a bit complexd according to systemd-detect-virt implementation[1].
>
>> s/complexd/complex/
> +1
>
> Thanks!
>
> Reviewed-by: Petr Vorel<pvorel@suse.cz>
>
> Kind regards,
> Petr

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-10  8:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10  4:02 [LTP] [PATCH] lib/tst_virt.c: Add fallback when not using Microsoft Hyper-V hypervisor Yang Xu
2021-06-10  7:04 ` Krzysztof Kozlowski
2021-06-10  7:57   ` Petr Vorel
2021-06-10  8:12     ` xuyang2018.jy
2021-06-10  7:22 ` Cyril Hrubis

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.