diff options
author | Neel Natu <neel@FreeBSD.org> | 2014-06-07 21:36:52 +0000 |
---|---|---|
committer | Neel Natu <neel@FreeBSD.org> | 2014-06-07 21:36:52 +0000 |
commit | 5fcf252f410e7784626d6d5d0e75042be23d4f24 (patch) | |
tree | 87873f56f85dfd15e0b36f4a2e884ae8dbcb74b3 /lib/libvmmapi | |
parent | dd05fa1945f915a29b23ff9f0450b00df0e89e68 (diff) | |
download | src-5fcf252f410e7784626d6d5d0e75042be23d4f24.tar.gz src-5fcf252f410e7784626d6d5d0e75042be23d4f24.zip |
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
Notes
Notes:
svn path=/head/; revision=267216
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 89c782520bcc..5ce3d8e7ae82 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 0f2e3ae57a49..4cc429065e46 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); |