mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-24 20:48:55 +00:00
1dab58a2cf
This search/replace updates all copyright notices to drop the "All rights reserved", Use "ChromiumOS" instead of "Chromium OS" and drops the trailing dots. This fulfills the request from legal and unifies our notices. ./tools/health-check has been updated to only accept this style. BUG=b:246579983 TEST=./tools/health-check Change-Id: I87a80701dc651f1baf4820e5cc42469d7c5f5bf7 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3894243 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Dennis Kempin <denniskempin@google.com>
53 lines
1.3 KiB
C
53 lines
1.3 KiB
C
/*
|
|
* Copyright 2018 The ChromiumOS Authors
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#include <errno.h>
|
|
#include <fcntl.h>
|
|
#include <linux/memfd.h>
|
|
#include <pthread.h>
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <sys/mman.h>
|
|
#include <sys/syscall.h>
|
|
#include <time.h>
|
|
#include <unistd.h>
|
|
|
|
#include "crosvm.h"
|
|
|
|
int main(int argc, char** argv) {
|
|
struct crosvm *crosvm;
|
|
int ret = crosvm_connect(&crosvm);
|
|
if (ret) {
|
|
fprintf(stderr, "failed to connect to crosvm: %d\n", ret);
|
|
return 1;
|
|
}
|
|
|
|
bool supported;
|
|
ret = crosvm_check_extension(crosvm, KVM_CAP_IRQCHIP, &supported);
|
|
if (ret) {
|
|
fprintf(stderr, "failed to check for KVM extension: %d\n", ret);
|
|
return 1;
|
|
}
|
|
if (!supported) {
|
|
fprintf(stderr, "expected KVM extension to be supported\n");
|
|
return 1;
|
|
}
|
|
|
|
// Assume s390 extensions aren't supported because we shouldn't be running on one.
|
|
ret = crosvm_check_extension(crosvm, KVM_CAP_S390_PSW, &supported);
|
|
if (ret) {
|
|
fprintf(stderr, "failed to check for KVM extension: %d\n", ret);
|
|
return 1;
|
|
}
|
|
if (supported) {
|
|
fprintf(stderr, "unexpected KVM extension is supported\n");
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|