diff options
author | Thierry Vignaud <tv@mageia.org> | 2013-04-05 10:36:53 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2013-04-05 10:36:53 +0000 |
commit | 475c3c619983209f4951ba7a122685c6299e3f6e (patch) | |
tree | cdb90a4e4200e96687f49b4c602e71d5f78ab917 | |
parent | d78ee83b7bb82c2914e4d61b6a6231cb190ad3ab (diff) | |
download | ldetect-475c3c619983209f4951ba7a122685c6299e3f6e.tar ldetect-475c3c619983209f4951ba7a122685c6299e3f6e.tar.gz ldetect-475c3c619983209f4951ba7a122685c6299e3f6e.tar.bz2 ldetect-475c3c619983209f4951ba7a122685c6299e3f6e.tar.xz ldetect-475c3c619983209f4951ba7a122685c6299e3f6e.zip |
do not fake Xen blk & net controllers on dom0 (mga#9546)
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | pci.c | 10 |
2 files changed, 12 insertions, 0 deletions
@@ -1,3 +1,5 @@ +- do not fake Xen blk & net controllers on dom0 (mga#9546) + Version 0.12.6 - 31 March 2013, Thierry Vignaud - add support for detecting Xen blk & net controllers (mga#9546) @@ -54,6 +54,16 @@ static void detect_xen(struct pciusb_entries *r) { struct stat sb; if (stat("/sys/bus/xen", &sb) != 0) return; + FILE *f; + if (!(f = fopen("/sys/hypervisor/uuid", "r"))) + return; + char buf[38]; + fgets(buf, sizeof(buf) - 1, f); + fclose(f); + if (!strncmp(buf, "00000000-0000-0000-0000-000000000000", sizeof(buf))) + return; + + // We're now sure to be in a Xen guest: struct pciusb_entry *e = &r->entries[r->nb++]; pciusb_initialize(e); |