From ea5d8ced41db9808563e0859f2763fa099a4a88a Mon Sep 17 00:00:00 2001 From: Thomas Blume Date: Thu, 17 Jul 2014 11:25:37 +0200 Subject: [PATCH] fix-only-discover-Xen-domU The conditional for detection xen virtualization contained a little mistake. It is checking for i to be empty: 'if (!i) {', but it must check for cap instead, because: 'cap = strsep(&i, ",")' will set cap to the discovered value and i to the next value after the separator. Hence, i would be empty, if there is only control_d in domcap, leading to a wrong domU detection. --- src/shared/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/virt.c b/src/shared/virt.c index 774915f..20a8d7c 100644 --- a/src/shared/virt.c +++ b/src/shared/virt.c @@ -173,7 +173,7 @@ int detect_vm(const char **id) { if (streq(cap, "control_d")) break; - if (!i) { + if (!cap) { _id = "xen"; r = 1; } -- 1.8.4.5