- rc = obd_connect(&conn, tgt, &echo_uuid);
- if (rc) {
- CERROR("fail to connect to device %s\n", lcfg->lcfg_inlbuf1);
+ OBD_ALLOC(ocd, sizeof(*ocd));
+ if (ocd == NULL) {
+ CERROR("Can't alloc ocd connecting to %s\n",
+ lustre_cfg_string(lcfg, 1));
+ return -ENOMEM;
+ }
+
+ ocd->ocd_connect_flags = OBD_CONNECT_VERSION;
+ ocd->ocd_version = LUSTRE_VERSION_CODE;
+
+ rc = obd_connect(&conn, tgt, &echo_uuid, ocd);
+
+ OBD_FREE(ocd, sizeof(*ocd));
+
+ if (rc != 0) {
+ CERROR("fail to connect to device %s\n",
+ lustre_cfg_string(lcfg, 1));