diff options
author | Patrick Mooney <pmooney@pfmooney.com> | 2022-09-06 11:35:56 -0500 |
---|---|---|
committer | Patrick Mooney <pmooney@oxide.computer> | 2022-09-26 20:06:16 +0000 |
commit | 42640e499ab380f595753ffb5c3607d030e5cff3 (patch) | |
tree | c43fc7ca7b9d413efe780ea5cfce6794ce840ccb /usr/src/lib | |
parent | 1b6debbb96f2c66931b6ec520e8dd07ece57d2dd (diff) | |
download | illumos-gate-42640e499ab380f595753ffb5c3607d030e5cff3.tar.gz |
14963 bhyve destroy should be more robust
14968 bhyve needs self-destroy ioctl
Reviewed by: Andy Fiddaman <illumos@fiddaman.net>
Reviewed by: Michael Zeller <mike@mikezeller.net>
Approved by: Dan McDonald <danmcd@mnx.io>
Diffstat (limited to 'usr/src/lib')
-rw-r--r-- | usr/src/lib/libvmmapi/common/vmmapi.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/usr/src/lib/libvmmapi/common/vmmapi.c b/usr/src/lib/libvmmapi/common/vmmapi.c index 540cbf0bc5..a3c00d616b 100644 --- a/usr/src/lib/libvmmapi/common/vmmapi.c +++ b/usr/src/lib/libvmmapi/common/vmmapi.c @@ -39,7 +39,7 @@ * * Copyright 2015 Pluribus Networks Inc. * Copyright 2019 Joyent, Inc. - * Copyright 2021 Oxide Computer Company + * Copyright 2022 Oxide Computer Company */ #include <sys/cdefs.h> @@ -182,18 +182,14 @@ vm_close(struct vmctx *vm) void vm_destroy(struct vmctx *vm) { - struct vm_destroy_req req; - assert(vm != NULL); if (vm->fd >= 0) { + (void) ioctl(vm->fd, VM_DESTROY_SELF, 0); (void) close(vm->fd); vm->fd = -1; } - (void) strncpy(req.name, vm->name, VM_MAX_NAMELEN); - (void) vm_do_ctl(VMM_DESTROY_VM, &req); - free(vm); } #endif |