diff --git a/lib/libc/gen/exterr_cat_filenames.h b/lib/libc/gen/exterr_cat_filenames.h --- a/lib/libc/gen/exterr_cat_filenames.h +++ b/lib/libc/gen/exterr_cat_filenames.h @@ -2,6 +2,7 @@ * Automatically @generated, use * tools/build/make_libc_exterr_cat_filenames.sh */ + [EXTERR_CAT_VMM] = "dev/vmm/vmm_dev.c", [EXTERR_CAT_FUSE_DEVICE] = "fs/fuse/fuse_device.c", [EXTERR_CAT_FUSE_VFS] = "fs/fuse/fuse_vfsops.c", [EXTERR_CAT_FUSE_VNOPS] = "fs/fuse/fuse_vnops.c", diff --git a/sys/dev/vmm/vmm_dev.c b/sys/dev/vmm/vmm_dev.c --- a/sys/dev/vmm/vmm_dev.c +++ b/sys/dev/vmm/vmm_dev.c @@ -8,6 +8,8 @@ #include #include +#define EXTERR_CATEGORY EXTERR_CAT_VMM +#include #include #include #include @@ -1008,7 +1010,8 @@ if ((flags & VMMCTL_CREATE_DESTROY_ON_CLOSE) == 0 && (error = priv_check_cred(cred, PRIV_VMM_CREATE)) != 0) { sx_xunlock(&vmmdev_mtx); - return (error); + return (EXTERROR(error, + "An unprivileged user must run VMs in monitor mode")); } error = vm_create(name, &vm); diff --git a/sys/sys/exterr_cat.h b/sys/sys/exterr_cat.h --- a/sys/sys/exterr_cat.h +++ b/sys/sys/exterr_cat.h @@ -37,6 +37,7 @@ #define EXTERR_CAT_GEOM 12 #define EXTERR_CAT_FUSE_VFS 13 #define EXTERR_CAT_FUSE_DEVICE 14 +#define EXTERR_CAT_VMM 15 #endif