diff options
-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); |