continue;
}
- /* xen_dom0 */
- if (strcmp(entry->name, "xen_dom0") == 0) {
- int val;
-
- PARSE_ERROR_DUPLICATE((p->xen_dom0_present == 0),
- section_name,
- entry->name);
- p->xen_dom0_present = 1;
-
- val = parser_read_arg_bool(entry->value);
- PARSE_ERROR((val >= 0), section_name, entry->name);
- p->xen_dom0 = val;
- continue;
- }
-
/* unrecognized */
PARSE_ERROR_INVALID(0, section_name, entry->name);
}
if (p->vfio_intr)
fprintf(f, "%s = %s\n", "vfio_intr", p->vfio_intr);
- if (p->xen_dom0_present)
- fprintf(f, "%s = %s\n", "xen_dom0",
- (p->xen_dom0) ? "yes" : "no");
-
fputc('\n', f);
}
process_dup(const char *const argv[], int numargs, const char *env_value)
{
int num;
-#ifdef RTE_LIBRTE_XEN_DOM0
- char *argv_cpy[numargs + 2];
-#else
char *argv_cpy[numargs + 1];
-#endif
int i, fd, status;
char path[32];
/* make a copy of the arguments to be passed to exec */
for (i = 0; i < numargs; i++)
argv_cpy[i] = strdup(argv[i]);
-#ifdef RTE_LIBRTE_XEN_DOM0
- argv_cpy[i] = strdup("--xen-dom0");
- argv_cpy[i + 1] = NULL;
- num = numargs + 1;
-#else
argv_cpy[i] = NULL;
num = numargs;
-#endif
/* close all open file descriptors, check /proc/self/fd to only
* call close on open fds. Exclude fds 0, 1 and 2*/
{ "test_invalid_b_flag", no_action },
{ "test_invalid_vdev_flag", no_action },
{ "test_invalid_r_flag", no_action },
-#ifdef RTE_LIBRTE_XEN_DOM0
- { "test_dom0_misc_flags", no_action },
-#else
{ "test_misc_flags", no_action },
-#endif
{ "test_memory_flags", no_action },
{ "test_file_prefix", no_action },
{ "test_no_huge_flag", no_action },
#include "process.h"
-#ifdef RTE_LIBRTE_XEN_DOM0
-#define DEFAULT_MEM_SIZE "30"
-#else
#define DEFAULT_MEM_SIZE "18"
-#endif
#define mp_flag "--proc-type=secondary"
#define no_hpet "--no-hpet"
#define no_huge "--no-huge"
return 0;
}
-#ifdef RTE_LIBRTE_XEN_DOM0
-static int
-test_dom0_misc_flags(void)
-{
- char prefix[PATH_MAX], tmp[PATH_MAX];
-
- if (get_current_prefix(tmp, sizeof(tmp)) == NULL) {
- printf("Error - unable to get current prefix!\n");
- return -1;
- }
- snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
-
- /* check that some general flags don't prevent things from working.
- * All cases, apart from the first, app should run.
- * No further testing of output done.
- */
- /* sanity check - failure with invalid option */
- const char *argv0[] = {prgname, prefix, mp_flag, "-c", "1", "--invalid-opt"};
-
- /* With --no-pci */
- const char *argv1[] = {prgname, prefix, mp_flag, "-c", "1", "--no-pci"};
- /* With -v */
- const char *argv2[] = {prgname, prefix, mp_flag, "-c", "1", "-v"};
- /* With valid --syslog */
- const char *argv3[] = {prgname, prefix, mp_flag, "-c", "1",
- "--syslog", "syslog"};
- /* With empty --syslog (should fail) */
- const char *argv4[] = {prgname, prefix, mp_flag, "-c", "1", "--syslog"};
- /* With invalid --syslog */
- const char *argv5[] = {prgname, prefix, mp_flag, "-c", "1", "--syslog", "error"};
- /* With no-sh-conf */
- const char *argv6[] = {prgname, "-c", "1", "-n", "2", "-m", "20",
- "--no-shconf", "--file-prefix=noshconf" };
-
- if (launch_proc(argv0) == 0) {
- printf("Error - process ran ok with invalid flag\n");
- return -1;
- }
- if (launch_proc(argv1) != 0) {
- printf("Error - process did not run ok with --no-pci flag\n");
- return -1;
- }
- if (launch_proc(argv2) != 0) {
- printf("Error - process did not run ok with -v flag\n");
- return -1;
- }
- if (launch_proc(argv3) != 0) {
- printf("Error - process did not run ok with --syslog flag\n");
- return -1;
- }
- if (launch_proc(argv4) == 0) {
- printf("Error - process run ok with empty --syslog flag\n");
- return -1;
- }
- if (launch_proc(argv5) == 0) {
- printf("Error - process run ok with invalid --syslog flag\n");
- return -1;
- }
- if (launch_proc(argv6) != 0) {
- printf("Error - process did not run ok with --no-shconf flag\n");
- return -1;
- }
-
- return 0;
-}
-#else
static int
test_misc_flags(void)
{
}
return 0;
}
-#endif
static int
test_file_prefix(void)
printf("Error - unable to get current prefix!\n");
return -1;
}
-#ifdef RTE_LIBRTE_XEN_DOM0
- return 0;
-#endif
/* check if files for current prefix are present */
if (process_hugefiles(prefix, HUGEPAGE_CHECK_EXISTS) != 1) {
printf("Error - process failed with valid -m flag!\n");
return -1;
}
-#ifdef RTE_LIBRTE_XEN_DOM0
- return 0;
-#endif
if (launch_proc(argv2) == 0) {
printf("Error - process run ok with invalid (zero) --socket-mem!\n");
return -1;
return ret;
}
-#ifdef RTE_LIBRTE_XEN_DOM0
- ret = test_dom0_misc_flags();
-#else
ret = test_misc_flags();
-#endif
if (ret < 0) {
printf("Error in test_misc_flags()");
return ret;