Whamcloud - gitweb
- support mounting osc or lov
authorrread <rread>
Fri, 9 Aug 2002 19:56:52 +0000 (19:56 +0000)
committerrread <rread>
Fri, 9 Aug 2002 19:56:52 +0000 (19:56 +0000)
lustre/utils/lconf
lustre/utils/lmc
lustre/utils/obd.c

index e1be590..1cd2fff 100755 (executable)
@@ -135,6 +135,8 @@ class LCTLInterface:
         p.tochild.close()
         out = p.fromchild.readlines()
         ret = p.poll()
+        for l in out:
+            debug('lctl:',string.strip(l))
         err = p.childerr.readlines()
         if ret or len(err):
             log (self.lctl, "error:", ret)
@@ -535,16 +537,21 @@ class Mountpoint(Module):
 
     def prepare(self):
         l = lookup(self.dom_node.parentNode, self.lov_uuid)
-        lov = LOV(l)
-        for osc_uuid in string.split(lov.devlist):
-            osc = lookup(self.dom_node.parentNode, osc_uuid)
-            if osc:
-                n = OSC(osc)
-                n.prepare()
-            else:
-                panic('osc not found:', osc_uuid)
+        if l.nodeName == 'lov':
+            dev = LOV(l)
+            for osc_uuid in string.split(dev.devlist):
+                osc = lookup(self.dom_node.parentNode, osc_uuid)
+                if osc:
+                    n = OSC(osc)
+                    n.prepare()
+                else:
+                    panic('osc not found:', osc_uuid)
+        else:
+            dev = OSC(l)
+            dev.prepare()
+            
         self.info(self.path, self.mdc_uuid,self.lov_uuid)
-        lctl.newdev(attach="lov %s %s" % (lov.name, lov.uuid),
+        lctl.newdev(attach="lov %s %s" % (dev.name, dev.uuid),
                     setup ="%s" % (self.mdc_uuid))
         cmd = "mount -t lustre_lite -o osc=%s,mdc=%s none %s" % \
               (self.lov_uuid, self.mdc_uuid, self.path)
@@ -787,6 +794,9 @@ def main():
     global options
     args = parse_cmdline(sys.argv[1:])
     if len(args) > 0:
+        if not os.access(args[0], os.R_OK | os.W_OK):
+            print 'File not found:', args[0]
+            sys.exit(1)
         dom = xml.dom.minidom.parse(args[0])
     elif options.has_key('url'):
         xmldata = fetch(options['url'])
index 6ab6fe5..0b308ad 100755 (executable)
@@ -21,7 +21,7 @@
 
 """
 lmc - lustre configurtion data  manager
-
  Basic plan for lmc usage:
 # create nodes
 ./lmc --output config.xml --node server --net server1 tcp 
index 013e79a..c63d950 100644 (file)
@@ -1129,7 +1129,7 @@ int jt_obd_lov_config(int argc, char **argv)
         }
 
         rc = ioctl(fd, OBD_IOC_LOV_CONFIG, buf);
-        if (rc < 0)
+        if (rc)
                 fprintf(stderr, "lov_config: error: %s: %s\n",
                         cmdname(argv[0]), strerror(rc = errno));
         free(uuidarray);