From df38e6ecb5560c0f66d10724aa15290d8bba690c Mon Sep 17 00:00:00 2001 From: rread Date: Fri, 9 Aug 2002 19:56:52 +0000 Subject: [PATCH] - support mounting osc or lov --- lustre/utils/lconf | 28 +++++++++++++++++++--------- lustre/utils/lmc | 2 +- lustre/utils/obd.c | 2 +- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/lustre/utils/lconf b/lustre/utils/lconf index e1be590..1cd2fff 100755 --- a/lustre/utils/lconf +++ b/lustre/utils/lconf @@ -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']) diff --git a/lustre/utils/lmc b/lustre/utils/lmc index 6ab6fe5..0b308ad 100755 --- a/lustre/utils/lmc +++ b/lustre/utils/lmc @@ -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 diff --git a/lustre/utils/obd.c b/lustre/utils/obd.c index 013e79a..c63d950 100644 --- a/lustre/utils/obd.c +++ b/lustre/utils/obd.c @@ -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); -- 1.8.3.1