diff options
| author | Louis Burda <quent.burda@gmail.com> | 2023-02-07 07:58:27 -0600 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2023-02-07 07:58:27 -0600 |
| commit | 32331c7f421411bccb87ea818a2a0198b8cf88aa (patch) | |
| tree | c1168e406640acf1a6dbca60dfb046bedaaab533 /test/kvm-step.c | |
| parent | a2cdd64c6f915d969dfa21e23049ff4b3836b13d (diff) | |
| download | cachepc-32331c7f421411bccb87ea818a2a0198b8cf88aa.tar.gz cachepc-32331c7f421411bccb87ea818a2a0198b8cf88aa.zip | |
Add syscall to deinit events to prevent blocking on send
Diffstat (limited to 'test/kvm-step.c')
| -rw-r--r-- | test/kvm-step.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/test/kvm-step.c b/test/kvm-step.c index 34594ae..99b5dcb 100644 --- a/test/kvm-step.c +++ b/test/kvm-step.c @@ -50,10 +50,13 @@ monitor(struct kvm *kvm, bool baseline) } void -kill_child(void) +deinit(void) { - printf("Killing vm..\n"); + ioctl(kvm_dev, KVM_CPC_DEINIT); + kill(child, SIGKILL); + + kvm_setup_deinit(); } int @@ -69,6 +72,8 @@ main(int argc, const char **argv) bool with_data; int ret; + setvbuf(stdout, NULL, _IONBF, 0); + with_data = true; if (argc > 1 && !strcmp(argv[1], "--exec-only")) { with_data = false; @@ -78,8 +83,6 @@ main(int argc, const char **argv) parse_vmtype(argc, argv); - setvbuf(stdout, NULL, _IONBF, 0); - kvm_setup_init(); ipc = ipc_alloc(); @@ -111,10 +114,13 @@ main(int argc, const char **argv) printf("VM exit\n"); vm_deinit(&kvm); + + ipc_free(ipc); + kvm_setup_deinit(); } else { pin_process(0, SECONDARY_CORE, true); - atexit(kill_child); + atexit(deinit); ipc_wait_child(ipc); @@ -178,10 +184,8 @@ main(int argc, const char **argv) } printf("Monitor exit\n"); - } - ipc_free(ipc); - - kvm_setup_deinit(); + ipc_free(ipc); + } } |
