Skip to content
Snippets Groups Projects
Commit 459a5da9 authored by Alan Stokes's avatar Alan Stokes
Browse files

Don't check for /dev/kvm etc

Check the properties instead (capability not implementation).

Bug: 218276733
Test: atest VirtualizationTestCases.64
Change-Id: Ifa5d463effb09b30d0166c0bfde13da86978d90c
parent 83b12765
No related branches found
No related tags found
No related merge requests found
......@@ -14,14 +14,22 @@
* limitations under the License.
*/
#include <android/sysprop/HypervisorProperties.sysprop.h>
#include "virt/VirtualizationTest.h"
using android::sysprop::HypervisorProperties::hypervisor_protected_vm_supported;
using android::sysprop::HypervisorProperties::hypervisor_vm_supported;
namespace {
bool isVmSupported() {
const std::array<const char *, 4> needed_files = {
"/dev/kvm",
"/dev/vhost-vsock",
bool has_capability = hypervisor_vm_supported().value_or(false) ||
hypervisor_protected_vm_supported().value_or(false);
if (!has_capability) {
return false;
}
const std::array<const char *, 2> needed_files = {
"/apex/com.android.virt/bin/crosvm",
"/apex/com.android.virt/bin/virtualizationservice",
};
......
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