diff options
author | neel <neel@FreeBSD.org> | 2014-06-07 21:36:52 +0000 |
---|---|---|
committer | neel <neel@FreeBSD.org> | 2014-06-07 21:36:52 +0000 |
commit | 80a67d54c42b7f1e683d37864b9634e252d32ef1 (patch) | |
tree | 87873f56f85dfd15e0b36f4a2e884ae8dbcb74b3 /lib/libvmmapi | |
parent | 39548e640ff6f29c6f53200627311914539728c3 (diff) | |
download | FreeBSD-src-80a67d54c42b7f1e683d37864b9634e252d32ef1.zip FreeBSD-src-80a67d54c42b7f1e683d37864b9634e252d32ef1.tar.gz |
Add ioctl(VM_REINIT) to reinitialize the virtual machine state maintained
by vmm.ko. This allows the virtual machine to be restarted without having
to destroy it first.
Reviewed by: grehan
Diffstat (limited to 'lib/libvmmapi')
-rw-r--r-- | lib/libvmmapi/vmmapi.c | 7 | ||||
-rw-r--r-- | lib/libvmmapi/vmmapi.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c index 89c7825..5ce3d8e 100644 --- a/lib/libvmmapi/vmmapi.c +++ b/lib/libvmmapi/vmmapi.c @@ -367,6 +367,13 @@ vm_suspend(struct vmctx *ctx, enum vm_suspend_how how) return (ioctl(ctx->fd, VM_SUSPEND, &vmsuspend)); } +int +vm_reinit(struct vmctx *ctx) +{ + + return (ioctl(ctx->fd, VM_REINIT, 0)); +} + static int vm_inject_exception_real(struct vmctx *ctx, int vcpu, int vector, int error_code, int error_code_valid) diff --git a/lib/libvmmapi/vmmapi.h b/lib/libvmmapi/vmmapi.h index 0f2e3ae..4cc4290 100644 --- a/lib/libvmmapi/vmmapi.h +++ b/lib/libvmmapi/vmmapi.h @@ -69,6 +69,7 @@ int vm_get_register(struct vmctx *ctx, int vcpu, int reg, uint64_t *retval); int vm_run(struct vmctx *ctx, int vcpu, uint64_t rip, struct vm_exit *ret_vmexit); int vm_suspend(struct vmctx *ctx, enum vm_suspend_how how); +int vm_reinit(struct vmctx *ctx); int vm_apicid2vcpu(struct vmctx *ctx, int apicid); int vm_inject_exception(struct vmctx *ctx, int vcpu, int vec); int vm_inject_exception2(struct vmctx *ctx, int vcpu, int vec, int errcode); |