Generated code for mount-loop command.
[libguestfs.git] / perl / Guestfs.xs
index 6980bda..f19ea1a 100644 (file)
@@ -2798,3 +2798,48 @@ PREINIT:
  OUTPUT:
       RETVAL
 
+SV *
+du (g, path)
+      guestfs_h *g;
+      char *path;
+PREINIT:
+      int64_t sizekb;
+   CODE:
+      sizekb = guestfs_du (g, path);
+      if (sizekb == -1)
+        croak ("du: %s", guestfs_last_error (g));
+      RETVAL = my_newSVll (sizekb);
+ OUTPUT:
+      RETVAL
+
+void
+initrd_list (g, path)
+      guestfs_h *g;
+      char *path;
+PREINIT:
+      char **filenames;
+      int i, n;
+ PPCODE:
+      filenames = guestfs_initrd_list (g, path);
+      if (filenames == NULL)
+        croak ("initrd_list: %s", guestfs_last_error (g));
+      for (n = 0; filenames[n] != NULL; ++n) /**/;
+      EXTEND (SP, n);
+      for (i = 0; i < n; ++i) {
+        PUSHs (sv_2mortal (newSVpv (filenames[i], 0)));
+        free (filenames[i]);
+      }
+      free (filenames);
+
+void
+mount_loop (g, file, mountpoint)
+      guestfs_h *g;
+      char *file;
+      char *mountpoint;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_mount_loop (g, file, mountpoint);
+      if (r == -1)
+        croak ("mount_loop: %s", guestfs_last_error (g));
+