X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=ocaml%2Fguestfs.mli;h=125fa979f89cd0b60bb75726c53672410ab2962a;hp=b1452abef976090c1ce661e4f0a5375d80c885bf;hb=8c3b820c2b687345448e3d74a7101b07ff32688e;hpb=e7eca50046e9a69dac27c0bee832af0a3014e02c diff --git a/ocaml/guestfs.mli b/ocaml/guestfs.mli index b1452ab..125fa97 100644 --- a/ocaml/guestfs.mli +++ b/ocaml/guestfs.mli @@ -94,6 +94,36 @@ type lvm_lv = { modules : string; } +type stat = { + dev : int64; + ino : int64; + mode : int64; + nlink : int64; + uid : int64; + gid : int64; + rdev : int64; + size : int64; + blksize : int64; + blocks : int64; + atime : int64; + mtime : int64; + ctime : int64; +} + +type statvfs = { + bsize : int64; + frsize : int64; + blocks : int64; + bfree : int64; + bavail : int64; + files : int64; + ffree : int64; + favail : int64; + fsid : int64; + flag : int64; + namemax : int64; +} + val launch : t -> unit (** launch the qemu subprocess *) @@ -112,6 +142,12 @@ val add_cdrom : t -> string -> unit val config : t -> string -> string option -> unit (** add qemu parameters *) +val set_qemu : t -> string -> unit +(** set the qemu binary *) + +val get_qemu : t -> string +(** get the qemu binary *) + val set_path : t -> string -> unit (** set the search path *) @@ -130,6 +166,27 @@ val set_verbose : t -> bool -> unit val get_verbose : t -> bool (** get verbose mode *) +val is_ready : t -> bool +(** is ready to accept commands *) + +val is_config : t -> bool +(** is in configuration state *) + +val is_launching : t -> bool +(** is launching subprocess *) + +val is_busy : t -> bool +(** is busy processing a command *) + +val get_state : t -> int +(** get the current state *) + +val set_busy : t -> unit +(** set state to busy *) + +val set_ready : t -> unit +(** set state to ready *) + val mount : t -> string -> string -> unit (** mount a guest disk at a position in the filesystem *) @@ -211,3 +268,198 @@ val aug_save : t -> unit val aug_load : t -> unit (** load files into the tree *) +val aug_ls : t -> string -> string array +(** list Augeas nodes under a path *) + +val rm : t -> string -> unit +(** remove a file *) + +val rmdir : t -> string -> unit +(** remove a directory *) + +val rm_rf : t -> string -> unit +(** remove a file or directory recursively *) + +val mkdir : t -> string -> unit +(** create a directory *) + +val mkdir_p : t -> string -> unit +(** create a directory and parents *) + +val chmod : t -> int -> string -> unit +(** change file mode *) + +val chown : t -> int -> int -> string -> unit +(** change file owner and group *) + +val exists : t -> string -> bool +(** test if file or directory exists *) + +val is_file : t -> string -> bool +(** test if file exists *) + +val is_dir : t -> string -> bool +(** test if file exists *) + +val pvcreate : t -> string -> unit +(** create an LVM physical volume *) + +val vgcreate : t -> string -> string array -> unit +(** create an LVM volume group *) + +val lvcreate : t -> string -> string -> int -> unit +(** create an LVM volume group *) + +val mkfs : t -> string -> string -> unit +(** make a filesystem *) + +val sfdisk : t -> string -> int -> int -> int -> string array -> unit +(** create partitions on a block device *) + +val write_file : t -> string -> string -> int -> unit +(** create a file *) + +val umount : t -> string -> unit +(** unmount a filesystem *) + +val mounts : t -> string array +(** show mounted filesystems *) + +val umount_all : t -> unit +(** unmount all filesystems *) + +val lvm_remove_all : t -> unit +(** remove all LVM LVs, VGs and PVs *) + +val file : t -> string -> string +(** determine file type *) + +val command : t -> string array -> string +(** run a command from the guest filesystem *) + +val command_lines : t -> string array -> string array +(** run a command, returning lines *) + +val stat : t -> string -> stat +(** get file information *) + +val lstat : t -> string -> stat +(** get file information for a symbolic link *) + +val statvfs : t -> string -> statvfs +(** get file system statistics *) + +val tune2fs_l : t -> string -> (string * string) list +(** get ext2/ext3/ext4 superblock details *) + +val blockdev_setro : t -> string -> unit +(** set block device to read-only *) + +val blockdev_setrw : t -> string -> unit +(** set block device to read-write *) + +val blockdev_getro : t -> string -> bool +(** is block device set to read-only *) + +val blockdev_getss : t -> string -> int +(** get sectorsize of block device *) + +val blockdev_getbsz : t -> string -> int +(** get blocksize of block device *) + +val blockdev_setbsz : t -> string -> int -> unit +(** set blocksize of block device *) + +val blockdev_getsz : t -> string -> int64 +(** get total size of device in 512-byte sectors *) + +val blockdev_getsize64 : t -> string -> int64 +(** get total size of device in bytes *) + +val blockdev_flushbufs : t -> string -> unit +(** flush device buffers *) + +val blockdev_rereadpt : t -> string -> unit +(** reread partition table *) + +val upload : t -> string -> string -> unit +(** upload a file from the local machine *) + +val download : t -> string -> string -> unit +(** download a file to the local machine *) + +val checksum : t -> string -> string -> string +(** compute MD5, SHAx or CRC checksum of file *) + +val tar_in : t -> string -> string -> unit +(** unpack tarfile to directory *) + +val tar_out : t -> string -> string -> unit +(** pack directory into tarfile *) + +val tgz_in : t -> string -> string -> unit +(** unpack compressed tarball to directory *) + +val tgz_out : t -> string -> string -> unit +(** pack directory into compressed tarball *) + +val mount_ro : t -> string -> string -> unit +(** mount a guest disk, read-only *) + +val mount_options : t -> string -> string -> string -> unit +(** mount a guest disk with mount options *) + +val mount_vfs : t -> string -> string -> string -> string -> unit +(** mount a guest disk with mount options and vfstype *) + +val debug : t -> string -> string array -> string +(** debugging and internals *) + +val lvremove : t -> string -> unit +(** remove an LVM logical volume *) + +val vgremove : t -> string -> unit +(** remove an LVM volume group *) + +val pvremove : t -> string -> unit +(** remove an LVM physical volume *) + +val set_e2label : t -> string -> string -> unit +(** set the ext2/3/4 filesystem label *) + +val get_e2label : t -> string -> string +(** get the ext2/3/4 filesystem label *) + +val set_e2uuid : t -> string -> string -> unit +(** set the ext2/3/4 filesystem UUID *) + +val get_e2uuid : t -> string -> string +(** get the ext2/3/4 filesystem UUID *) + +val fsck : t -> string -> string -> int +(** run the filesystem checker *) + +val zero : t -> string -> unit +(** write zeroes to the device *) + +val grub_install : t -> string -> string -> unit +(** install GRUB *) + +val cp : t -> string -> string -> unit +(** copy a file *) + +val cp_a : t -> string -> string -> unit +(** copy a file or directory recursively *) + +val mv : t -> string -> string -> unit +(** move a file *) + +val drop_caches : t -> int -> unit +(** drop kernel page cache, dentries and inodes *) + +val dmesg : t -> string +(** return kernel messages *) + +val ping_daemon : t -> unit +(** ping the guest daemon *) +