diff mbox series

[8/8] tests/qtest/migration-test: Allow running with HVF

Message ID 20230119100537.5114-9-philmd@linaro.org
State New
Headers show
Series tests/qtest: Allow running boot-serial / migration with TCG disabled | expand

Commit Message

Philippe Mathieu-Daudé Jan. 19, 2023, 10:05 a.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 tests/qtest/migration-test.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Dr. David Alan Gilbert Jan. 19, 2023, 11:13 a.m. UTC | #1
* Philippe Mathieu-Daudé (philmd@linaro.org) wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Does it support migration? I don't remember anyone ever mentioning it.

Dave

> ---
>  tests/qtest/migration-test.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
> index 1e7f1ea162..7a0fcfb81d 100644
> --- a/tests/qtest/migration-test.c
> +++ b/tests/qtest/migration-test.c
> @@ -47,6 +47,7 @@ unsigned start_address;
>  unsigned end_address;
>  static bool has_tcg;
>  static bool has_kvm;
> +static bool has_hvf;
>  static bool uffd_feature_thread_id;
>  
>  /*
> @@ -614,6 +615,9 @@ static int test_migrate_start(QTestState **from, QTestState **to,
>                                 args->use_dirty_ring
>                                 ? ",dirty-ring-size=4096" : "");
>      }
> +    if (has_hvf) {
> +        g_string_append(cmd_common, "-accel hvf ");
> +    }
>  
>      bootpath = g_strdup_printf("%s/bootsect", tmpfs);
>      if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
> @@ -2472,6 +2476,7 @@ int main(int argc, char **argv)
>  
>      has_tcg = qtest_has_accel("tcg");
>      has_kvm = qtest_has_accel("kvm");
> +    has_hvf = qtest_has_accel("hvf");
>  
>      g_test_init(&argc, &argv, NULL);
>  
> -- 
> 2.38.1
>
Philippe Mathieu-Daudé Jan. 19, 2023, 11:31 a.m. UTC | #2
On 19/1/23 12:13, Dr. David Alan Gilbert wrote:
> * Philippe Mathieu-Daudé (philmd@linaro.org) wrote:
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> 
> Does it support migration? I don't remember anyone ever mentioning it.

The test doesn't fail, but I have no idea what that means...

>> ---
>>   tests/qtest/migration-test.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
>> index 1e7f1ea162..7a0fcfb81d 100644
>> --- a/tests/qtest/migration-test.c
>> +++ b/tests/qtest/migration-test.c
>> @@ -47,6 +47,7 @@ unsigned start_address;
>>   unsigned end_address;
>>   static bool has_tcg;
>>   static bool has_kvm;
>> +static bool has_hvf;
>>   static bool uffd_feature_thread_id;
>>   
>>   /*
>> @@ -614,6 +615,9 @@ static int test_migrate_start(QTestState **from, QTestState **to,
>>                                  args->use_dirty_ring
>>                                  ? ",dirty-ring-size=4096" : "");
>>       }
>> +    if (has_hvf) {
>> +        g_string_append(cmd_common, "-accel hvf ");
>> +    }
>>   
>>       bootpath = g_strdup_printf("%s/bootsect", tmpfs);
>>       if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
>> @@ -2472,6 +2476,7 @@ int main(int argc, char **argv)
>>   
>>       has_tcg = qtest_has_accel("tcg");
>>       has_kvm = qtest_has_accel("kvm");
>> +    has_hvf = qtest_has_accel("hvf");
>>   
>>       g_test_init(&argc, &argv, NULL);
>>   
>> -- 
>> 2.38.1
>>
diff mbox series

Patch

diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 1e7f1ea162..7a0fcfb81d 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -47,6 +47,7 @@  unsigned start_address;
 unsigned end_address;
 static bool has_tcg;
 static bool has_kvm;
+static bool has_hvf;
 static bool uffd_feature_thread_id;
 
 /*
@@ -614,6 +615,9 @@  static int test_migrate_start(QTestState **from, QTestState **to,
                                args->use_dirty_ring
                                ? ",dirty-ring-size=4096" : "");
     }
+    if (has_hvf) {
+        g_string_append(cmd_common, "-accel hvf ");
+    }
 
     bootpath = g_strdup_printf("%s/bootsect", tmpfs);
     if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
@@ -2472,6 +2476,7 @@  int main(int argc, char **argv)
 
     has_tcg = qtest_has_accel("tcg");
     has_kvm = qtest_has_accel("kvm");
+    has_hvf = qtest_has_accel("hvf");
 
     g_test_init(&argc, &argv, NULL);