aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaliy Gusev <gusev.vitaliy@gmail.com>2023-03-06 12:30:54 +0000
committerCorvin Köhne <corvink@FreeBSD.org>2023-03-17 10:26:35 +0000
commit6efb053bea5f94e2c29adafcaf5b9c56d99fa220 (patch)
treeebd995f2685a89e5f005bf7f703c66f0ac914947
parent2193f12bf8db21ed1c99dbe02573bb0705a1466e (diff)
downloadsrc-6efb053bea5f94e2c29adafcaf5b9c56d99fa220.tar.gz
src-6efb053bea5f94e2c29adafcaf5b9c56d99fa220.zip
bhyve: exit with EX_OSERR if init checkpoint or restore time failed
Reviewed by: corvink, markj MFC after: 1 week Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D38872 (cherry picked from commit d213429e42d48c7de56baf60befd5d953654d337)
-rw-r--r--usr.sbin/bhyve/bhyverun.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c
index 3ff83f55474b..bf7b4856a2b4 100644
--- a/usr.sbin/bhyve/bhyverun.c
+++ b/usr.sbin/bhyve/bhyverun.c
@@ -1579,12 +1579,13 @@ main(int argc, char *argv[])
/*
* checkpointing thread for communication with bhyvectl
*/
- if (init_checkpoint_thread(ctx) < 0)
- printf("Failed to start checkpoint thread!\r\n");
+ if (init_checkpoint_thread(ctx) != 0)
+ errx(EX_OSERR, "Failed to start checkpoint thread");
if (restore_file != NULL) {
destroy_restore_state(&rstate);
- vm_restore_time(ctx);
+ if (vm_restore_time(ctx) < 0)
+ err(EX_OSERR, "Unable to restore time");
for (int i = 0; i < guest_ncpus; i++) {
if (i == BSP)