From 429b4ca11b2757e0eb453f9f53bdb08cfe669f8e Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 11 Jul 2011 11:16:49 -0700 Subject: Fix duplicate detection of hypervisor Bug 7314 If cpuid succeeds, don't need to print twice. --- src/hypervisor_vendor.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/hypervisor_vendor.c b/src/hypervisor_vendor.c index eade6c66..0a447565 100644 --- a/src/hypervisor_vendor.c +++ b/src/hypervisor_vendor.c @@ -159,12 +159,8 @@ int main(int argc, char **argv) const char *hvm; char buf[256]; - hvm = get_hypervisor_cpuid(); - if (hvm) - printf("%s\n", hvm); - - hvm = get_hypervisor_dmi(); - if (hvm) + if ((hvm = get_hypervisor_cpuid()) != NULL || + (hvm = get_hypervisor_dmi()) != NULL) printf("%s\n", hvm); /* Grotty code to look for old Xen */ -- cgit v1.2.3