]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bhyvectl: reduce code duplication
authorRobert Wing <rew@FreeBSD.org>
Sat, 27 Feb 2021 21:05:52 +0000 (12:05 -0900)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 26 Jan 2023 18:45:40 +0000 (10:45 -0800)
commit2ba5f95607505eccfd8dd3271463fa769809480b
tree29edf91e6fd3e2b870d12498d07bfa2c8625aff4
parentadad7dde3200bc1c6c58f1a6c835907192a84892
bhyvectl: reduce code duplication

Combine send_start_checkpoint() and send_start_suspend() into a
single function named snapshot_request().

snapshot_request() is equivalent to send_start_checkpoint() and
send_start_suspend() except that it takes an additional argument. The
additional argument, enum ipc_opcode, is used to determine the type of
snapshot request being performed. Also, switch to using strlcpy instead
of strncpy.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D28878

(cherry picked from commit da9713917eb26b67bafc740384ccd44f7dff09f2)
usr.sbin/bhyvectl/bhyvectl.c