Currently, bhyvectl --suspend fails with:
Socket not connected
Even on successful suspend.
This happens because of two commits that result in a regression.
The first one, f49f33ef8c53, changed the snapshot request to
use nvlist_xfer() instead of nvlist_send(). Since the suspend path
exits before the IPC handler can send a response, nvlist_xfer()
fails with ENOTCONN.
The second one, ed60e5710e74, added err = errno when nvlist_xfer()
fails. As a result, bhyvectl prints the error message listed above
and exits with ENOTCONN.
Fix that by sending the snapshot request response before shutting
down the VM on success.
Fixes: f49f33ef8c53 ("bhyvectl: Generalize bhyve IPC code")
Fixes: ed60e5710e74 ("bhyvectl: support querying VM pid")
Sponsored by: The FreeBSD Foundation