On 27/10/21 09:45, Igor Mammedov wrote:
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 compiling KVM related part only if CONFIG_KVM_TARGETS is set.
Another possibility is to add a trailing NULL to the array and change the loop to "for (i = 0; targets[i]; i++)".
Paolo