mirror of https://github.com/xemu-project/xemu.git
Xen 2017/02/02
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJYk3nyAAoJEIlPj0hw4a6Q4kcP/1awM8VPkvkb85sqwxIj4RI8 Yuhmx//gT8cDiXZmxxx3sEk5221kc3DpwieQf0aAHR8EsXdczY/GbkZI6LcUI4E9 2oN69gtLoxPVQY+bLJ2JXnGyhHKW2+iKKxzur1KkpgCo1FSxAuXEe1KT5WZsM6nY DcKRV7oRJWCYdCtU6LVVXY+wtLT2/4QEdQbAsLUIamSQ88u4HHtKtjAyra95oNnS 75XW7GDemPh82ATk1NF4hhxaA9wR9DThBxqmm8DUCcCJAwEYafKV/vLxmpXd2vPO tOi2QZsEgvjNxIV2Gn0kY1XQxiG1If3dRl4W8Q05oUyAGI6Cz7Yrz+l/um/usxko NYqVbD1+HcrA8BBifh+FC2lsFD+S1Yd+zqkC2O2WkMzR1raFHnvAJBUySN/HcCni /68hmHiudBgInA9bLmN5XwY3uJ6f4nWHpRGaarFuCNCxVdQy1AZOpdlUEP2p6naP fkwJCGFODhy9xNTmKS7WGlddeGkaW4XsONo5iTHcx377eX2zaUminKxIuCkGqbwd 3qrbu1aMGpTK7WchHEfO3qJBbsIC0gG9YakUzGgbUIkEuorqDOEf9RJ/qoHq4Emo sdPGwcKnrV1SUJl0RzIAqQgoB681AwGVsybFJwJv3evw9Q8DCgpZX7edAGnqZ3lG QlZbfdbVVjpz17sQebuX =xxXu -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/sstabellini/tags/xen-20170202' into staging Xen 2017/02/02 # gpg: Signature made Thu 02 Feb 2017 18:26:58 GMT # gpg: using RSA key 0x894F8F4870E1AE90 # gpg: Good signature from "Stefano Stabellini <sstabellini@kernel.org>" # gpg: aka "Stefano Stabellini <stefano.stabellini@eu.citrix.com>" # Primary key fingerprint: D04E 33AB A51F 67BA 07D3 0AEA 894F 8F48 70E1 AE90 * remotes/sstabellini/tags/xen-20170202: xen: use qdev_unplug() instead of g_free() in xen_pv_find_xendev() MAINTAINERS: Update xen-devel mailing list address xen-platform: add missing disk unplug option xen-platform: add support for unplugging NVMe disks... xen-platform: re-structure unplug_disks Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
4100a344eb
|
@ -323,7 +323,7 @@ Guest CPU Cores (Xen):
|
|||
X86
|
||||
M: Stefano Stabellini <sstabellini@kernel.org>
|
||||
M: Anthony Perard <anthony.perard@citrix.com>
|
||||
L: xen-devel@lists.xensource.com
|
||||
L: xen-devel@lists.xenproject.org
|
||||
S: Supported
|
||||
F: xen-*
|
||||
F: */xen*
|
||||
|
|
|
@ -88,7 +88,7 @@ static void log_writeb(PCIXenPlatformState *s, char val)
|
|||
}
|
||||
|
||||
/* Xen Platform, Fixed IOPort */
|
||||
#define UNPLUG_ALL_IDE_DISKS 1
|
||||
#define UNPLUG_ALL_DISKS 1
|
||||
#define UNPLUG_ALL_NICS 2
|
||||
#define UNPLUG_AUX_IDE_DISKS 4
|
||||
|
||||
|
@ -107,23 +107,37 @@ static void pci_unplug_nics(PCIBus *bus)
|
|||
pci_for_each_device(bus, 0, unplug_nic, NULL);
|
||||
}
|
||||
|
||||
static void unplug_disks(PCIBus *b, PCIDevice *d, void *o)
|
||||
static void unplug_disks(PCIBus *b, PCIDevice *d, void *opaque)
|
||||
{
|
||||
uint32_t flags = *(uint32_t *)opaque;
|
||||
bool aux = (flags & UNPLUG_AUX_IDE_DISKS) &&
|
||||
!(flags & UNPLUG_ALL_DISKS);
|
||||
|
||||
/* We have to ignore passthrough devices */
|
||||
if (pci_get_word(d->config + PCI_CLASS_DEVICE) ==
|
||||
PCI_CLASS_STORAGE_IDE
|
||||
&& strcmp(d->name, "xen-pci-passthrough") != 0) {
|
||||
pci_piix3_xen_ide_unplug(DEVICE(d));
|
||||
} else if (pci_get_word(d->config + PCI_CLASS_DEVICE) ==
|
||||
PCI_CLASS_STORAGE_SCSI
|
||||
&& strcmp(d->name, "xen-pci-passthrough") != 0) {
|
||||
object_unparent(OBJECT(d));
|
||||
if (!strcmp(d->name, "xen-pci-passthrough")) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (pci_get_word(d->config + PCI_CLASS_DEVICE)) {
|
||||
case PCI_CLASS_STORAGE_IDE:
|
||||
pci_piix3_xen_ide_unplug(DEVICE(d), aux);
|
||||
break;
|
||||
|
||||
case PCI_CLASS_STORAGE_SCSI:
|
||||
case PCI_CLASS_STORAGE_EXPRESS:
|
||||
if (!aux) {
|
||||
object_unparent(OBJECT(d));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void pci_unplug_disks(PCIBus *bus)
|
||||
static void pci_unplug_disks(PCIBus *bus, uint32_t flags)
|
||||
{
|
||||
pci_for_each_device(bus, 0, unplug_disks, NULL);
|
||||
pci_for_each_device(bus, 0, unplug_disks, &flags);
|
||||
}
|
||||
|
||||
static void platform_fixed_ioport_writew(void *opaque, uint32_t addr, uint32_t val)
|
||||
|
@ -134,19 +148,16 @@ static void platform_fixed_ioport_writew(void *opaque, uint32_t addr, uint32_t v
|
|||
case 0: {
|
||||
PCIDevice *pci_dev = PCI_DEVICE(s);
|
||||
/* Unplug devices. Value is a bitmask of which devices to
|
||||
unplug, with bit 0 the IDE devices, bit 1 the network
|
||||
unplug, with bit 0 the disk devices, bit 1 the network
|
||||
devices, and bit 2 the non-primary-master IDE devices. */
|
||||
if (val & UNPLUG_ALL_IDE_DISKS) {
|
||||
if (val & (UNPLUG_ALL_DISKS | UNPLUG_AUX_IDE_DISKS)) {
|
||||
DPRINTF("unplug disks\n");
|
||||
pci_unplug_disks(pci_dev->bus);
|
||||
pci_unplug_disks(pci_dev->bus, val);
|
||||
}
|
||||
if (val & UNPLUG_ALL_NICS) {
|
||||
DPRINTF("unplug nics\n");
|
||||
pci_unplug_nics(pci_dev->bus);
|
||||
}
|
||||
if (val & UNPLUG_AUX_IDE_DISKS) {
|
||||
DPRINTF("unplug auxiliary disks not supported\n");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
|
@ -327,14 +338,14 @@ static void xen_platform_ioport_writeb(void *opaque, hwaddr addr,
|
|||
* If VMDP was to control both disk and LAN it would use 4.
|
||||
* If it controlled just disk or just LAN, it would use 8 below.
|
||||
*/
|
||||
pci_unplug_disks(pci_dev->bus);
|
||||
pci_unplug_disks(pci_dev->bus, UNPLUG_ALL_DISKS);
|
||||
pci_unplug_nics(pci_dev->bus);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
switch (val) {
|
||||
case 1:
|
||||
pci_unplug_disks(pci_dev->bus);
|
||||
pci_unplug_disks(pci_dev->bus, UNPLUG_ALL_DISKS);
|
||||
break;
|
||||
case 2:
|
||||
pci_unplug_nics(pci_dev->bus);
|
||||
|
|
|
@ -165,7 +165,7 @@ static void pci_piix_ide_realize(PCIDevice *dev, Error **errp)
|
|||
pci_piix_init_ports(d);
|
||||
}
|
||||
|
||||
int pci_piix3_xen_ide_unplug(DeviceState *dev)
|
||||
int pci_piix3_xen_ide_unplug(DeviceState *dev, bool aux)
|
||||
{
|
||||
PCIIDEState *pci_ide;
|
||||
DriveInfo *di;
|
||||
|
@ -174,7 +174,7 @@ int pci_piix3_xen_ide_unplug(DeviceState *dev)
|
|||
|
||||
pci_ide = PCI_IDE(dev);
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (i = aux ? 1 : 0; i < 4; i++) {
|
||||
di = drive_get_by_index(IF_IDE, i);
|
||||
if (di != NULL && !di->media_cd) {
|
||||
BlockBackend *blk = blk_by_legacy_dinfo(di);
|
||||
|
|
|
@ -124,10 +124,11 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
|
|||
/* init new xendev */
|
||||
xendev = g_malloc0(ops->size);
|
||||
object_initialize(&xendev->qdev, ops->size, TYPE_XENBACKEND);
|
||||
qdev_set_parent_bus(&xendev->qdev, xen_sysbus);
|
||||
qdev_set_id(&xendev->qdev, g_strdup_printf("xen-%s-%d", type, dev));
|
||||
qdev_init_nofail(&xendev->qdev);
|
||||
object_unref(OBJECT(&xendev->qdev));
|
||||
OBJECT(xendev)->free = g_free;
|
||||
qdev_set_parent_bus(DEVICE(xendev), xen_sysbus);
|
||||
qdev_set_id(DEVICE(xendev), g_strdup_printf("xen-%s-%d", type, dev));
|
||||
qdev_init_nofail(DEVICE(xendev));
|
||||
object_unref(OBJECT(xendev));
|
||||
|
||||
xendev->type = type;
|
||||
xendev->dom = dom;
|
||||
|
@ -145,7 +146,7 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
|
|||
xendev->evtchndev = xenevtchn_open(NULL, 0);
|
||||
if (xendev->evtchndev == NULL) {
|
||||
xen_pv_printf(NULL, 0, "can't open evtchn device\n");
|
||||
g_free(xendev);
|
||||
qdev_unplug(DEVICE(xendev), NULL);
|
||||
return NULL;
|
||||
}
|
||||
fcntl(xenevtchn_fd(xendev->evtchndev), F_SETFD, FD_CLOEXEC);
|
||||
|
@ -155,7 +156,7 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
|
|||
if (xendev->gnttabdev == NULL) {
|
||||
xen_pv_printf(NULL, 0, "can't open gnttab device\n");
|
||||
xenevtchn_close(xendev->evtchndev);
|
||||
g_free(xendev);
|
||||
qdev_unplug(DEVICE(xendev), NULL);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -17,7 +17,7 @@ void pci_cmd646_ide_init(PCIBus *bus, DriveInfo **hd_table,
|
|||
PCIDevice *pci_piix3_xen_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
|
||||
PCIDevice *pci_piix3_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
|
||||
PCIDevice *pci_piix4_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
|
||||
int pci_piix3_xen_ide_unplug(DeviceState *dev);
|
||||
int pci_piix3_xen_ide_unplug(DeviceState *dev, bool aux);
|
||||
void vt82c686b_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
|
||||
|
||||
/* ide-mmio.c */
|
||||
|
|
Loading…
Reference in New Issue