Project

General

Profile

Actions

Bug #14968

closed

bhyve needs self-destroy ioctl

Added by Patrick Mooney 3 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Category:
bhyve
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

Presently, the only way to explicitly destroy a bhyve instance (ignoring the auto-destruct functionality) is to use make a VMM_DESTROY ioctl against `/dev/vmmctl`, specifying the name of the instance to destroy. Not only is this potentially race (if a VM is destroyed and recreated before the request can be made), it can also be awkward when a process is destroying a VM it has open. If the destruction is synchronous to successful completion, but the process still holds the VM fd open, there would be room for deadlock. Instead, it would be nice if userspace had an ioctl to call against an open VM fd to initiate its destruction.


Related issues

Related to illumos gate - Bug #14963: bhyve destroy should be more robustClosedPatrick Mooney

Actions
Actions #1

Updated by Electric Monk 3 months ago

  • Gerrit CR set to 2343
Actions #2

Updated by Patrick Mooney 3 months ago

  • Related to Bug #14963: bhyve destroy should be more robust added
Actions #3

Updated by Patrick Mooney 3 months ago

With the proposed fix in place, the bhyve test suite, including the new test added for this specific functionality (vmm/self_destruct) all pass:

Test: /opt/bhyve-tests/tests/mevent/vnode_zvol (run as root)      [00:02] [PASS]
Test: /opt/bhyve-tests/tests/inst_emul/rdmsr (run as root)        [00:00] [PASS]
Test: /opt/bhyve-tests/tests/inst_emul/wrmsr (run as root)        [00:00] [PASS]
Test: /opt/bhyve-tests/tests/inst_emul/triple_fault (run as root) [00:00] [PASS]
Test: /opt/bhyve-tests/tests/kdev/vatpit_freq (run as root)       [00:00] [PASS]
Test: /opt/bhyve-tests/tests/kdev/vhpet_freq (run as root)        [00:00] [PASS]
Test: /opt/bhyve-tests/tests/kdev/vlapic_freq (run as root)       [00:00] [PASS]
Test: /opt/bhyve-tests/tests/kdev/vlapic_freq_periodic (run as root) [00:00] [PASS]
Test: /opt/bhyve-tests/tests/kdev/vlapic_mmio_access (run as root) [00:00] [PASS]
Test: /opt/bhyve-tests/tests/kdev/vlapic_msr_access (run as root) [00:00] [PASS]
Test: /opt/bhyve-tests/tests/kdev/vpmtmr_freq (run as root)       [00:00] [PASS]
Test: /opt/bhyve-tests/tests/mevent/lists_delete (run as root)    [00:00] [PASS]
Test: /opt/bhyve-tests/tests/mevent/read_disable (run as root)    [00:00] [PASS]
Test: /opt/bhyve-tests/tests/mevent/read_pause (run as root)      [00:00] [PASS]
Test: /opt/bhyve-tests/tests/mevent/read_requeue (run as root)    [00:00] [PASS]
Test: /opt/bhyve-tests/tests/mevent/vnode_file (run as root)      [00:09] [PASS]
Test: /opt/bhyve-tests/tests/viona/interface_version (run as root) [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/auto_destruct (run as root)      [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/drv_hold (run as root)           [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/fpu_getset (run as root)         [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/interface_version (run as root)  [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/legacy_destruct (run as root)    [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/mem_devmem (run as root)         [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/mem_partial (run as root)        [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/mem_seg_map (run as root)        [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/self_destruct (run as root)      [00:00] [PASS]

Results Summary
PASS      26

Running Time:   00:00:14
Percent passed: 100.0%

Actions #4

Updated by Electric Monk 2 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 42640e499ab380f595753ffb5c3607d030e5cff3

commit  42640e499ab380f595753ffb5c3607d030e5cff3
Author: Patrick Mooney <pmooney@pfmooney.com>
Date:   2022-09-26T20:06:16.000Z

    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>

Actions

Also available in: Atom PDF