summaryrefslogtreecommitdiff
path: root/usr/src/test
diff options
context:
space:
mode:
authorPatrick Mooney <pmooney@pfmooney.com>2022-09-24 03:39:47 +0000
committerPatrick Mooney <pmooney@oxide.computer>2022-09-28 21:13:16 +0000
commit17e9e0ae7132604963fd5a20e8ece5f2630e7fdf (patch)
treea4808b8bcf23a0ba0093ad0d2c2ac80e80976623 /usr/src/test
parentb7335573a496fd332333ccc5718fb23ea11815ba (diff)
downloadillumos-gate-17e9e0ae7132604963fd5a20e8ece5f2630e7fdf.tar.gz
15008 expose bhyve kernel interface version wider
Reviewed by: Marco van Wieringen <mvw@planets.elm.net> Reviewed by: Andy Fiddaman <illumos@fiddaman.net> Approved by: Dan McDonald <danmcd@mnx.io>
Diffstat (limited to 'usr/src/test')
-rw-r--r--usr/src/test/bhyve-tests/tests/vmm/interface_version.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/usr/src/test/bhyve-tests/tests/vmm/interface_version.c b/usr/src/test/bhyve-tests/tests/vmm/interface_version.c
index b3de2f4f4f..58ef314e2c 100644
--- a/usr/src/test/bhyve-tests/tests/vmm/interface_version.c
+++ b/usr/src/test/bhyve-tests/tests/vmm/interface_version.c
@@ -18,9 +18,13 @@
#include <stdlib.h>
#include <fcntl.h>
#include <libgen.h>
+#include <err.h>
#include <sys/vmm.h>
#include <sys/vmm_dev.h>
+#include <vmmapi.h>
+
+#include "common.h"
int
main(int argc, char *argv[])
@@ -41,8 +45,24 @@ main(int argc, char *argv[])
version, VMM_CURRENT_INTERFACE_VERSION);
return (EXIT_FAILURE);
}
-
(void) close(ctl_fd);
+
+ /* Query the version via an instance fd as well */
+ struct vmctx *ctx = create_test_vm(suite_name);
+ if (ctx == NULL) {
+ err(EXIT_FAILURE, "could not open test VM");
+ }
+ version = ioctl(vm_get_device_fd(ctx), VMM_INTERFACE_VERSION, 0);
+ if (version < 0) {
+ err(EXIT_FAILURE,
+ "VMM_INTERFACE_VERSION ioctl failed on vmm fd");
+ }
+ if (version != VMM_CURRENT_INTERFACE_VERSION) {
+ errx(EXIT_FAILURE, "kernel version %d != expected %d",
+ version, VMM_CURRENT_INTERFACE_VERSION);
+ }
+ vm_destroy(ctx);
+
(void) printf("%s\tPASS\n", suite_name);
return (0);
}