User Details
- User Since
- May 3 2021, 7:40 PM (187 w, 15 h)
Aug 20 2021
Simplify code.
Aug 19 2021
Aug 18 2021
Moved a calculation out of a locked area.
Aug 16 2021
Aug 12 2021
Add a "persistent" flag to allow some vmmctl-created VMs to not be automatically destroyed when the file descriptor is closed. This allows /dev/vmmctl to be used with bhyveload as well. I also added some padding to the ioctl structs for future-proofing.
There is a problem with this revision. If you try to reboot a VM, the error message "vm_open: Device not configured" appears. The problem is that rebooting works as follows: The bhyve process exits with exit code 0, which tells the caller (such as vmrun.sh), to call bhyve again. Since the bhyve process exited, the VM is destroyed, but this is an asynchronous action. So when the bhyve process is called again almost instantly, the VM likely has not yet been destroyed, so a new VM cannot be created.
Aug 3 2021
Fix some style issues, and update max length of VM name accordingly due to changes in commit df95cc76affb.
Jul 30 2021
To simplify code, do not try to create a vm in the non-bootrom case, since we expect it to be created already, so non-existence will be caught in the call to vm_open. Note that an error message has been removed; if it is still necessary then I can add an explicit check in the non-bootrom case.
Made a mistake in the last diff - accidentally omitted the test files.
Simplify the loop in vmmdev_lookup.
Jul 29 2021
Fallback to old method if /dev/vmmctl cannot be opened.
Fix some style issues, fix bug where string from userspace was not strnlen'd, move device file setup, cleanup code into vmmdev_init and vmmdev_cleanup (which causes some code to be shifted around in the file).
Jul 27 2021
Use new racct_add_cred_checked function instead of racct_add on resize. This is the correct behaviour, since a process might be able to resize a shared memory object that was created by a different process.
Remove whitespace.
Remove unnecessary quoting and ignore error messages.
Closing this revision because it is incorrect.
Jul 21 2021
Fixed minor issues and merged test case files.
Jul 19 2021
Move the credential check to vmmdev_lookup. Note that this means the error code will be EINVAL in sysctl_vmm_destroy, rather than EPERM.
Jul 16 2021
Check that vmm module is loaded before running tests.
Jul 14 2021
Add copyright notices to test files.
Adds copyright notices.
Jul 13 2021
Add a credential to the softc struct as well. Also add some basic tests.
Jul 12 2021
Jul 6 2021
Addresses style issues. Also removes racct_propagate_pcpu, which was meant to update pcpu on process exit. Removes p_prev_runtime from the process struct, as it is no longer used. Also sets pcpu to zero on process exit (for zombie processes, carrying over behaviour from old pcpu scheme).
I have added a test for cputime and pcpu which takes 4 seconds to complete. Since it is a loop that executes another process, the calculations involved are inexact (compared to a loop that simply spins) and we cannot expect a precise value for these measurements.
Jul 4 2021
Addresses style issues and removes some now-unused code. The code for calculating pcpu on process exit is still left in, albeit commented out in case we want to experiment with it any further. Finally, there were situations in the previous scheme where pcpu was explicitly set to 0. I believe this is no longer necessary as the runtime value should not increase, but should we carry over this behaviour to ensure that pcpu is exactly 0 in these cases?
Jun 29 2021
Jun 28 2021
Adds a new checked version of racct_add_cred instead of adding the checks into racct_add_cred. Also factors the individual handlers out of rctl_enforce so that they can be re-used for rctl_enforce_cred.
Addresses markj's comments. From testing, pctcpu can occasionally go slightly above the maximum cpu percentage, which I'm not yet sure if is a bug or expected. It can be clamped to the maximum cpu percentage if it is expected. It also is still not yet updated on proc_exit.
Jun 25 2021
This diff now calculates runtime correctly when processes exit. Also, timeval is used to calculate the elapsed time, rather than the wallclock value, which is meaningless for non-process raccts. However, pctcpu is not yet updated on process exit.
Jun 23 2021
Jun 21 2021
Jun 15 2021
Jun 4 2021
Added parentheses around return value.
Jun 3 2021
May 17 2021
May 12 2021
Addresses the comment issue and removes one "expect fail" due to https://reviews.freebsd.org/D30234.
May 11 2021
I reduced the amount of modified lines and added comments throughout describing changes. @markj recommended that I avoid using Begin FreeBSD and End FreeBSD annotations throughout the file in order to reduce clutter.
May 10 2021
Fixed issues mentioned by markj. mb_cur_max is now updated right after the call to setlocale(LC_ALL, "").