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.f...@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