From ced060ecf281fa3b863e0bd7deeb8ae2ee4bde8e Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Sat, 22 Nov 2008 13:59:27 +0200 Subject: [PATCH] kvm: testsuite: handle shutdown exits Signed-off-by: Avi Kivity --- kvm/user/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kvm/user/main.c b/kvm/user/main.c index a5b7c79c72..8f38a49cae 100644 --- a/kvm/user/main.c +++ b/kvm/user/main.c @@ -341,6 +341,14 @@ static int test_mem_write(void *opaque, uint64_t addr, uint8_t *data, int len) return 0; } +static int test_shutdown(void *opaque, void *env) +{ + printf("shutdown\n"); + kvm_show_regs(kvm, 0); + exit(1); + return 1; +} + static struct kvm_callbacks test_callbacks = { .inb = test_inb, .inw = test_inw, @@ -357,6 +365,7 @@ static struct kvm_callbacks test_callbacks = { .try_push_nmi = test_try_push_nmi, .post_kvm_run = test_post_kvm_run, .pre_kvm_run = test_pre_kvm_run, + .shutdown = test_shutdown, }; static void load_file(void *mem, const char *fname) -- 2.11.4.GIT