mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
tests/qtest/libqos: Skip hotplug tests if pci root bus is not hotpluggable
ARM does not not support hotplug on pcie.0. Add a flag on the bus which tells if devices can be hotplugged and skip hotplug tests if the bus cannot be hotplugged. This is a temporary solution to enable the other pci tests on aarch64. Signed-off-by: Eric Auger <eric.auger@redhat.com> Acked-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20220504152025.1785704-3-eric.auger@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
3df72d1c55
commit
02ee7a8a97
6 changed files with 32 additions and 0 deletions
|
@ -233,6 +233,12 @@ static void test_e1000e_multiple_transfers(void *obj, void *data,
|
||||||
static void test_e1000e_hotplug(void *obj, void *data, QGuestAllocator * alloc)
|
static void test_e1000e_hotplug(void *obj, void *data, QGuestAllocator * alloc)
|
||||||
{
|
{
|
||||||
QTestState *qts = global_qtest; /* TODO: get rid of global_qtest here */
|
QTestState *qts = global_qtest; /* TODO: get rid of global_qtest here */
|
||||||
|
QE1000E_PCI *dev = obj;
|
||||||
|
|
||||||
|
if (dev->pci_dev.bus->not_hotpluggable) {
|
||||||
|
g_test_skip("pci bus does not support hotplug");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
qtest_qmp_device_add(qts, "e1000e", "e1000e_net", "{'addr': '0x06'}");
|
qtest_qmp_device_add(qts, "e1000e", "e1000e_net", "{'addr': '0x06'}");
|
||||||
qpci_unplug_acpi_device_test(qts, "e1000e_net", 0x06);
|
qpci_unplug_acpi_device_test(qts, "e1000e_net", 0x06);
|
||||||
|
|
|
@ -52,6 +52,7 @@ struct QPCIBus {
|
||||||
uint64_t pio_alloc_ptr, pio_limit;
|
uint64_t pio_alloc_ptr, pio_limit;
|
||||||
uint64_t mmio_alloc_ptr, mmio_limit;
|
uint64_t mmio_alloc_ptr, mmio_limit;
|
||||||
bool has_buggy_msi; /* TRUE for spapr, FALSE for pci */
|
bool has_buggy_msi; /* TRUE for spapr, FALSE for pci */
|
||||||
|
bool not_hotpluggable; /* TRUE if devices cannot be hotplugged */
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -676,6 +676,11 @@ static void pci_hotplug(void *obj, void *data, QGuestAllocator *t_alloc)
|
||||||
QVirtioPCIDevice *dev;
|
QVirtioPCIDevice *dev;
|
||||||
QTestState *qts = dev1->pdev->bus->qts;
|
QTestState *qts = dev1->pdev->bus->qts;
|
||||||
|
|
||||||
|
if (dev1->pdev->bus->not_hotpluggable) {
|
||||||
|
g_test_skip("pci bus does not support hotplug");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* plug secondary disk */
|
/* plug secondary disk */
|
||||||
qtest_qmp_device_add(qts, "vhost-user-blk-pci", "drv1",
|
qtest_qmp_device_add(qts, "vhost-user-blk-pci", "drv1",
|
||||||
"{'addr': %s, 'chardev': 'char2'}",
|
"{'addr': %s, 'chardev': 'char2'}",
|
||||||
|
@ -703,6 +708,11 @@ static void multiqueue(void *obj, void *data, QGuestAllocator *t_alloc)
|
||||||
uint64_t features;
|
uint64_t features;
|
||||||
uint16_t num_queues;
|
uint16_t num_queues;
|
||||||
|
|
||||||
|
if (pdev1->pdev->bus->not_hotpluggable) {
|
||||||
|
g_test_skip("bus pci.0 does not support hotplug");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The primary device has 1 queue and VIRTIO_BLK_F_MQ is not enabled. The
|
* The primary device has 1 queue and VIRTIO_BLK_F_MQ is not enabled. The
|
||||||
* VIRTIO specification allows VIRTIO_BLK_F_MQ to be enabled when there is
|
* VIRTIO specification allows VIRTIO_BLK_F_MQ to be enabled when there is
|
||||||
|
|
|
@ -701,6 +701,11 @@ static void pci_hotplug(void *obj, void *data, QGuestAllocator *t_alloc)
|
||||||
QVirtioPCIDevice *dev;
|
QVirtioPCIDevice *dev;
|
||||||
QTestState *qts = dev1->pdev->bus->qts;
|
QTestState *qts = dev1->pdev->bus->qts;
|
||||||
|
|
||||||
|
if (dev1->pdev->bus->not_hotpluggable) {
|
||||||
|
g_test_skip("pci bus does not support hotplug");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* plug secondary disk */
|
/* plug secondary disk */
|
||||||
qtest_qmp_device_add(qts, "virtio-blk-pci", "drv1",
|
qtest_qmp_device_add(qts, "virtio-blk-pci", "drv1",
|
||||||
"{'addr': %s, 'drive': 'drive1'}",
|
"{'addr': %s, 'drive': 'drive1'}",
|
||||||
|
|
|
@ -173,6 +173,11 @@ static void hotplug(void *obj, void *data, QGuestAllocator *t_alloc)
|
||||||
QTestState *qts = dev->pdev->bus->qts;
|
QTestState *qts = dev->pdev->bus->qts;
|
||||||
const char *arch = qtest_get_arch();
|
const char *arch = qtest_get_arch();
|
||||||
|
|
||||||
|
if (dev->pdev->bus->not_hotpluggable) {
|
||||||
|
g_test_skip("pci bus does not support hotplug");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
qtest_qmp_device_add(qts, "virtio-net-pci", "net1",
|
qtest_qmp_device_add(qts, "virtio-net-pci", "net1",
|
||||||
"{'addr': %s}", stringify(PCI_SLOT_HP));
|
"{'addr': %s}", stringify(PCI_SLOT_HP));
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,11 @@ static void rng_hotplug(void *obj, void *data, QGuestAllocator *alloc)
|
||||||
QVirtioPCIDevice *dev = obj;
|
QVirtioPCIDevice *dev = obj;
|
||||||
QTestState *qts = dev->pdev->bus->qts;
|
QTestState *qts = dev->pdev->bus->qts;
|
||||||
|
|
||||||
|
if (dev->pdev->bus->not_hotpluggable) {
|
||||||
|
g_test_skip("pci bus does not support hotplug");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const char *arch = qtest_get_arch();
|
const char *arch = qtest_get_arch();
|
||||||
|
|
||||||
qtest_qmp_device_add(qts, "virtio-rng-pci", "rng1",
|
qtest_qmp_device_add(qts, "virtio-rng-pci", "rng1",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue