From: Jack Lange Date: Wed, 8 Jun 2011 17:57:30 +0000 (-0500) Subject: reverted creation ordering X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=cfa7f55f2b90dcab2f44509d5264e7ec8061cd3f;p=palacios.git reverted creation ordering --- diff --git a/linux_module/palacios-vm.c b/linux_module/palacios-vm.c index d19e705..9cdaa6d 100644 --- a/linux_module/palacios-vm.c +++ b/linux_module/palacios-vm.c @@ -301,6 +301,7 @@ int start_palacios_vm(void * arg) { if (err) { printk("Fails to add cdev\n"); + v3_free_vm(guest->v3_ctx); complete(&(guest->start_done)); return -1; } @@ -308,15 +309,7 @@ int start_palacios_vm(void * arg) { if (device_create(v3_class, NULL, guest->vm_dev, guest, "v3-vm%d", MINOR(guest->vm_dev)) == NULL){ printk("Fails to create device\n"); cdev_del(&(guest->cdev)); - complete(&(guest->start_done)); - return -1; - } - - guest->v3_ctx = v3_create_vm(guest->img, (void *)guest, guest->name); - - if (guest->v3_ctx == NULL) { - printk("palacios: failed to create vm\n"); - cdev_del(&(guest->cdev)); + v3_free_vm(guest->v3_ctx); complete(&(guest->start_done)); return -1; } @@ -325,10 +318,6 @@ int start_palacios_vm(void * arg) { printk("palacios: launching vm\n"); - - - - if (v3_start_vm(guest->v3_ctx, 0xffffffff) < 0) { printk("palacios: launch of vm failed\n"); device_destroy(v3_class, guest->vm_dev);