pseries: disable migration-test if /dev/kvm cannot be used
diff mbox series

Message ID 20191120170955.242900-1-lvivier@redhat.com
State New
Headers show
Series
  • pseries: disable migration-test if /dev/kvm cannot be used
Related show

Commit Message

Laurent Vivier Nov. 20, 2019, 5:09 p.m. UTC
On ppc64, migration-test only works with kvm_hv, and we already
have a check to verify the module is loaded.

kvm_hv module can be loaded in memory and /sys/module/kvm_hv exists,
but on some systems (like build systems) /dev/kvm can be missing
(by administrators choice).

And as kvm_hv exists test-migration is started but QEMU falls back to
TCG because it cannot be used:

    Could not access KVM kernel module: No such file or directory
    failed to initialize KVM: No such file or directory
    Back to tcg accelerator

And as the test is done with TCG, it fails.

As for s390x, we must check for the existence and the access rights
of /dev/kvm.

Reported-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 tests/migration-test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Thomas Huth Nov. 20, 2019, 5:40 p.m. UTC | #1
On 20/11/2019 18.09, Laurent Vivier wrote:
> On ppc64, migration-test only works with kvm_hv, and we already
> have a check to verify the module is loaded.
> 
> kvm_hv module can be loaded in memory and /sys/module/kvm_hv exists,
> but on some systems (like build systems) /dev/kvm can be missing
> (by administrators choice).
> 
> And as kvm_hv exists test-migration is started but QEMU falls back to
> TCG because it cannot be used:
> 
>     Could not access KVM kernel module: No such file or directory
>     failed to initialize KVM: No such file or directory
>     Back to tcg accelerator
> 
> And as the test is done with TCG, it fails.
> 
> As for s390x, we must check for the existence and the access rights
> of /dev/kvm.
> 
> Reported-by: Cole Robinson <crobinso@redhat.com>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>  tests/migration-test.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/migration-test.c b/tests/migration-test.c
> index ac780dffdaad..2b25ba6d77f6 100644
> --- a/tests/migration-test.c
> +++ b/tests/migration-test.c
> @@ -1349,7 +1349,8 @@ int main(int argc, char **argv)
>       * some reason)
>       */
>      if (g_str_equal(qtest_get_arch(), "ppc64") &&
> -        access("/sys/module/kvm_hv", F_OK)) {
> +        (access("/sys/module/kvm_hv", F_OK) ||
> +         access("/dev/kvm", R_OK | W_OK))) {
>          g_test_message("Skipping test: kvm_hv not available");
>          return g_test_run();
>      }
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>
Greg Kurz Nov. 20, 2019, 6:33 p.m. UTC | #2
On Wed, 20 Nov 2019 18:09:55 +0100
Laurent Vivier <lvivier@redhat.com> wrote:

> On ppc64, migration-test only works with kvm_hv, and we already
> have a check to verify the module is loaded.
> 
> kvm_hv module can be loaded in memory and /sys/module/kvm_hv exists,
> but on some systems (like build systems) /dev/kvm can be missing
> (by administrators choice).
> 
> And as kvm_hv exists test-migration is started but QEMU falls back to
> TCG because it cannot be used:
> 
>     Could not access KVM kernel module: No such file or directory
>     failed to initialize KVM: No such file or directory
>     Back to tcg accelerator
> 
> And as the test is done with TCG, it fails.
> 
> As for s390x, we must check for the existence and the access rights
> of /dev/kvm.
> 
> Reported-by: Cole Robinson <crobinso@redhat.com>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---

Reviewed-by: Greg Kurz <groug@kaod.org>

>  tests/migration-test.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/migration-test.c b/tests/migration-test.c
> index ac780dffdaad..2b25ba6d77f6 100644
> --- a/tests/migration-test.c
> +++ b/tests/migration-test.c
> @@ -1349,7 +1349,8 @@ int main(int argc, char **argv)
>       * some reason)
>       */
>      if (g_str_equal(qtest_get_arch(), "ppc64") &&
> -        access("/sys/module/kvm_hv", F_OK)) {
> +        (access("/sys/module/kvm_hv", F_OK) ||
> +         access("/dev/kvm", R_OK | W_OK))) {
>          g_test_message("Skipping test: kvm_hv not available");
>          return g_test_run();
>      }
Juan Quintela Nov. 21, 2019, 7:18 a.m. UTC | #3
Laurent Vivier <lvivier@redhat.com> wrote:
> On ppc64, migration-test only works with kvm_hv, and we already
> have a check to verify the module is loaded.
>
> kvm_hv module can be loaded in memory and /sys/module/kvm_hv exists,
> but on some systems (like build systems) /dev/kvm can be missing
> (by administrators choice).
>
> And as kvm_hv exists test-migration is started but QEMU falls back to
> TCG because it cannot be used:
>
>     Could not access KVM kernel module: No such file or directory
>     failed to initialize KVM: No such file or directory
>     Back to tcg accelerator
>
> And as the test is done with TCG, it fails.
>
> As for s390x, we must check for the existence and the access rights
> of /dev/kvm.
>
> Reported-by: Cole Robinson <crobinso@redhat.com>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>

Reviewed-by: Juan Quintela <quintela@redhat.com>

Oh, why it is so difficult!!!

Thanks, Juan.
Laurent Vivier Nov. 21, 2019, 8:08 a.m. UTC | #4
On 21/11/2019 08:18, Juan Quintela wrote:
> Laurent Vivier <lvivier@redhat.com> wrote:
>> On ppc64, migration-test only works with kvm_hv, and we already
>> have a check to verify the module is loaded.
>>
>> kvm_hv module can be loaded in memory and /sys/module/kvm_hv exists,
>> but on some systems (like build systems) /dev/kvm can be missing
>> (by administrators choice).
>>
>> And as kvm_hv exists test-migration is started but QEMU falls back to
>> TCG because it cannot be used:
>>
>>     Could not access KVM kernel module: No such file or directory
>>     failed to initialize KVM: No such file or directory
>>     Back to tcg accelerator
>>
>> And as the test is done with TCG, it fails.
>>
>> As for s390x, we must check for the existence and the access rights
>> of /dev/kvm.
>>
>> Reported-by: Cole Robinson <crobinso@redhat.com>
>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> 
> Reviewed-by: Juan Quintela <quintela@redhat.com>
> 
> Oh, why it is so difficult!!!
> 
> Thanks, Juan.
> 

David,

could you add this one too to your ppc-for-4.2 queue?

Thanks,
Laurent
Juan Quintela Nov. 21, 2019, 8:30 a.m. UTC | #5
Laurent Vivier <lvivier@redhat.com> wrote:
> On 21/11/2019 08:18, Juan Quintela wrote:
>> Laurent Vivier <lvivier@redhat.com> wrote:
>>> On ppc64, migration-test only works with kvm_hv, and we already
>>> have a check to verify the module is loaded.
>>>
>>> kvm_hv module can be loaded in memory and /sys/module/kvm_hv exists,
>>> but on some systems (like build systems) /dev/kvm can be missing
>>> (by administrators choice).
>>>
>>> And as kvm_hv exists test-migration is started but QEMU falls back to
>>> TCG because it cannot be used:
>>>
>>>     Could not access KVM kernel module: No such file or directory
>>>     failed to initialize KVM: No such file or directory
>>>     Back to tcg accelerator
>>>
>>> And as the test is done with TCG, it fails.
>>>
>>> As for s390x, we must check for the existence and the access rights
>>> of /dev/kvm.
>>>
>>> Reported-by: Cole Robinson <crobinso@redhat.com>
>>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>> 
>> Reviewed-by: Juan Quintela <quintela@redhat.com>
>> 
>> Oh, why it is so difficult!!!
>> 
>> Thanks, Juan.
>> 
>
> David,
>
> could you add this one too to your ppc-for-4.2 queue?

I was about to ask if you preffered it to go through the migration tree.

David?

Later, Juan.
David Gibson Nov. 21, 2019, 9:48 a.m. UTC | #6
On Thu, Nov 21, 2019 at 09:30:27AM +0100, Juan Quintela wrote:
> Laurent Vivier <lvivier@redhat.com> wrote:
> > On 21/11/2019 08:18, Juan Quintela wrote:
> >> Laurent Vivier <lvivier@redhat.com> wrote:
> >>> On ppc64, migration-test only works with kvm_hv, and we already
> >>> have a check to verify the module is loaded.
> >>>
> >>> kvm_hv module can be loaded in memory and /sys/module/kvm_hv exists,
> >>> but on some systems (like build systems) /dev/kvm can be missing
> >>> (by administrators choice).
> >>>
> >>> And as kvm_hv exists test-migration is started but QEMU falls back to
> >>> TCG because it cannot be used:
> >>>
> >>>     Could not access KVM kernel module: No such file or directory
> >>>     failed to initialize KVM: No such file or directory
> >>>     Back to tcg accelerator
> >>>
> >>> And as the test is done with TCG, it fails.
> >>>
> >>> As for s390x, we must check for the existence and the access rights
> >>> of /dev/kvm.
> >>>
> >>> Reported-by: Cole Robinson <crobinso@redhat.com>
> >>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> >> 
> >> Reviewed-by: Juan Quintela <quintela@redhat.com>
> >> 
> >> Oh, why it is so difficult!!!
> >> 
> >> Thanks, Juan.
> >> 
> >
> > David,
> >
> > could you add this one too to your ppc-for-4.2 queue?
> 
> I was about to ask if you preffered it to go through the migration tree.
> 
> David?

Migration tree is good for me.

> 
> Later, Juan.
>
Laurent Vivier Nov. 26, 2019, 5:49 p.m. UTC | #7
Le 21/11/2019 à 09:30, Juan Quintela a écrit :
> Laurent Vivier <lvivier@redhat.com> wrote:
>> On 21/11/2019 08:18, Juan Quintela wrote:
>>> Laurent Vivier <lvivier@redhat.com> wrote:
>>>> On ppc64, migration-test only works with kvm_hv, and we already
>>>> have a check to verify the module is loaded.
>>>>
>>>> kvm_hv module can be loaded in memory and /sys/module/kvm_hv exists,
>>>> but on some systems (like build systems) /dev/kvm can be missing
>>>> (by administrators choice).
>>>>
>>>> And as kvm_hv exists test-migration is started but QEMU falls back to
>>>> TCG because it cannot be used:
>>>>
>>>>     Could not access KVM kernel module: No such file or directory
>>>>     failed to initialize KVM: No such file or directory
>>>>     Back to tcg accelerator
>>>>
>>>> And as the test is done with TCG, it fails.
>>>>
>>>> As for s390x, we must check for the existence and the access rights
>>>> of /dev/kvm.
>>>>
>>>> Reported-by: Cole Robinson <crobinso@redhat.com>
>>>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>>>
>>> Reviewed-by: Juan Quintela <quintela@redhat.com>
>>>
>>> Oh, why it is so difficult!!!
>>>
>>> Thanks, Juan.
>>>
>>
>> David,
>>
>> could you add this one too to your ppc-for-4.2 queue?
> 
> I was about to ask if you preffered it to go through the migration tree.
> 
> David?
> 
> Later, Juan.

Juan, as it's a fix it should go in rc3.

Thanks,
Laurent

Patch
diff mbox series

diff --git a/tests/migration-test.c b/tests/migration-test.c
index ac780dffdaad..2b25ba6d77f6 100644
--- a/tests/migration-test.c
+++ b/tests/migration-test.c
@@ -1349,7 +1349,8 @@  int main(int argc, char **argv)
      * some reason)
      */
     if (g_str_equal(qtest_get_arch(), "ppc64") &&
-        access("/sys/module/kvm_hv", F_OK)) {
+        (access("/sys/module/kvm_hv", F_OK) ||
+         access("/dev/kvm", R_OK | W_OK))) {
         g_test_message("Skipping test: kvm_hv not available");
         return g_test_run();
     }