ping: tests: Align with Scapy defaults
Align some of pinger() defaults with Scapy to facilitate debugging when
printing packets.
No functional change intended.
Reviewed by: emaste, kp
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D47159
ping: tests: Cleanup IPOption()s
Scapy now only accepts known options with IPOption(), so our unknown
option must be passed raw.
While here, prefer the named options for EOL and NOP.
Reviewed by: emaste, kp
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D47160
git-arc: Prefer echo over printf
Prefer echo over printf. Prevent the newline character from being
translated by using 'blank' instead of 'space' in the re_format.
This change was reviewed in:
https://reviews.freebsd.org/D47289
Committed separately for clarity.
Suggested by: des
Approved by: emaste (mentor)
git-arc: Trap on every mktemp
Trap:
- EXIT (0)
- HUP (1)
- INT (2)
- QUIT (3)
- TRAP (5)
- USR1 (10)
- TERM (15)
every time mktemp is called to reduce the chances of leaving stray files
or directories with possible sensitive data inside.
We avoid using a template with mktemp, as some operating systems may use
unpredictable base paths by default (macOS).
Suggested by: des
[3 lines not shown]
git-arc: Fix find_author() for external users
When an external user submits a review in Phabricator, the find_author()
subroutine may receive the author_name and author_addr as "null" from
the JSON API with git-arc patch.
This "null" string gets tested for length by "[ -n", and returning that
is greater than zero, in other words, the shell does not understand that
"null" means nothing in this case.
Fix it by adding a guard, that sets an empty string when the content is
"null".
While here, standardize the indentation style for find_author()
Reviewed by: emaste, markj
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D46789
Make the CTL tests more resilient
Fix the find_device function to work regardless of whether "camcontrol
devlist" lists the da device first and the pass device second or vice
versa. On FreeBSD 14 and 15 it apparently always lists da first. But
on 13 it can do it in either order.
MFC after: 2 weeks
MFC with: fe1755fa
Sponsored by: ConnectWise
Reviewed by: emaste, markj, #cam
Differential Revision: https://reviews.freebsd.org/D47446
libvmmapi: Use the vmmctl device file to create and destroy VMs
This deprecates the vm_create() and vm_open() interfaces and introduces
vm_openf(), which takes flags controlling its behaviour. In particular,
it will optionally create a VM first, and it can optionally reinitialize
an existing VM. This enables some simplification of existing consumers.
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D47030
vmm: Add a device file interface for creating and destroying VMs
This supersedes the sysctl interface, which has the limitations of being
root-only and not supporting automatic resource destruction, i.e., we
cannot easily destroy VMs automatically when bhyve terminates.
For now, two ioctls are implemented VMMCTL_VM_CREATE and
VMMCTL_VM_DESTROY. Eventually I would like to support tying a VM's
lifetime to that of the descriptor, so that it is automatically
destroyed when the descriptor is closed. However, this will require
some work in bhyve: when the guest wants to reboot, bhyve exits with a
status that indicates that it is to be restarted. This is incompatible
with the idea of tying a VM's lifetime to that of a descriptor, since we
want to avoid creating and destroying a VM across each reboot (as this
involves freeing all of the guest memory, among other things). One
possible design would be to decompose bhyve into two processes, a parent
which handles reboots, and a child which runs in capability mode and
handles guest execution.
[5 lines not shown]
hifn/safe: Remove dummy calls to bus_generic_detach
These drivers do not add child devices, so there's no need to try to
detach children.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47390
Remove bogus detach routines
These drivers are not bus drivers, and would need proper detach
routines that tore down state stored in the softc. Better to just
fail detach outright instead of an incorrect success.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47389
dpaa2_mc: Check for error the first time bus_generic_detach is called
This removes the need for the second call.
Reviewed by: dsl
Differential Revision: https://reviews.freebsd.org/D47388
Check for errors when detaching children first, not last
These detach routines in these drivers all ended with 'return
(bus_generic_detach())' meaning that if any child device failed to
detach, the parent driver was left in a mostly destroyed state, but
still marked attached. Instead, bus drivers should detach child
drivers first and return errors before destroying driver state in the
parent.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47387
nvmecontrol: Use active nslist to enumerate namespaces
Rather than probing all namespace IDs up to cdata.nn for the devlist
command, fetch the active namespace list and iterate over that. This
can be much quicker on Fabrics controllers which often advertise a
large cdata.nn value to support adding additional namespaces at
runtime.
Reviewed by: chuck
Reported by: Neven Z <nevenzfr at gmail.com>
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D47355
nvmecontrol: Refactor devlist implementation
Split out helper functions for scan_namespace and scan_controller.
While here, replace sprintf() calls with snprintf() and avoid
leaking the contoller fd if read_controller_data() fails.
Reviewed by: chuck, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D47354
nvmf: Fix an off by one error when scanning active namespace IDs
The active namespace list query fetches namespaces greater than the
passed in namespace ID, not greater than or equal to the passed in
namespace ID. Thus, a multi-page request should start with the last
namespace ID from the previous page, not that ID plus 1.
While here, make use of NVME_GLOBAL_NAMESPACE_TAG instead of a magic
number to handle the edge case that the last namespace ID in a page is
the largest valid namespace ID.
Reviewed by: chuck
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D47393
debug.sh check for :debug_add:
When we match a tag and turn tracing, see if we have any
$DEBUG_ON:debug_add:tag in DEBUG_SH and if so add the new tag.
This allows for more focused debugging during boot.
Reviewed by: stevek
rc: Update ipfilter example rules location
It was originally /usr/src/contrib/ipfilter/rules and moved to
/usr/src/share/examples/ipfilter/rules in 41edb306f056.
Point to users to /usr/src/share/examples/ipfilter instead, as the base
directory also contains example rules.
Reviewed by: emaste
Approved by: emaste (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D47392
sound: Include snd_cmi only for i386 and amd64
When running FreeBSD on an arm64/aarch64 QEMU virtual machine, using the
Intel HD Audio Controller (ich6) (intel-hda), for example, and by
following the procedure in the handbook ("Setting Up the Sound Card"):
kldload snd_driver
The following error is shown:
KLD snd_driver.ko: depends on snd_cmi - not available or version mismatch
This is because the CMedia sound driver (snd_cmi) is only built for i386
and amd64.
Add the same guards to the snd_driver metadriver.
Reviewed by: christos, emaste
Approved by: emaste (mentor)
[2 lines not shown]
pctrie: breakup pctrie_root_store
Break up pctrie_root_store into the part that casts the root to a
smr_pctnode_t *, and the rest. The rest is just pctrie_node_store, and
the casting part can be used in a few more places.
This is strictly a code-cleanup change, with no functional change
expected.
Reviewed by: bnovkov
Differential Revision: https://reviews.freebsd.org/D47347