Skip to content
Snippets Groups Projects
Commit 44d3d898 authored by Igor Mammedov's avatar Igor Mammedov Committed by Michael S. Tsirkin
Browse files

qtest: fix 'expression is always false' build failure in qtest_has_accel()


If KVM is disabled or not present, qtest library build
may fail with:
   libqtest.c: In function 'qtest_has_accel':
      comparison of unsigned expression < 0 is always false
      [-Werror=type-limits]
         for (i = 0; i < ARRAY_SIZE(targets); i++) {

due to empty 'targets' array.
Fix it by making sure that CONFIG_KVM_TARGETS isn't empty.

Fixes: e741aff0 ("tests: qtest: add qtest_has_accel() to check if tested binary supports accelerator")
Reported-by: default avatarJason Andryuk <jandryuk@gmail.com>
Suggested-by: default avatar"Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: default avatarIgor Mammedov <imammedo@redhat.com>
Message-Id: <20211027151012.2639284-1-imammedo@redhat.com>
Tested-by: default avatarJason Andryuk <jandryuk@gmail.com>
Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent af531756
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment