Skip to content

Commit 91df434

Browse files
authored
Merge pull request #1959 from giuseppe/fix-krun-err
krun: fix error return
2 parents 617e653 + 649d568 commit 91df434

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)