+statvfs (g, path)
+ guestfs_h *g;
+ char *path;
+PREINIT:
+ struct guestfs_statvfs *statbuf;
+ PPCODE:
+ statbuf = guestfs_statvfs (g, path);
+ if (statbuf == NULL)
+ croak ("statvfs: %s", guestfs_last_error (g));
+ EXTEND (SP, 11);
+ PUSHs (sv_2mortal (my_newSVll (statbuf->bsize)));
+ PUSHs (sv_2mortal (my_newSVll (statbuf->frsize)));
+ PUSHs (sv_2mortal (my_newSVll (statbuf->blocks)));
+ PUSHs (sv_2mortal (my_newSVll (statbuf->bfree)));
+ PUSHs (sv_2mortal (my_newSVll (statbuf->bavail)));
+ PUSHs (sv_2mortal (my_newSVll (statbuf->files)));
+ PUSHs (sv_2mortal (my_newSVll (statbuf->ffree)));
+ PUSHs (sv_2mortal (my_newSVll (statbuf->favail)));
+ PUSHs (sv_2mortal (my_newSVll (statbuf->fsid)));
+ PUSHs (sv_2mortal (my_newSVll (statbuf->flag)));
+ PUSHs (sv_2mortal (my_newSVll (statbuf->namemax)));
+ free (statbuf);
+
+void
+tune2fs_l (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ char **superblock;
+ int i, n;
+ PPCODE:
+ superblock = guestfs_tune2fs_l (g, device);
+ if (superblock == NULL)
+ croak ("tune2fs_l: %s", guestfs_last_error (g));
+ for (n = 0; superblock[n] != NULL; ++n) /**/;
+ EXTEND (SP, n);
+ for (i = 0; i < n; ++i) {
+ PUSHs (sv_2mortal (newSVpv (superblock[i], 0)));
+ free (superblock[i]);
+ }
+ free (superblock);
+
+void
+blockdev_setro (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_blockdev_setro (g, device);
+ if (r == -1)
+ croak ("blockdev_setro: %s", guestfs_last_error (g));
+
+void
+blockdev_setrw (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_blockdev_setrw (g, device);
+ if (r == -1)
+ croak ("blockdev_setrw: %s", guestfs_last_error (g));
+
+SV *
+blockdev_getro (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ int ro;
+ CODE:
+ ro = guestfs_blockdev_getro (g, device);
+ if (ro == -1)
+ croak ("blockdev_getro: %s", guestfs_last_error (g));
+ RETVAL = newSViv (ro);
+ OUTPUT:
+ RETVAL
+
+SV *
+blockdev_getss (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ int sectorsize;
+ CODE:
+ sectorsize = guestfs_blockdev_getss (g, device);
+ if (sectorsize == -1)
+ croak ("blockdev_getss: %s", guestfs_last_error (g));
+ RETVAL = newSViv (sectorsize);
+ OUTPUT:
+ RETVAL
+
+SV *
+blockdev_getbsz (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ int blocksize;
+ CODE:
+ blocksize = guestfs_blockdev_getbsz (g, device);
+ if (blocksize == -1)
+ croak ("blockdev_getbsz: %s", guestfs_last_error (g));
+ RETVAL = newSViv (blocksize);
+ OUTPUT:
+ RETVAL
+
+void
+blockdev_setbsz (g, device, blocksize)
+ guestfs_h *g;
+ char *device;
+ int blocksize;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_blockdev_setbsz (g, device, blocksize);
+ if (r == -1)
+ croak ("blockdev_setbsz: %s", guestfs_last_error (g));
+
+SV *
+blockdev_getsz (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ int64_t sizeinsectors;
+ CODE:
+ sizeinsectors = guestfs_blockdev_getsz (g, device);
+ if (sizeinsectors == -1)
+ croak ("blockdev_getsz: %s", guestfs_last_error (g));
+ RETVAL = my_newSVll (sizeinsectors);
+ OUTPUT:
+ RETVAL
+
+SV *
+blockdev_getsize64 (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ int64_t sizeinbytes;
+ CODE:
+ sizeinbytes = guestfs_blockdev_getsize64 (g, device);
+ if (sizeinbytes == -1)
+ croak ("blockdev_getsize64: %s", guestfs_last_error (g));
+ RETVAL = my_newSVll (sizeinbytes);
+ OUTPUT:
+ RETVAL
+
+void
+blockdev_flushbufs (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_blockdev_flushbufs (g, device);
+ if (r == -1)
+ croak ("blockdev_flushbufs: %s", guestfs_last_error (g));
+
+void
+blockdev_rereadpt (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_blockdev_rereadpt (g, device);
+ if (r == -1)
+ croak ("blockdev_rereadpt: %s", guestfs_last_error (g));
+
+void
+upload (g, filename, remotefilename)
+ guestfs_h *g;
+ char *filename;
+ char *remotefilename;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_upload (g, filename, remotefilename);
+ if (r == -1)
+ croak ("upload: %s", guestfs_last_error (g));
+
+void
+download (g, remotefilename, filename)
+ guestfs_h *g;
+ char *remotefilename;
+ char *filename;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_download (g, remotefilename, filename);
+ if (r == -1)
+ croak ("download: %s", guestfs_last_error (g));
+
+SV *
+checksum (g, csumtype, path)
+ guestfs_h *g;
+ char *csumtype;
+ char *path;
+PREINIT:
+ char *checksum;
+ CODE:
+ checksum = guestfs_checksum (g, csumtype, path);
+ if (checksum == NULL)
+ croak ("checksum: %s", guestfs_last_error (g));
+ RETVAL = newSVpv (checksum, 0);
+ free (checksum);
+ OUTPUT:
+ RETVAL
+
+void
+tar_in (g, tarfile, directory)
+ guestfs_h *g;
+ char *tarfile;
+ char *directory;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_tar_in (g, tarfile, directory);
+ if (r == -1)
+ croak ("tar_in: %s", guestfs_last_error (g));
+
+void
+tar_out (g, directory, tarfile)
+ guestfs_h *g;
+ char *directory;
+ char *tarfile;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_tar_out (g, directory, tarfile);
+ if (r == -1)
+ croak ("tar_out: %s", guestfs_last_error (g));
+
+void
+tgz_in (g, tarball, directory)
+ guestfs_h *g;
+ char *tarball;
+ char *directory;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_tgz_in (g, tarball, directory);
+ if (r == -1)
+ croak ("tgz_in: %s", guestfs_last_error (g));
+
+void
+tgz_out (g, directory, tarball)
+ guestfs_h *g;
+ char *directory;
+ char *tarball;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_tgz_out (g, directory, tarball);
+ if (r == -1)
+ croak ("tgz_out: %s", guestfs_last_error (g));
+
+void
+mount_ro (g, device, mountpoint)
+ guestfs_h *g;
+ char *device;
+ char *mountpoint;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_mount_ro (g, device, mountpoint);
+ if (r == -1)
+ croak ("mount_ro: %s", guestfs_last_error (g));
+
+void
+mount_options (g, options, device, mountpoint)
+ guestfs_h *g;
+ char *options;
+ char *device;
+ char *mountpoint;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_mount_options (g, options, device, mountpoint);
+ if (r == -1)
+ croak ("mount_options: %s", guestfs_last_error (g));
+
+void
+mount_vfs (g, options, vfstype, device, mountpoint)
+ guestfs_h *g;
+ char *options;
+ char *vfstype;
+ char *device;
+ char *mountpoint;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_mount_vfs (g, options, vfstype, device, mountpoint);
+ if (r == -1)
+ croak ("mount_vfs: %s", guestfs_last_error (g));
+
+SV *
+debug (g, subcmd, extraargs)
+ guestfs_h *g;
+ char *subcmd;
+ char **extraargs;
+PREINIT:
+ char *result;
+ CODE:
+ result = guestfs_debug (g, subcmd, extraargs);
+ free (extraargs);
+ if (result == NULL)
+ croak ("debug: %s", guestfs_last_error (g));
+ RETVAL = newSVpv (result, 0);
+ free (result);
+ OUTPUT:
+ RETVAL
+
+void
+lvremove (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_lvremove (g, device);
+ if (r == -1)
+ croak ("lvremove: %s", guestfs_last_error (g));
+
+void
+vgremove (g, vgname)
+ guestfs_h *g;
+ char *vgname;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_vgremove (g, vgname);
+ if (r == -1)
+ croak ("vgremove: %s", guestfs_last_error (g));
+
+void
+pvremove (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_pvremove (g, device);
+ if (r == -1)
+ croak ("pvremove: %s", guestfs_last_error (g));
+
+void
+set_e2label (g, device, label)
+ guestfs_h *g;
+ char *device;
+ char *label;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_set_e2label (g, device, label);
+ if (r == -1)
+ croak ("set_e2label: %s", guestfs_last_error (g));
+
+SV *
+get_e2label (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ char *label;
+ CODE:
+ label = guestfs_get_e2label (g, device);
+ if (label == NULL)
+ croak ("get_e2label: %s", guestfs_last_error (g));
+ RETVAL = newSVpv (label, 0);
+ free (label);
+ OUTPUT:
+ RETVAL
+
+void
+set_e2uuid (g, device, uuid)
+ guestfs_h *g;
+ char *device;
+ char *uuid;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_set_e2uuid (g, device, uuid);
+ if (r == -1)
+ croak ("set_e2uuid: %s", guestfs_last_error (g));
+
+SV *
+get_e2uuid (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ char *uuid;
+ CODE:
+ uuid = guestfs_get_e2uuid (g, device);
+ if (uuid == NULL)
+ croak ("get_e2uuid: %s", guestfs_last_error (g));
+ RETVAL = newSVpv (uuid, 0);
+ free (uuid);
+ OUTPUT:
+ RETVAL
+
+SV *
+fsck (g, fstype, device)
+ guestfs_h *g;
+ char *fstype;
+ char *device;
+PREINIT:
+ int status;
+ CODE:
+ status = guestfs_fsck (g, fstype, device);
+ if (status == -1)
+ croak ("fsck: %s", guestfs_last_error (g));
+ RETVAL = newSViv (status);
+ OUTPUT:
+ RETVAL
+
+void
+zero (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_zero (g, device);
+ if (r == -1)
+ croak ("zero: %s", guestfs_last_error (g));
+
+void
+grub_install (g, root, device)
+ guestfs_h *g;
+ char *root;
+ char *device;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_grub_install (g, root, device);
+ if (r == -1)
+ croak ("grub_install: %s", guestfs_last_error (g));
+
+void
+cp (g, src, dest)
+ guestfs_h *g;
+ char *src;
+ char *dest;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_cp (g, src, dest);
+ if (r == -1)
+ croak ("cp: %s", guestfs_last_error (g));
+
+void
+cp_a (g, src, dest)
+ guestfs_h *g;
+ char *src;
+ char *dest;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_cp_a (g, src, dest);
+ if (r == -1)
+ croak ("cp_a: %s", guestfs_last_error (g));
+
+void
+mv (g, src, dest)
+ guestfs_h *g;
+ char *src;
+ char *dest;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_mv (g, src, dest);
+ if (r == -1)
+ croak ("mv: %s", guestfs_last_error (g));
+
+void
+drop_caches (g, whattodrop)
+ guestfs_h *g;
+ int whattodrop;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_drop_caches (g, whattodrop);
+ if (r == -1)
+ croak ("drop_caches: %s", guestfs_last_error (g));
+
+SV *
+dmesg (g)
+ guestfs_h *g;
+PREINIT:
+ char *kmsgs;
+ CODE:
+ kmsgs = guestfs_dmesg (g);
+ if (kmsgs == NULL)
+ croak ("dmesg: %s", guestfs_last_error (g));
+ RETVAL = newSVpv (kmsgs, 0);
+ free (kmsgs);
+ OUTPUT:
+ RETVAL
+
+void
+ping_daemon (g)
+ guestfs_h *g;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_ping_daemon (g);
+ if (r == -1)
+ croak ("ping_daemon: %s", guestfs_last_error (g));
+
+SV *
+equal (g, file1, file2)
+ guestfs_h *g;
+ char *file1;
+ char *file2;
+PREINIT:
+ int equality;
+ CODE:
+ equality = guestfs_equal (g, file1, file2);
+ if (equality == -1)
+ croak ("equal: %s", guestfs_last_error (g));
+ RETVAL = newSViv (equality);
+ OUTPUT:
+ RETVAL
+
+void
+strings (g, path)
+ guestfs_h *g;
+ char *path;
+PREINIT:
+ char **stringsout;
+ int i, n;
+ PPCODE:
+ stringsout = guestfs_strings (g, path);
+ if (stringsout == NULL)
+ croak ("strings: %s", guestfs_last_error (g));
+ for (n = 0; stringsout[n] != NULL; ++n) /**/;
+ EXTEND (SP, n);
+ for (i = 0; i < n; ++i) {
+ PUSHs (sv_2mortal (newSVpv (stringsout[i], 0)));
+ free (stringsout[i]);
+ }
+ free (stringsout);
+
+void
+strings_e (g, encoding, path)
+ guestfs_h *g;
+ char *encoding;
+ char *path;
+PREINIT:
+ char **stringsout;
+ int i, n;
+ PPCODE:
+ stringsout = guestfs_strings_e (g, encoding, path);
+ if (stringsout == NULL)
+ croak ("strings_e: %s", guestfs_last_error (g));
+ for (n = 0; stringsout[n] != NULL; ++n) /**/;
+ EXTEND (SP, n);
+ for (i = 0; i < n; ++i) {
+ PUSHs (sv_2mortal (newSVpv (stringsout[i], 0)));
+ free (stringsout[i]);
+ }
+ free (stringsout);
+
+SV *
+hexdump (g, path)
+ guestfs_h *g;
+ char *path;
+PREINIT:
+ char *dump;
+ CODE:
+ dump = guestfs_hexdump (g, path);
+ if (dump == NULL)
+ croak ("hexdump: %s", guestfs_last_error (g));
+ RETVAL = newSVpv (dump, 0);
+ free (dump);
+ OUTPUT:
+ RETVAL
+
+void
+zerofree (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_zerofree (g, device);
+ if (r == -1)
+ croak ("zerofree: %s", guestfs_last_error (g));
+
+void
+pvresize (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_pvresize (g, device);
+ if (r == -1)
+ croak ("pvresize: %s", guestfs_last_error (g));
+
+void
+sfdisk_N (g, device, partnum, cyls, heads, sectors, line)
+ guestfs_h *g;
+ char *device;
+ int partnum;
+ int cyls;
+ int heads;
+ int sectors;
+ char *line;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_sfdisk_N (g, device, partnum, cyls, heads, sectors, line);
+ if (r == -1)
+ croak ("sfdisk_N: %s", guestfs_last_error (g));
+
+SV *
+sfdisk_l (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ char *partitions;
+ CODE:
+ partitions = guestfs_sfdisk_l (g, device);
+ if (partitions == NULL)
+ croak ("sfdisk_l: %s", guestfs_last_error (g));
+ RETVAL = newSVpv (partitions, 0);
+ free (partitions);
+ OUTPUT:
+ RETVAL
+
+SV *
+sfdisk_kernel_geometry (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ char *partitions;
+ CODE:
+ partitions = guestfs_sfdisk_kernel_geometry (g, device);
+ if (partitions == NULL)
+ croak ("sfdisk_kernel_geometry: %s", guestfs_last_error (g));
+ RETVAL = newSVpv (partitions, 0);
+ free (partitions);
+ OUTPUT:
+ RETVAL
+
+SV *
+sfdisk_disk_geometry (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ char *partitions;
+ CODE:
+ partitions = guestfs_sfdisk_disk_geometry (g, device);
+ if (partitions == NULL)
+ croak ("sfdisk_disk_geometry: %s", guestfs_last_error (g));
+ RETVAL = newSVpv (partitions, 0);
+ free (partitions);
+ OUTPUT:
+ RETVAL
+
+void
+vg_activate_all (g, activate)
+ guestfs_h *g;
+ int activate;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_vg_activate_all (g, activate);
+ if (r == -1)
+ croak ("vg_activate_all: %s", guestfs_last_error (g));
+
+void
+vg_activate (g, activate, volgroups)
+ guestfs_h *g;
+ int activate;
+ char **volgroups;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_vg_activate (g, activate, volgroups);
+ free (volgroups);
+ if (r == -1)
+ croak ("vg_activate: %s", guestfs_last_error (g));
+
+void
+lvresize (g, device, mbytes)
+ guestfs_h *g;
+ char *device;
+ int mbytes;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_lvresize (g, device, mbytes);
+ if (r == -1)
+ croak ("lvresize: %s", guestfs_last_error (g));
+
+void
+resize2fs (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_resize2fs (g, device);
+ if (r == -1)
+ croak ("resize2fs: %s", guestfs_last_error (g));
+
+void
+find (g, directory)
+ guestfs_h *g;
+ char *directory;
+PREINIT:
+ char **names;
+ int i, n;
+ PPCODE:
+ names = guestfs_find (g, directory);
+ if (names == NULL)
+ croak ("find: %s", guestfs_last_error (g));
+ for (n = 0; names[n] != NULL; ++n) /**/;
+ EXTEND (SP, n);
+ for (i = 0; i < n; ++i) {
+ PUSHs (sv_2mortal (newSVpv (names[i], 0)));
+ free (names[i]);
+ }
+ free (names);
+
+void
+e2fsck_f (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_e2fsck_f (g, device);
+ if (r == -1)
+ croak ("e2fsck_f: %s", guestfs_last_error (g));
+
+void
+sleep (g, secs)
+ guestfs_h *g;
+ int secs;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_sleep (g, secs);
+ if (r == -1)
+ croak ("sleep: %s", guestfs_last_error (g));
+
+SV *
+ntfs_3g_probe (g, rw, device)
+ guestfs_h *g;
+ int rw;
+ char *device;
+PREINIT:
+ int status;
+ CODE:
+ status = guestfs_ntfs_3g_probe (g, rw, device);
+ if (status == -1)
+ croak ("ntfs_3g_probe: %s", guestfs_last_error (g));
+ RETVAL = newSViv (status);
+ OUTPUT:
+ RETVAL
+
+SV *
+sh (g, command)
+ guestfs_h *g;
+ char *command;
+PREINIT:
+ char *output;
+ CODE:
+ output = guestfs_sh (g, command);
+ if (output == NULL)
+ croak ("sh: %s", guestfs_last_error (g));
+ RETVAL = newSVpv (output, 0);
+ free (output);
+ OUTPUT:
+ RETVAL
+
+void
+sh_lines (g, command)