Skip to content

tests/qtest: add some tests for virtio-net failover

Laurent Vivier qemu-devel 8 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest4 patches 1 replyIn review
  2. v74 patches 5 repliesSuperseded
  3. v66 patches 11 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v54 patches5 repliesSuperseded
v43 patches1 replySuperseded
v35 patches0 repliesSuperseded
v22 patches0 repliesSuperseded
v13 patches2 repliesSuperseded

Changes in v8 from the cover letter

- fix checkpatch.pl error (space after "(")
- fix sanitizer errors:
* migrate_status() qobject_unref() cleanup
* release QVirtioPCIDevice with qos_object_destroy()
* add a missing g_free() in qpci_secondary_buses_rec()
* add qobject_unref() in get_bus() and find_device() when an object is popped from a list.

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4qtest/libqos: add a function to initialize secondary PCI busesinclude/hw/pci/pci_bridge.h tests/qtest/libqos/pci.c tests/qtest/libqos/pci.h+128 -00 replies
2/4tests/qtest: add some tests for virtio-net failovertests/qtest/meson.build tests/qtest/virtio-net-failover.c+792 -00 replies
3/4test/libqtest: add some virtio-net failover migration cancelling teststests/qtest/virtio-net-failover.c+282 -00 replies
4/4tests/libqtest: add a migration test with two couples of failover devicestests/qtest/virtio-net-failover.c+282 -00 replies

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchThomas Huth
1/4A-b
2/4
3/4A-b
4/4A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v8 thread

Cover letter [PATCH v8 0/4] tests/qtest: add some tests for virtio-net failover

This series adds a qtest entry to test virtio-net failover feature.

We check following error cases:

- check missing id on device with failover_pair_id triggers an error
- check a primary device plugged on a bus that doesn't support hotplug triggers an error

We check the status of the machine before and after hotplugging cards and feature negotiation:

- check we don't see the primary device at boot if failover is on
- check we see the primary device at boot if failover is off
- check we don't see the primary device if failover is on
but failover_pair_id is not the one with on (I think this should be changed)
- check the primary device is plugged after the feature negotiation
- check the result if the primary device is plugged before standby device and vice-versa
- check the if the primary device is coldplugged and the standy device hotplugged and vice-versa
- check the migration triggers the unplug and the hotplug

There is one preliminary patch in the series:

- PATCH 1 introduces a function to enable PCI bridge. Failover needs to be plugged on a pcie-root-port and while the root port is not configured the cards behind it are not available

v8:
- fix checkpatch.pl error (space after "(")
- fix sanitizer errors:
* migrate_status() qobject_unref() cleanup
* release QVirtioPCIDevice with qos_object_destroy()
* add a missing g_free() in qpci_secondary_buses_rec()
* add qobject_unref() in get_bus() and find_device() when an object is popped from a list.

v7:
- merge patch 3 and 4 as the fix for ACPI unplug has been merged
- address Thomas' comments
- add a dependency on slirp in meson.build
- check FAILOVER_NEGOCIATED device-id and MIGRATION status on destination, update UNPLUG_PRIMARY event checking
- fix an object_unref() in test_migrate_abort_active()
- fix typo s/whan/when/

v6:
- manage more than 2 root ports
- add a function to check if a card is available or not
- check migration state
- add cancelled migration test cases
- rename tests

v5:
- re-add the wait-unplug test that has been removed from v4 by mistake.

v4:
- rely on query-migrate status to know the migration state rather than to wait the STOP event.
- remove the patch to add time out to qtest_qmp_eventwait()

v3:
- fix a bug with ACPI unplug and add the related test

v2:
- remove PATCH 1 that introduced a function that can be replaced by qobject_to_json_pretty() (Markus)
- Add migration to a file and from the file to check the card is correctly unplugged on the source, and hotplugged on the dest
- Add an ACPI call to eject the card as the kernel would do

Laurent Vivier (4):
qtest/libqos: add a function to initialize secondary PCI buses tests/qtest: add some tests for virtio-net failover test/libqtest: add some virtio-net failover migration cancelling tests tests/libqtest: add a migration test with two couples of failover
devices

 include/hw/pci/pci_bridge.h       |    8 +
 tests/qtest/libqos/pci.c          |  119 +++
 tests/qtest/libqos/pci.h          |    1 +
 tests/qtest/meson.build           |    4 +
 tests/qtest/virtio-net-failover.c | 1352 +++++++++++++++++++++++++++++
 5 files changed, 1484 insertions(+)
 create mode 100644 tests/qtest/virtio-net-failover.c
Signature · 1 line
2.33.1