Skip to content

Commit

Permalink
Merge pull request #588 from Solo5/revert-584
Browse files Browse the repository at this point in the history
Revert #584 & fix tests
  • Loading branch information
dinosaure authored Oct 11, 2024
2 parents d026c2f + 6d5ea39 commit a8a2ec4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions bindings/virtio/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ void platform_init(const void *arg)
char *mi_cmdline = (char *)(uint64_t)mi->cmdline;
size_t cmdline_len = strlen(mi_cmdline);

/*
* Skip the first token in the cmdline as it is an opaque "name" for
* the kernel coming from the bootloader.
*/
for (; *mi_cmdline; mi_cmdline++, cmdline_len--) {
if (*mi_cmdline == ' ') {
mi_cmdline++;
cmdline_len--;
break;
}
}

if (cmdline_len >= sizeof(cmdline)) {
cmdline_len = sizeof(cmdline) - 1;
log(WARN, "Solo5: warning: command line too long, truncated\n");
Expand Down
2 changes: 1 addition & 1 deletion tests/tests.bats
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ xen_expect_abort() {
expect_success
}

test "net_2if virtio" {
@test "net_2if virtio" {
[ $(id -u) -ne 0 ] && skip "Need root to run this test, for ping -f"
[ "${CONFIG_HOST}" = "OpenBSD" ] && skip "breaks on OpenBSD due to #374"

Expand Down

0 comments on commit a8a2ec4

Please sign in to comment.