diff options
author | Thomas Blume <Thomas.Blume@suse.com> | 2014-07-17 11:25:37 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-07-17 14:26:35 +0200 |
commit | a71516dfd1858f37712ef52a288bf5fb274383e0 (patch) | |
tree | 9cb9ed958c36b50b60cff85b2ee4d791992afd39 /src/shared | |
parent | networkd: fix colud typo (diff) | |
download | systemd-a71516dfd1858f37712ef52a288bf5fb274383e0.tar.xz systemd-a71516dfd1858f37712ef52a288bf5fb274383e0.zip |
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
Diffstat (limited to '')
-rw-r--r-- | src/shared/virt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/virt.c b/src/shared/virt.c index 774915f4be..20a8d7c5bf 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; } |