diff mbox series

[36/51] tests/qtest: machine-none-test: Use double quotes to pass the cpu option

Message ID 20220824094029.1634519-37-bmeng.cn@gmail.com (mailing list archive)
State New, archived
Headers show
Series tests/qtest: Enable running qtest on Windows | expand

Commit Message

Bin Meng Aug. 24, 2022, 9:40 a.m. UTC
From: Bin Meng <bin.meng@windriver.com>

Single quotes in the arguments (e.g.: -cpu 'qemu64,apic-id=0') are
not removed in the Windows environment before it is passed to the
QEMU executable. Such argument causes a failure in the QEMU CPU
option parser codes.

Change to use double quotes which works fine on all platforms.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
---

 tests/qtest/machine-none-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thomas Huth Aug. 25, 2022, 12:22 p.m. UTC | #1
On 24/08/2022 11.40, Bin Meng wrote:
> From: Bin Meng <bin.meng@windriver.com>
> 
> Single quotes in the arguments (e.g.: -cpu 'qemu64,apic-id=0') are
> not removed in the Windows environment before it is passed to the
> QEMU executable. Such argument causes a failure in the QEMU CPU
> option parser codes.
> 
> Change to use double quotes which works fine on all platforms.
> 
> Signed-off-by: Bin Meng <bin.meng@windriver.com>
> ---
> 
>   tests/qtest/machine-none-test.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/qtest/machine-none-test.c b/tests/qtest/machine-none-test.c
> index f92fab479f..31cc0bfb01 100644
> --- a/tests/qtest/machine-none-test.c
> +++ b/tests/qtest/machine-none-test.c
> @@ -81,7 +81,7 @@ static void test_machine_cpu_cli(void)
>                   " add it to cpus_map\n", arch);
>           return; /* TODO: die here to force all targets have a test */
>       }
> -    qts = qtest_initf("-machine none -cpu '%s'", cpu_model);
> +    qts = qtest_initf("-machine none -cpu \"%s\"", cpu_model);
>   
>       response = qtest_qmp(qts, "{ 'execute': 'quit' }");
>       g_assert(qdict_haskey(response, "return"));

Reviewed-by: Thomas Huth <thuth@redhat.com>
diff mbox series

Patch

diff --git a/tests/qtest/machine-none-test.c b/tests/qtest/machine-none-test.c
index f92fab479f..31cc0bfb01 100644
--- a/tests/qtest/machine-none-test.c
+++ b/tests/qtest/machine-none-test.c
@@ -81,7 +81,7 @@  static void test_machine_cpu_cli(void)
                 " add it to cpus_map\n", arch);
         return; /* TODO: die here to force all targets have a test */
     }
-    qts = qtest_initf("-machine none -cpu '%s'", cpu_model);
+    qts = qtest_initf("-machine none -cpu \"%s\"", cpu_model);
 
     response = qtest_qmp(qts, "{ 'execute': 'quit' }");
     g_assert(qdict_haskey(response, "return"));