qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 06/12] tests/qtest: Skip unplug tests that use missing device


From: Thomas Huth
Subject: Re: [PATCH 06/12] tests/qtest: Skip unplug tests that use missing devices
Date: Tue, 7 Feb 2023 14:59:47 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0

On 06/02/2023 16.04, Fabiano Rosas wrote:
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
  tests/qtest/device-plug-test.c | 19 +++++++++++++++++++
  1 file changed, 19 insertions(+)

diff --git a/tests/qtest/device-plug-test.c b/tests/qtest/device-plug-test.c
index 5a6afa2b57..931acbdf50 100644
--- a/tests/qtest/device-plug-test.c
+++ b/tests/qtest/device-plug-test.c
@@ -67,6 +67,11 @@ static void test_pci_unplug_request(void)
      const char *arch = qtest_get_arch();
      const char *machine_addition = "";
+ if (!qtest_has_device("virtio-mouse-pci")) {
+        g_test_skip("Device virtio-mouse-pci not available");
+        return;
+    }
+
      if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
          machine_addition = "-machine pc";
      }
@@ -81,6 +86,10 @@ static void test_pci_unplug_request(void)
static void test_q35_pci_unplug_request(void)
  {
+    if (!qtest_has_device("virtio-mouse-pci")) {
+        g_test_skip("Device virtio-mouse-pci not available");
+        return;
+    }
QTestState *qtest = qtest_initf("-machine q35 "
                                      "-device pcie-root-port,id=p1 "

This seems to break the QEMU coding style ("Mixed declarations (interleaving statements and declarations within blocks) are generally not allowed; declarations should be at the beginning of blocks.") ... could you separate the declaration of qtest from its initialization now, please?

 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]