Skip to content

Commit 649d568

Browse files
committed
krun: fix error return
terminate the current container process instead of returning. Closes: #1958 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
1 parent 617e653 commit 649d568

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/libcrun/handlers/krun.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,14 +430,17 @@ libkrun_exec (void *cookie, libcrun_container_t *container, const char *pathname
430430
{
431431
ret = libkrun_enable_virtio_gpu (kconf);
432432
if (UNLIKELY (ret < 0))
433-
return ret;
433+
error (EXIT_FAILURE, -ret, "could not enable virtio gpu");
434434
}
435435
}
436436

437437
yajl_tree_free (config_tree);
438438

439439
ret = krun_start_enter (ctx_id);
440-
return -ret;
440+
if (UNLIKELY (ret < 0))
441+
error (EXIT_FAILURE, -ret, "could not start krun");
442+
443+
return ret;
441444
}
442445

443446
/* libkrun_create_kvm_device: explicitly adds kvm device. */

0 commit comments

Comments
 (0)