diff --git a/tools/test-runner.c b/tools/test-runner.c
index 48e1141..1d77033 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
static bool start_daemon = false;
static bool start_emulator = false;
static bool start_monitor = false;
+static bool qemu_host_cpu = false;
static int num_devs = 0;
static const char *qemu_binary = NULL;
static const char *kernel_image = NULL;
"-monitor", "none",
"-display", "none",
"-machine", "type=q35,accel=kvm:tcg",
- "-cpu", "host",
"-m", "256M",
"-net", "none",
"-no-reboot",
testargs);
argv = alloca(sizeof(qemu_argv) +
- (sizeof(char *) * (4 + (num_devs * 4))));
+ (sizeof(char *) * (6 + (num_devs * 4))));
memcpy(argv, qemu_argv, sizeof(qemu_argv));
pos = (sizeof(qemu_argv) / sizeof(char *)) - 1;
}
argv[0] = (char *) qemu_binary;
+ if (qemu_host_cpu) {
+ argv[pos++] = "-cpu";
+ argv[pos++] = "host";
+ }
+
argv[pos++] = "-kernel";
argv[pos++] = (char *) kernel_image;
argv[pos++] = "-append";
"\t-A, --audio[=path] Start audio server\n"
"\t-u, --unix [path] Provide serial device\n"
"\t-q, --qemu <path> QEMU binary\n"
+ "\t-H, --qemu-host-cpu Use host CPU (requires KVM support)\n"
"\t-k, --kernel <image> Kernel image (bzImage)\n"
"\t-h, --help Show help options\n");
}
{ "emulator", no_argument, NULL, 'l' },
{ "monitor", no_argument, NULL, 'm' },
{ "qemu", required_argument, NULL, 'q' },
+ { "qemu-host-cpu", no_argument, NULL, 'H' },
{ "kernel", required_argument, NULL, 'k' },
{ "audio", optional_argument, NULL, 'A' },
{ "version", no_argument, NULL, 'v' },
for (;;) {
int opt;
- opt = getopt_long(argc, argv, "aubdslmq:k:A::vh", main_options,
+ opt = getopt_long(argc, argv, "aubdslmq:Hk:A::vh", main_options,
NULL);
if (opt < 0)
break;
case 'q':
qemu_binary = optarg;
break;
+ case 'H':
+ qemu_host_cpu = true;
+ break;
case 'k':
kernel_image = optarg;
break;