]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
plat/xen: x86: Maximum command line length from Xen headers
authorSimon Kuenzer <simon.kuenzer@neclab.eu>
Thu, 1 Oct 2020 12:43:14 +0000 (14:43 +0200)
committerSimon Kuenzer <simon.kuenzer@neclab.eu>
Fri, 20 Nov 2020 16:00:20 +0000 (17:00 +0100)
Instead of defining an own maximum size for the command line, in this
commit we use `MAX_GUEST_CMDLINE` from the Xen headers to defining the
maximum command line length.

Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
Reviewed-by: Sharan Santhanam <sharan.santhanam@neclab.eu>
plat/xen/x86/setup.c

index 14b2c26f567488ac32625bb9e639bfe771730ab3..7882ebef8e0c13a2e03265394041d52bde5fdede 100644 (file)
@@ -90,8 +90,7 @@
 #include <xen/arch-x86/cpuid.h>
 #include <xen/arch-x86/hvm/start_info.h>
 
-#define MAX_CMDLINE_SIZE 1024
-static char cmdline[MAX_CMDLINE_SIZE];
+static char cmdline[MAX_GUEST_CMDLINE];
 
 start_info_t *HYPERVISOR_start_info;
 shared_info_t *HYPERVISOR_shared_info;
@@ -180,7 +179,7 @@ void _libxenplat_x86entry(void *start_info)
        _init_shared_info(); /* remaps shared info */
 
        strncpy(cmdline, (char *)HYPERVISOR_start_info->cmd_line,
-               MAX_CMDLINE_SIZE);
+               MAX_GUEST_CMDLINE);
 
        /* Set up events. */
        init_events();
@@ -193,5 +192,5 @@ void _libxenplat_x86entry(void *start_info)
 
        init_console();
 
-       ukplat_entry_argp(CONFIG_UK_NAME, cmdline, MAX_CMDLINE_SIZE);
+       ukplat_entry_argp(CONFIG_UK_NAME, cmdline, MAX_GUEST_CMDLINE);
 }