detect-virt: Fix Xen domU discovery
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.
https://bugs.freedesktop.org/show_bug.cgi?id=77271
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
6eb33ab207
commit
a71516dfd1
+1
-1
@@ -173,7 +173,7 @@ int detect_vm(const char **id) {
|
||||
if (streq(cap, "control_d"))
|
||||
break;
|
||||
|
||||
if (!i) {
|
||||
if (!cap) {
|
||||
_id = "xen";
|
||||
r = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user