test/qtest: Fix coding style in device-plug-test.c

We should not mix declarations and statements in QEMU code.

Signed-off-by: Fabiano Rosas <farosas@suse.de>
Message-Id: <20230208194700.11035-7-farosas@suse.de>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Fabiano Rosas 2023-02-08 16:46:54 -03:00 committed by Thomas Huth
parent a2da5e2f30
commit ca7d9f5f28

View File

@ -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);