From 66c806009d73e4ee42e41925c6afcb7b99b51710 Mon Sep 17 00:00:00 2001 From: Laine Stump Date: Wed, 22 Feb 2017 12:35:49 -0500 Subject: [PATCH] test: fix pcie-root-port-too-many test While reviewing a patch from Andrea that modified this test case, I realized that although it was "properly failing" (it's a negative test), that it was failing for the wrong reason (the MULTIFUNCTION cap wasn't set in the test case, so it was saying that multifunction=on wasn't supported by the QEMU binary; instead it should have been complaining that it had run out of PCI slots of the appropriate type and couldn't automatically add any more). This improper failure had started when I added the patch to automatically aggregate pcie-root-ports onto multiple functions of each pcie-root slot, but I hadn't noticed it because the test still failed. This patch corrects the test case to 1) set the MULTIFUNCTION flag in the caps, and 2) attempt to add 241 pcie-root-ports to a domain. Since there are 30 slots available on a pcie-root (slot 0 is reserved, and slot 31 is used by the integrated SATA controller), and a pcie-root-port can only be placed on a function of a slot on pcie-root, the maximum number of pcie-root-ports in any domain is 240. --- .../qemuxml2argv-pcie-root-port-too-many.xml | 273 ++++++++++++++++-- tests/qemuxml2argvtest.c | 1 + 2 files changed, 242 insertions(+), 32 deletions(-) diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-too-many.xml b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-too-many.xml index 5234e3b132..d7ac64a3ea 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-too-many.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-too-many.xml @@ -20,41 +20,250 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index b03644bdfa..694d656508 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2048,6 +2048,7 @@ mymain(void) DO_TEST_PARSE_ERROR("pcie-root-port-too-many", QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, + QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_QXL);