bool xen_has_pv_devices(void)
{ if (!xen_domain()) returnfalse;
/* PV and PVH domains always have them. */ if (xen_pv_domain() || xen_pvh_domain()) returntrue;
/* And user has xen_platform_pci=0 set in guest config as
* driver did not modify the value. */ if (xen_platform_pci_unplug == 0) returnfalse;
if (xen_platform_pci_unplug & XEN_UNPLUG_NEVER) returnfalse;
if (xen_platform_pci_unplug & XEN_UNPLUG_ALL) returntrue;
/* This is an odd one - we are going to run legacy
* and PV drivers at the same time. */ if (xen_platform_pci_unplug & XEN_UNPLUG_UNNECESSARY) returntrue;
/* And the caller has to follow with xen_pv_{disk,nic}_devices
* to be certain which driver can load. */ returnfalse;
}
EXPORT_SYMBOL_GPL(xen_has_pv_devices);
staticbool __xen_has_pv_device(int state)
{ /* HVM domains might or might not */ if (xen_hvm_domain() && (xen_platform_pci_unplug & state)) returntrue;
/* * This one is odd - it determines whether you want to run PV _and_ * legacy (IDE) drivers together. This combination is only possible * under HVM.
*/ bool xen_has_pv_and_legacy_disk_devices(void)
{ if (!xen_domain()) returnfalse;
/* N.B. This is only ever used in HVM mode */ if (xen_pv_domain()) returnfalse;
if (xen_platform_pci_unplug & XEN_UNPLUG_UNNECESSARY) returntrue;
/* PVH guests don't have emulated devices. */ if (xen_pvh_domain()) return;
/* user explicitly requested no unplug */ if (xen_emul_unplug & XEN_UNPLUG_NEVER) return; /* check the version of the xen platform PCI device */
r = check_platform_magic(); /* If the version matches enable the Xen platform PCI driver. * Also enable the Xen platform PCI driver if the host does * not support the unplug protocol (XEN_PLATFORM_ERR_MAGIC)
* but the user told us that unplugging is unnecessary. */ if (r && !(r == XEN_PLATFORM_ERR_MAGIC &&
(xen_emul_unplug & XEN_UNPLUG_UNNECESSARY))) return; /* Set the default value of xen_emul_unplug depending on whether or * not the Xen PV frontends and the Xen platform PCI driver have
* been compiled for this kernel (modules or built-in are both OK). */ if (!xen_emul_unplug) { if (xen_must_unplug_nics()) {
pr_info("Netfront and the Xen platform PCI driver have " "been compiled for this kernel: unplug emulated NICs.\n");
xen_emul_unplug |= XEN_UNPLUG_ALL_NICS;
} if (xen_must_unplug_disks()) {
pr_info("Blkfront and the Xen platform PCI driver have " "been compiled for this kernel: unplug emulated disks.\n" "You might have to change the root device\n" "from /dev/hd[a-d] to /dev/xvd[a-d]\n" "in your root= kernel command line option\n");
xen_emul_unplug |= XEN_UNPLUG_ALL_IDE_DISKS;
}
} /* Now unplug the emulated devices */ if (!(xen_emul_unplug & XEN_UNPLUG_UNNECESSARY))
outw(xen_emul_unplug, XEN_IOPORT_UNPLUG);
xen_platform_pci_unplug = xen_emul_unplug;
}
staticint __init parse_xen_emul_unplug(char *arg)
{ char *p, *q; int l;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.