throws LibGuestFSException;
/**
+ * set memory allocated to the qemu subprocess
+ * <p>
+ * This sets the memory size in megabytes allocated to the
+ * qemu subprocess. This only has any effect if called
+ * before "g.launch".
+ * <p>
+ * You can also change this by setting the environment
+ * variable "LIBGUESTFS_MEMSIZE" before the handle is
+ * created.
+ * <p>
+ * For more information on the architecture of libguestfs,
+ * see guestfs(3).
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public void set_memsize (int memsize)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("set_memsize: handle is closed");
+ _set_memsize (g, memsize);
+ }
+ private native void _set_memsize (long g, int memsize)
+ throws LibGuestFSException;
+
+ /**
+ * get memory allocated to the qemu subprocess
+ * <p>
+ * This gets the memory size in megabytes allocated to the
+ * qemu subprocess.
+ * <p>
+ * If "g.set_memsize" was not called on this handle, and if
+ * "LIBGUESTFS_MEMSIZE" was not set, then this returns the
+ * compiled-in default value for memsize.
+ * <p>
+ * For more information on the architecture of libguestfs,
+ * see guestfs(3).
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public int get_memsize ()
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("get_memsize: handle is closed");
+ return _get_memsize (g);
+ }
+ private native int _get_memsize (long g)
+ throws LibGuestFSException;
+
+ /**
* mount a guest disk at a position in the filesystem
* <p>
* Mount a guest disk at a position in the filesystem.
private native String[] _tail_n (long g, int nrlines, String path)
throws LibGuestFSException;
+ /**
+ * report file system disk space usage
+ * <p>
+ * This command runs the "df" command to report disk space
+ * used.
+ * <p>
+ * This command is mostly useful for interactive sessions.
+ * It is *not* intended that you try to parse the output
+ * string. Use "statvfs" from programs.
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public String df ()
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("df: handle is closed");
+ return _df (g);
+ }
+ private native String _df (long g)
+ throws LibGuestFSException;
+
+ /**
+ * report file system disk space usage (human readable)
+ * <p>
+ * This command runs the "df -h" command to report disk
+ * space used in human-readable format.
+ * <p>
+ * This command is mostly useful for interactive sessions.
+ * It is *not* intended that you try to parse the output
+ * string. Use "statvfs" from programs.
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public String df_h ()
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("df_h: handle is closed");
+ return _df_h (g);
+ }
+ private native String _df_h (long g)
+ throws LibGuestFSException;
+
+ /**
+ * estimate file space usage
+ * <p>
+ * This command runs the "du -s" command to estimate file
+ * space usage for "path".
+ * <p>
+ * "path" can be a file or a directory. If "path" is a
+ * directory then the estimate includes the contents of the
+ * directory and all subdirectories (recursively).
+ * <p>
+ * The result is the estimated size in *kilobytes* (ie.
+ * units of 1024 bytes).
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public long du (String path)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("du: handle is closed");
+ return _du (g, path);
+ }
+ private native long _du (long g, String path)
+ throws LibGuestFSException;
+
+ /**
+ * list files in an initrd
+ * <p>
+ * This command lists out files contained in an initrd.
+ * <p>
+ * The files are listed without any initial "/" character.
+ * The files are listed in the order they appear (not
+ * necessarily alphabetical). Directory names are listed as
+ * separate items.
+ * <p>
+ * Old Linux kernels (2.4 and earlier) used a compressed
+ * ext2 filesystem as initrd. We *only* support the newer
+ * initramfs format (compressed cpio files).
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public String[] initrd_list (String path)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("initrd_list: handle is closed");
+ return _initrd_list (g, path);
+ }
+ private native String[] _initrd_list (long g, String path)
+ throws LibGuestFSException;
+
+ /**
+ * mount a file using the loop device
+ * <p>
+ * This command lets you mount "file" (a filesystem image
+ * in a file) on a mount point. It is entirely equivalent
+ * to the command "mount -o loop file mountpoint".
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public void mount_loop (String file, String mountpoint)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("mount_loop: handle is closed");
+ _mount_loop (g, file, mountpoint);
+ }
+ private native void _mount_loop (long g, String file, String mountpoint)
+ throws LibGuestFSException;
+
+ /**
+ * create a swap partition
+ * <p>
+ * Create a swap partition on "device".
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public void mkswap (String device)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("mkswap: handle is closed");
+ _mkswap (g, device);
+ }
+ private native void _mkswap (long g, String device)
+ throws LibGuestFSException;
+
+ /**
+ * create a swap partition with a label
+ * <p>
+ * Create a swap partition on "device" with label "label".
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public void mkswap_L (String label, String device)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("mkswap_L: handle is closed");
+ _mkswap_L (g, label, device);
+ }
+ private native void _mkswap_L (long g, String label, String device)
+ throws LibGuestFSException;
+
+ /**
+ * create a swap partition with an explicit UUID
+ * <p>
+ * Create a swap partition on "device" with UUID "uuid".
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public void mkswap_U (String uuid, String device)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("mkswap_U: handle is closed");
+ _mkswap_U (g, uuid, device);
+ }
+ private native void _mkswap_U (long g, String uuid, String device)
+ throws LibGuestFSException;
+
+ /**
+ * make block, character or FIFO devices
+ * <p>
+ * This call creates block or character special devices, or
+ * named pipes (FIFOs).
+ * <p>
+ * The "mode" parameter should be the mode, using the
+ * standard constants. "devmajor" and "devminor" are the
+ * device major and minor numbers, only used when creating
+ * block and character special devices.
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public void mknod (int mode, int devmajor, int devminor, String path)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("mknod: handle is closed");
+ _mknod (g, mode, devmajor, devminor, path);
+ }
+ private native void _mknod (long g, int mode, int devmajor, int devminor, String path)
+ throws LibGuestFSException;
+
+ /**
+ * make FIFO (named pipe)
+ * <p>
+ * This call creates a FIFO (named pipe) called "path" with
+ * mode "mode". It is just a convenient wrapper around
+ * "g.mknod".
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public void mkfifo (int mode, String path)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("mkfifo: handle is closed");
+ _mkfifo (g, mode, path);
+ }
+ private native void _mkfifo (long g, int mode, String path)
+ throws LibGuestFSException;
+
+ /**
+ * make block device node
+ * <p>
+ * This call creates a block device node called "path" with
+ * mode "mode" and device major/minor "devmajor" and
+ * "devminor". It is just a convenient wrapper around
+ * "g.mknod".
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public void mknod_b (int mode, int devmajor, int devminor, String path)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("mknod_b: handle is closed");
+ _mknod_b (g, mode, devmajor, devminor, path);
+ }
+ private native void _mknod_b (long g, int mode, int devmajor, int devminor, String path)
+ throws LibGuestFSException;
+
+ /**
+ * make char device node
+ * <p>
+ * This call creates a char device node called "path" with
+ * mode "mode" and device major/minor "devmajor" and
+ * "devminor". It is just a convenient wrapper around
+ * "g.mknod".
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public void mknod_c (int mode, int devmajor, int devminor, String path)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("mknod_c: handle is closed");
+ _mknod_c (g, mode, devmajor, devminor, path);
+ }
+ private native void _mknod_c (long g, int mode, int devmajor, int devminor, String path)
+ throws LibGuestFSException;
+
+ /**
+ * set file mode creation mask (umask)
+ * <p>
+ * This function sets the mask used for creating new files
+ * and device nodes to "mask & 0777".
+ * <p>
+ * Typical umask values would be 022 which creates new
+ * files with permissions like "-rw-r--r--" or
+ * "-rwxr-xr-x", and 002 which creates new files with
+ * permissions like "-rw-rw-r--" or "-rwxrwxr-x".
+ * <p>
+ * See also umask(2), "g.mknod", "g.mkdir".
+ * <p>
+ * This call returns the previous umask.
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public int umask (int mask)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("umask: handle is closed");
+ return _umask (g, mask);
+ }
+ private native int _umask (long g, int mask)
+ throws LibGuestFSException;
+
}