mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-06-16 02:15:47 +00:00
kvm: Don't stop on ioport errors by default
This patch introduces a '--ioport-debug' option that preserves the old stop-on-error behavior and changes the default to keep on running despite of ioport errors. This allows Linux kernel to boot to VFS mount phase. Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
This commit is contained in:
committed by
Will Deacon
parent
3ae4f82b7c
commit
62ef45dc93
@@ -2,11 +2,14 @@
|
||||
|
||||
#include "kvm/kvm.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
bool ioport_debug;
|
||||
|
||||
static uint8_t ioport_to_uint8(void *data)
|
||||
{
|
||||
uint8_t *p = data;
|
||||
@@ -150,6 +153,8 @@ bool kvm__emulate_io(struct kvm *self, uint16_t port, void *data, int direction,
|
||||
}
|
||||
return true;
|
||||
error:
|
||||
ioport_error(port, data, direction, size, count);
|
||||
return false;
|
||||
if (ioport_debug)
|
||||
ioport_error(port, data, direction, size, count);
|
||||
|
||||
return !ioport_debug;
|
||||
}
|
||||
|
||||
@@ -10,9 +10,11 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
extern bool ioport_debug;
|
||||
|
||||
static void usage(char *argv[])
|
||||
{
|
||||
fprintf(stderr, " usage: %s [--single-step] [--params=<kernel-params>] [--kernel=]<kernel-image>\n",
|
||||
fprintf(stderr, " usage: %s [--single-step] [--ioport-debug] [--params=<kernel-params>] [--kernel=]<kernel-image>\n",
|
||||
argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
@@ -48,13 +50,16 @@ int main(int argc, char *argv[])
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (option_matches(argv[i], "--kernel=")) {
|
||||
kernel_filename = &argv[i][9];
|
||||
kernel_filename = &argv[i][9];
|
||||
continue;
|
||||
} else if (option_matches(argv[i], "--params=")) {
|
||||
kernel_cmdline = &argv[i][9];
|
||||
kernel_cmdline = &argv[i][9];
|
||||
continue;
|
||||
} else if (option_matches(argv[i], "--single-step")) {
|
||||
single_step = true;
|
||||
single_step = true;
|
||||
continue;
|
||||
} else if (option_matches(argv[i], "--ioport-debug")) {
|
||||
ioport_debug = true;
|
||||
continue;
|
||||
} else {
|
||||
/* any unspecified arg is kernel image */
|
||||
|
||||
Reference in New Issue
Block a user