If something goes bad with loading, but the file actually exist, give a internal...
authorroot <root@xenapi.xen>
Mon, 6 Oct 2008 15:39:33 +0000 (6 17:39 +0200)
committerroot <root@xenapi.xen>
Mon, 6 Oct 2008 15:39:33 +0000 (6 17:39 +0200)
handler_virt.c

index 2a61bdc..200770f 100644 (file)
@@ -1586,9 +1586,15 @@ virt_build_page (cherokee_handler_virt_t *hdl)
                     } else {
                         /* We should also look on disk for defined stuff */
                         cherokee_buffer_t xmlDesc = CHEROKEE_BUF_INIT;
-                        if (load_xml(hdl, &xmlDesc) == ret_ok && (virDom = virDomainDefineXML(virConn, xmlDesc.buf)) != NULL) {
-                            /* The domain existed and is loaded! */
-                            ret = ret_ok;
+                        if (load_xml(hdl, &xmlDesc) == ret_ok)
+                            if ((virDom = virDomainDefineXML(virConn, xmlDesc.buf)) != NULL) {
+                                /* The domain existed and is loaded! */
+                                ret = ret_ok;
+                            } else {
+                                hdl->action = nothing;
+                                conn->error_code = http_internal_error;
+                                ret = ret_error;
+                            }
                         } else {    
                             /* Otherwise we don't have anything to do and we should
                              * return an error */