From 52fac30e3e977464254b44b1dfb4717fb8d2fbde Mon Sep 17 00:00:00 2001 From: Patrick Mooney Date: Mon, 16 Aug 2021 21:04:25 +0000 Subject: 14024 bhyve vm_suspend should be more flexible Reviewed by: Dan Cross Reviewed by: Luqman Aden Reviewed by: Joshua M. Clulow Approved by: Dan McDonald --- usr/src/lib/libvmmapi/common/vmmapi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'usr/src/lib/libvmmapi/common/vmmapi.c') diff --git a/usr/src/lib/libvmmapi/common/vmmapi.c b/usr/src/lib/libvmmapi/common/vmmapi.c index ec27949a43..c074d999c6 100644 --- a/usr/src/lib/libvmmapi/common/vmmapi.c +++ b/usr/src/lib/libvmmapi/common/vmmapi.c @@ -822,12 +822,24 @@ vm_suspend(struct vmctx *ctx, enum vm_suspend_how how) return (ioctl(ctx->fd, VM_SUSPEND, &vmsuspend)); } +#ifndef __FreeBSD__ +int +vm_reinit(struct vmctx *ctx, uint64_t flags) +{ + struct vm_reinit reinit = { + .flags = flags + }; + + return (ioctl(ctx->fd, VM_REINIT, &reinit)); +} +#else int vm_reinit(struct vmctx *ctx) { return (ioctl(ctx->fd, VM_REINIT, 0)); } +#endif int vm_inject_exception(struct vmctx *ctx, int vcpu, int vector, int errcode_valid, -- cgit v1.2.3