tiny fix of {
authorroot <root@xenapi.xen>
Mon, 6 Oct 2008 15:52:57 +0000 (6 17:52 +0200)
committerroot <root@xenapi.xen>
Mon, 6 Oct 2008 15:52:57 +0000 (6 17:52 +0200)
+

Why are we mkdiring on load?!

handler_virt.c

index 200770f..52d5c92 100644 (file)
@@ -431,13 +431,7 @@ static ret_t load_xml(cherokee_handler_virt_t *hdl, cherokee_buffer_t *xmlDesc)
     ret_t ret = ret_error;
     FILE *fd;
     cherokee_buffer_t path = CHEROKEE_BUF_INIT;
-    cherokee_buffer_add_va (&path, "/mnt/netapp/users/%s", hdl->user.buf);
-
-    mkdir(path.buf, 0755);
-    cherokee_buffer_add_va (&path, "/%s", hdl->vm.buf);
-    
-    mkdir(path.buf, 0755);
-    cherokee_buffer_add_str (&path, "/index.xml");
+    cherokee_buffer_add_va (&path, "/mnt/netapp/users/%s/%s/index.xml", hdl->user.buf, hdl->vm.buf);
 
     if ((fd = fopen(path.buf, "r")) != NULL) {
         while (!feof(fd)) {
@@ -1586,7 +1580,7 @@ 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)
+                        if (load_xml(hdl, &xmlDesc) == ret_ok) {
                             if ((virDom = virDomainDefineXML(virConn, xmlDesc.buf)) != NULL) {
                                 /* The domain existed and is loaded! */
                                 ret = ret_ok;