From: Fabiano Rosas <faro...@suse.de>

We should not mix declarations and statements in QEMU code.

Signed-off-by: Fabiano Rosas <faro...@suse.de>
Message-Id: <20230208194700.11035-7-faro...@suse.de>
Reviewed-by: Thomas Huth <th...@redhat.com>
Signed-off-by: Thomas Huth <th...@redhat.com>
---
 tests/qtest/device-plug-test.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/qtest/device-plug-test.c b/tests/qtest/device-plug-test.c
index 5a6afa2b57..4f92617335 100644
--- a/tests/qtest/device-plug-test.c
+++ b/tests/qtest/device-plug-test.c
@@ -64,6 +64,7 @@ static void process_device_remove(QTestState *qtest, const 
char *id)
 
 static void test_pci_unplug_request(void)
 {
+    QTestState *qtest;
     const char *arch = qtest_get_arch();
     const char *machine_addition = "";
 
@@ -71,8 +72,8 @@ static void test_pci_unplug_request(void)
         machine_addition = "-machine pc";
     }
 
-    QTestState *qtest = qtest_initf("%s -device virtio-mouse-pci,id=dev0",
-                                    machine_addition);
+    qtest = qtest_initf("%s -device virtio-mouse-pci,id=dev0",
+                        machine_addition);
 
     process_device_remove(qtest, "dev0");
 
@@ -94,6 +95,7 @@ static void test_q35_pci_unplug_request(void)
 
 static void test_pci_unplug_json_request(void)
 {
+    QTestState *qtest;
     const char *arch = qtest_get_arch();
     const char *machine_addition = "";
 
@@ -101,7 +103,7 @@ static void test_pci_unplug_json_request(void)
         machine_addition = "-machine pc";
     }
 
-    QTestState *qtest = qtest_initf(
+    qtest = qtest_initf(
         "%s -device \"{'driver': 'virtio-mouse-pci', 'id': 'dev0'}\"",
         machine_addition);
 
-- 
2.31.1


Reply via email to