* [LTP] [PATCH] lib/tst_virt: rename is_kvm to is_qemu
@ 2015-03-03 1:35 Wei,Jiangang
2015-03-03 1:57 ` Wanlong Gao
0 siblings, 1 reply; 4+ messages in thread
From: Wei,Jiangang @ 2015-03-03 1:35 UTC (permalink / raw)
To: ltp-list
KVM guest is on top of QEMU, and KVM is used by QEMU to
provide hardware-accelerated virtualization.
Although there is an association between them,
difference is very obvious.
The function named is_kvm() is only can be applied to
determine QEMU, which couldn't distinguish QEMU and QEMU-KVM.
In other words,
Its' name doesn't match its' content and function.
so is_qemu() more reasonable.
Signed-off-by: Wei,Jiangang <weijg.fnst@cn.fujitsu.com>
---
include/test.h | 2 +-
lib/tst_virt.c | 6 +++---
testcases/kernel/syscalls/getrusage/getrusage04.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/test.h b/include/test.h
index f45bb36..12f913b 100644
--- a/include/test.h
+++ b/include/test.h
@@ -54,7 +54,7 @@
/* virt types for tst_is_virt() */
#define VIRT_XEN 1 /* xen dom0/domU */
-#define VIRT_KVM 2 /* only default virtual CPU */
+#define VIRT_QEMU 2 /* only default virtual CPU */
/*
* Ensure that NUMSIGS is defined.
diff --git a/lib/tst_virt.c b/lib/tst_virt.c
index 87f73dc..d0d701e 100644
--- a/lib/tst_virt.c
+++ b/lib/tst_virt.c
@@ -26,7 +26,7 @@
#include "test.h"
#include "safe_macros.h"
-static int is_kvm(void)
+static int is_qemu(void)
{
FILE *cpuinfo;
char line[64];
@@ -69,8 +69,8 @@ int tst_is_virt(int virt_type)
switch (virt_type) {
case VIRT_XEN:
return is_xen();
- case VIRT_KVM:
- return is_kvm();
+ case VIRT_QEMU:
+ return is_qemu();
}
tst_brkm(TBROK, NULL, "invalid virt_type flag: %d", virt_type);
}
diff --git a/testcases/kernel/syscalls/getrusage/getrusage04.c b/testcases/kernel/syscalls/getrusage/getrusage04.c
index c2f34f4..f34f0c1 100644
--- a/testcases/kernel/syscalls/getrusage/getrusage04.c
+++ b/testcases/kernel/syscalls/getrusage/getrusage04.c
@@ -200,7 +200,7 @@ static void setup(void)
{
tst_sig(NOFORK, DEF_HANDLER, cleanup);
- if (tst_is_virt(VIRT_XEN) || tst_is_virt(VIRT_KVM))
+ if (tst_is_virt(VIRT_XEN) || tst_is_virt(VIRT_QEMU))
tst_brkm(TCONF, NULL, "This testcase is not supported on this"
" virtual machine.");
--
1.9.3
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] lib/tst_virt: rename is_kvm to is_qemu
2015-03-03 1:35 [LTP] [PATCH] lib/tst_virt: rename is_kvm to is_qemu Wei,Jiangang
@ 2015-03-03 1:57 ` Wanlong Gao
2015-03-03 5:24 ` Wei, Jiangang
0 siblings, 1 reply; 4+ messages in thread
From: Wanlong Gao @ 2015-03-03 1:57 UTC (permalink / raw)
To: Wei,Jiangang; +Cc: ltp-list
On 03/03/2015 09:35 AM, Wei,Jiangang wrote:
> KVM guest is on top of QEMU, and KVM is used by QEMU to
> provide hardware-accelerated virtualization.
> Although there is an association between them,
> difference is very obvious.
>
> The function named is_kvm() is only can be applied to
> determine QEMU, which couldn't distinguish QEMU and QEMU-KVM.
> In other words,
> Its' name doesn't match its' content and function.
> so is_qemu() more reasonable.
NACK, KVM is the name in the same stand of Xen, while qemu
is just a client program. You are making wrong sense to others.
Thanks,
Wanlong Gao
>
> Signed-off-by: Wei,Jiangang <weijg.fnst@cn.fujitsu.com>
> ---
> include/test.h | 2 +-
> lib/tst_virt.c | 6 +++---
> testcases/kernel/syscalls/getrusage/getrusage04.c | 2 +-
> 3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/include/test.h b/include/test.h
> index f45bb36..12f913b 100644
> --- a/include/test.h
> +++ b/include/test.h
> @@ -54,7 +54,7 @@
>
> /* virt types for tst_is_virt() */
> #define VIRT_XEN 1 /* xen dom0/domU */
> -#define VIRT_KVM 2 /* only default virtual CPU */
> +#define VIRT_QEMU 2 /* only default virtual CPU */
>
> /*
> * Ensure that NUMSIGS is defined.
> diff --git a/lib/tst_virt.c b/lib/tst_virt.c
> index 87f73dc..d0d701e 100644
> --- a/lib/tst_virt.c
> +++ b/lib/tst_virt.c
> @@ -26,7 +26,7 @@
> #include "test.h"
> #include "safe_macros.h"
>
> -static int is_kvm(void)
> +static int is_qemu(void)
> {
> FILE *cpuinfo;
> char line[64];
> @@ -69,8 +69,8 @@ int tst_is_virt(int virt_type)
> switch (virt_type) {
> case VIRT_XEN:
> return is_xen();
> - case VIRT_KVM:
> - return is_kvm();
> + case VIRT_QEMU:
> + return is_qemu();
> }
> tst_brkm(TBROK, NULL, "invalid virt_type flag: %d", virt_type);
> }
> diff --git a/testcases/kernel/syscalls/getrusage/getrusage04.c b/testcases/kernel/syscalls/getrusage/getrusage04.c
> index c2f34f4..f34f0c1 100644
> --- a/testcases/kernel/syscalls/getrusage/getrusage04.c
> +++ b/testcases/kernel/syscalls/getrusage/getrusage04.c
> @@ -200,7 +200,7 @@ static void setup(void)
> {
> tst_sig(NOFORK, DEF_HANDLER, cleanup);
>
> - if (tst_is_virt(VIRT_XEN) || tst_is_virt(VIRT_KVM))
> + if (tst_is_virt(VIRT_XEN) || tst_is_virt(VIRT_QEMU))
> tst_brkm(TCONF, NULL, "This testcase is not supported on this"
> " virtual machine.");
>
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] lib/tst_virt: rename is_kvm to is_qemu
2015-03-03 1:57 ` Wanlong Gao
@ 2015-03-03 5:24 ` Wei, Jiangang
2015-03-03 7:55 ` Wanlong Gao
0 siblings, 1 reply; 4+ messages in thread
From: Wei, Jiangang @ 2015-03-03 5:24 UTC (permalink / raw)
To: Gao, Wanlong; +Cc: ltp-list@lists.sourceforge.net
On Tue, 2015-03-03 at 09:57 +0800, Wanlong Gao wrote:
> On 03/03/2015 09:35 AM, Wei,Jiangang wrote:
> > KVM guest is on top of QEMU, and KVM is used by QEMU to
> > provide hardware-accelerated virtualization.
> > Although there is an association between them,
> > difference is very obvious.
> >
> > The function named is_kvm() is only can be applied to
> > determine QEMU, which couldn't distinguish QEMU and QEMU-KVM.
> > In other words,
> > Its' name doesn't match its' content and function.
> > so is_qemu() more reasonable.
>
> NACK, KVM is the name in the same stand of Xen, while qemu
> is just a client program. You are making wrong sense to others.
wrong sense?
I'm not sure of what you want to say.
do you explain it more clearly?
Thanks in advance.
In my opinion,
QEMU should be in the same level of Xen, not KVM.
Xen-HVM and KVM are in the same level.
I had talk about it with the author of this function by maillist.
He said "I'm not against renaming VIRT_KVM to VIRT_QEMU as it would be
technically more correct".
Thanks,
wei
>
> Thanks,
> Wanlong Gao
>
> >
> > Signed-off-by: Wei,Jiangang <weijg.fnst@cn.fujitsu.com>
> > ---
> > include/test.h | 2 +-
> > lib/tst_virt.c | 6 +++---
> > testcases/kernel/syscalls/getrusage/getrusage04.c | 2 +-
> > 3 files changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/include/test.h b/include/test.h
> > index f45bb36..12f913b 100644
> > --- a/include/test.h
> > +++ b/include/test.h
> > @@ -54,7 +54,7 @@
> >
> > /* virt types for tst_is_virt() */
> > #define VIRT_XEN 1 /* xen dom0/domU */
> > -#define VIRT_KVM 2 /* only default virtual CPU */
> > +#define VIRT_QEMU 2 /* only default virtual CPU */
> >
> > /*
> > * Ensure that NUMSIGS is defined.
> > diff --git a/lib/tst_virt.c b/lib/tst_virt.c
> > index 87f73dc..d0d701e 100644
> > --- a/lib/tst_virt.c
> > +++ b/lib/tst_virt.c
> > @@ -26,7 +26,7 @@
> > #include "test.h"
> > #include "safe_macros.h"
> >
> > -static int is_kvm(void)
> > +static int is_qemu(void)
> > {
> > FILE *cpuinfo;
> > char line[64];
> > @@ -69,8 +69,8 @@ int tst_is_virt(int virt_type)
> > switch (virt_type) {
> > case VIRT_XEN:
> > return is_xen();
> > - case VIRT_KVM:
> > - return is_kvm();
> > + case VIRT_QEMU:
> > + return is_qemu();
> > }
> > tst_brkm(TBROK, NULL, "invalid virt_type flag: %d", virt_type);
> > }
> > diff --git a/testcases/kernel/syscalls/getrusage/getrusage04.c b/testcases/kernel/syscalls/getrusage/getrusage04.c
> > index c2f34f4..f34f0c1 100644
> > --- a/testcases/kernel/syscalls/getrusage/getrusage04.c
> > +++ b/testcases/kernel/syscalls/getrusage/getrusage04.c
> > @@ -200,7 +200,7 @@ static void setup(void)
> > {
> > tst_sig(NOFORK, DEF_HANDLER, cleanup);
> >
> > - if (tst_is_virt(VIRT_XEN) || tst_is_virt(VIRT_KVM))
> > + if (tst_is_virt(VIRT_XEN) || tst_is_virt(VIRT_QEMU))
> > tst_brkm(TCONF, NULL, "This testcase is not supported on this"
> > " virtual machine.");
> >
> >
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] lib/tst_virt: rename is_kvm to is_qemu
2015-03-03 5:24 ` Wei, Jiangang
@ 2015-03-03 7:55 ` Wanlong Gao
0 siblings, 0 replies; 4+ messages in thread
From: Wanlong Gao @ 2015-03-03 7:55 UTC (permalink / raw)
To: "Wei, Jiangang/魏 建刚"
Cc: ltp-list@lists.sourceforge.net
On 03/03/2015 01:24 PM, Wei, Jiangang/魏 建刚 wrote:
> On Tue, 2015-03-03 at 09:57 +0800, Wanlong Gao wrote:
>> On 03/03/2015 09:35 AM, Wei,Jiangang wrote:
>>> KVM guest is on top of QEMU, and KVM is used by QEMU to
>>> provide hardware-accelerated virtualization.
>>> Although there is an association between them,
>>> difference is very obvious.
>>>
>>> The function named is_kvm() is only can be applied to
>>> determine QEMU, which couldn't distinguish QEMU and QEMU-KVM.
>>> In other words,
>>> Its' name doesn't match its' content and function.
>>> so is_qemu() more reasonable.
>>
>> NACK, KVM is the name in the same stand of Xen, while qemu
>> is just a client program. You are making wrong sense to others.
> wrong sense?
> I'm not sure of what you want to say.
> do you explain it more clearly?
> Thanks in advance.
>
> In my opinion,
> QEMU should be in the same level of Xen, not KVM.
> Xen-HVM and KVM are in the same level.
>
> I had talk about it with the author of this function by maillist.
> He said "I'm not against renaming VIRT_KVM to VIRT_QEMU as it would be
> technically more correct".
OK, since this problem is now raised, I'll send a patch to refactor the
current VIRT detect code, please review my patch.
Thanks,
Wanlong Gao
>
> Thanks,
> wei
>>
>> Thanks,
>> Wanlong Gao
>>
>>>
>>> Signed-off-by: Wei,Jiangang <weijg.fnst@cn.fujitsu.com>
>>> ---
>>> include/test.h | 2 +-
>>> lib/tst_virt.c | 6 +++---
>>> testcases/kernel/syscalls/getrusage/getrusage04.c | 2 +-
>>> 3 files changed, 5 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/include/test.h b/include/test.h
>>> index f45bb36..12f913b 100644
>>> --- a/include/test.h
>>> +++ b/include/test.h
>>> @@ -54,7 +54,7 @@
>>>
>>> /* virt types for tst_is_virt() */
>>> #define VIRT_XEN 1 /* xen dom0/domU */
>>> -#define VIRT_KVM 2 /* only default virtual CPU */
>>> +#define VIRT_QEMU 2 /* only default virtual CPU */
>>>
>>> /*
>>> * Ensure that NUMSIGS is defined.
>>> diff --git a/lib/tst_virt.c b/lib/tst_virt.c
>>> index 87f73dc..d0d701e 100644
>>> --- a/lib/tst_virt.c
>>> +++ b/lib/tst_virt.c
>>> @@ -26,7 +26,7 @@
>>> #include "test.h"
>>> #include "safe_macros.h"
>>>
>>> -static int is_kvm(void)
>>> +static int is_qemu(void)
>>> {
>>> FILE *cpuinfo;
>>> char line[64];
>>> @@ -69,8 +69,8 @@ int tst_is_virt(int virt_type)
>>> switch (virt_type) {
>>> case VIRT_XEN:
>>> return is_xen();
>>> - case VIRT_KVM:
>>> - return is_kvm();
>>> + case VIRT_QEMU:
>>> + return is_qemu();
>>> }
>>> tst_brkm(TBROK, NULL, "invalid virt_type flag: %d", virt_type);
>>> }
>>> diff --git a/testcases/kernel/syscalls/getrusage/getrusage04.c b/testcases/kernel/syscalls/getrusage/getrusage04.c
>>> index c2f34f4..f34f0c1 100644
>>> --- a/testcases/kernel/syscalls/getrusage/getrusage04.c
>>> +++ b/testcases/kernel/syscalls/getrusage/getrusage04.c
>>> @@ -200,7 +200,7 @@ static void setup(void)
>>> {
>>> tst_sig(NOFORK, DEF_HANDLER, cleanup);
>>>
>>> - if (tst_is_virt(VIRT_XEN) || tst_is_virt(VIRT_KVM))
>>> + if (tst_is_virt(VIRT_XEN) || tst_is_virt(VIRT_QEMU))
>>> tst_brkm(TCONF, NULL, "This testcase is not supported on this"
>>> " virtual machine.");
>>>
>>>
>>
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-03-03 7:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-03 1:35 [LTP] [PATCH] lib/tst_virt: rename is_kvm to is_qemu Wei,Jiangang
2015-03-03 1:57 ` Wanlong Gao
2015-03-03 5:24 ` Wei, Jiangang
2015-03-03 7:55 ` Wanlong Gao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox