+ xmlNodePtr cur = root->xmlChildrenNode;
+ char *obdtype, *format = NULL, *fstype = NULL, *device = NULL;
+ int rc;
+
+ obdtype = xmlGetProp(root, "type");
+ printf("--- Setting up OBD ---\n");
+
+ while (cur != NULL) {
+ if (!xmlStrcmp(cur->name, "fstype"))
+ fstype = xmlNodeGetContent(cur);
+
+ if (!xmlStrcmp(cur->name, "device"))
+ device = xmlNodeGetContent(cur);
+
+ if (!xmlStrcmp(cur->name, "autoformat"))
+ format = xmlNodeGetContent(cur);
+
+ cur = cur->next;
+ }
+
+ if ((obdtype == NULL) || (fstype == NULL) || (device == NULL)) {
+ printf("error: 'type' attrib and <fstype> and <device> tags required\n");
+ return -1;
+ }
+
+ /* FIXME: Building and configuring loopback devices should go here
+ * but is currently unsupported. You'll have to use the scripts
+ * for now until support is added, or specify a real device.
+ */
+
+ if ((rc = xml_command("newdev", NULL)) != 0)
+ return rc;
+
+ if ((rc = xml_command("attach", obdtype, "OBDDEV", NULL)) != 0)
+ return rc;
+
+ if ((rc = xml_command("setup", device, fstype, NULL)) != 0)
+ return rc;
+