|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
From be8dbe82ba453b40e119010454e30237e6d02b12 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
From: Thomas Blume <Thomas.Blume@suse.com>
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
Date: Thu, 17 Jul 2014 11:25:37 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
Subject: [PATCH] detect-virt: Fix Xen domU discovery
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
The conditional for detection xen virtualization contained a little mistake.
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
It is checking for i to be empty: 'if (!i) {', but it must check for cap instead,
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
because: 'cap = strsep(&i, ",")' will set cap to the discovered value and i to
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
the next value after the separator.
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
Hence, i would be empty, if there is only control_d in domcap, leading to a wrong
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
domU detection.
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
https://bugs.freedesktop.org/show_bug.cgi?id=77271
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
(cherry picked from commit a71516dfd1858f37712ef52a288bf5fb274383e0)
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
src/shared/virt.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
diff --git a/src/shared/virt.c b/src/shared/virt.c
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
index 774915f4be..20a8d7c5bf 100644
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
--- a/src/shared/virt.c
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+++ b/src/shared/virt.c
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
@@ -173,7 +173,7 @@ int detect_vm(const char **id) {
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
if (streq(cap, "control_d"))
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
break;
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- if (!i) {
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ if (!cap) {
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
_id = "xen";
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
r = 1;
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
}
|