Skip to contentSkip to conversation

libxenlight: minimal vfs support

PATCH New Stefano Stabellini 1 participant 1 message Dec 7, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxenlight: minimal vfs support

Hi all,
this patch adds minimal support for fs-backend and minios' fs-front to libxenlight:

- it creates a vfs directory on the stubdom's xenstore device path and allows the stubdom to write to it;

- it doesn't try to cleany shutdown the vfs backend.

---

tools/libxl/libxl.c +2 -0
diff -r b4c47cfbb9b1 tools/libxl/libxl.c
@@ -798,6 +798,8 @@
     t = xs_transaction_start(ctx->xsh);
     xs_mkdir(ctx->xsh, t, libxl_sprintf(ctx, "/local/domain/0/device-model/%d", info->domid));
     xs_set_permissions(ctx->xsh, t, libxl_sprintf(ctx, "/local/domain/0/device-model/%d", info->domid), perm, ARRAY_SIZE(perm));
+    xs_mkdir(ctx->xsh, t, libxl_sprintf(ctx, "/local/domain/%d/device/vfs", domid));
+    xs_set_permissions(ctx->xsh, t, libxl_sprintf(ctx, "/local/domain/%d/device/vfs",domid), perm, ARRAY_SIZE(perm));
     if (!xs_transaction_end(ctx->xsh, t, 0))
         if (errno == EAGAIN)
             goto retry_transaction;
tools/libxl/libxl_device.c +2 -0
diff -r b4c47cfbb9b1 tools/libxl/libxl_device.c
@@ -224,6 +224,8 @@
         return -1;
     }
     for (i = 0; i < num1; i++) {
+        if (!strcmp("vfs", l1[i]))
+            continue;
         path = libxl_sprintf(&clone, "/local/domain/%d/device/%s", domid, l1[i]);
         l2 = libxl_xs_directory(&clone, XBT_NULL, path, &num2);
         if (!l2)