X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fpalacios-dev.c;h=8b303521db8e5bdceb1c10047b8306c19e1e9f55;hb=4801e692b7344051eb94fff6faf1be53f621d422;hp=585e80785dc839f05f170cea1825269ecc749326;hpb=260bb3e805ebc92ae294c3c2b36d027ba8bca488;p=palacios.releases.git diff --git a/linux_module/palacios-dev.c b/linux_module/palacios-dev.c index 585e807..8b30352 100644 --- a/linux_module/palacios-dev.c +++ b/linux_module/palacios-dev.c @@ -125,11 +125,12 @@ static long v3_dev_ioctl(struct file * filp, INIT_LIST_HEAD(&(guest->streams)); INIT_LIST_HEAD(&(guest->files)); INIT_LIST_HEAD(&(guest->sockets)); + init_completion(&(guest->start_done)); init_completion(&(guest->thread_done)); kthread_run(start_palacios_vm, guest, guest->name); - wait_for_completion(&(guest->thread_done)); + wait_for_completion(&(guest->start_done)); return guest->vm_dev; break; @@ -232,8 +233,6 @@ static int __init v3_init(void) { palacios_init_stream(); palacios_file_init(); palacios_init_console(); - - return 0; @@ -245,22 +244,29 @@ static int __init v3_init(void) { return ret; } + static void __exit v3_exit(void) { extern u32 pg_allocs; extern u32 pg_frees; extern u32 mallocs; extern u32 frees; + dev_t dev = MKDEV(v3_major_num, MAX_VMS + 1); + printk("Removing V3 Control device\n"); - palacios_vmm_exit(); + palacios_vmm_exit(); printk("Palacios Mallocs = %d, Frees = %d\n", mallocs, frees); printk("Palacios Page Allocs = %d, Page Frees = %d\n", pg_allocs, pg_frees); - unregister_chrdev_region(MKDEV(v3_major_num, 0), MAX_VMS + 1); + + cdev_del(&ctrl_dev); + + device_destroy(v3_class, dev); + class_destroy(v3_class); }