X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fmain.c;h=38a2fd4a28e33d1aacd812fc5f71189478a24a2b;hb=cfc3d544077dfbcc8b407fef7b76fa4c4b30f300;hp=2da1b224552cb4a52880f5533a9a43635f6b9611;hpb=928297a7cf5ffbf3a210fcaf7556e681bbb436d5;p=palacios.git diff --git a/linux_module/main.c b/linux_module/main.c index 2da1b22..38a2fd4 100644 --- a/linux_module/main.c +++ b/linux_module/main.c @@ -684,8 +684,13 @@ static void __exit v3_exit(void) { /* Stop and free any running VMs */ for (i = 0; i < MAX_VMS; i++) { - if (guest_map[i] != NULL) { - guest = (struct v3_guest *)guest_map[i]; + if (guest_map[i] != NULL) { + guest = (struct v3_guest *)(guest_map[i]); + + if (!guest->v3_ctx) { + ERROR("Orphan VM detected and skipped: index=%d name=%s\n", i, guest->name); + continue; + } if (v3_stop_vm(guest->v3_ctx) < 0) ERROR("Couldn't stop VM %d\n", i);