X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Fcmds.c;h=fe59737e8c9912d4b9e5c3cd031234ba8135f8be;hb=f20854ec61eef1aea313920f0cf193a78c1a9219;hp=ed59804b8ae248c5010562007107d23d6d6a7d80;hpb=c6d6f5ae1b76ec9aa5c540906aeed73d25d13eb9;p=libguestfs.git diff --git a/fish/cmds.c b/fish/cmds.c index ed59804..fe59737 100644 --- a/fish/cmds.c +++ b/fish/cmds.c @@ -83,6 +83,7 @@ void list_commands (void) printf ("%-20s %s\n", "get-autosync", "get autosync mode"); printf ("%-20s %s\n", "get-e2label", "get the ext2/3/4 filesystem label"); printf ("%-20s %s\n", "get-e2uuid", "get the ext2/3/4 filesystem UUID"); + printf ("%-20s %s\n", "get-memsize", "get memory allocated to the qemu subprocess"); printf ("%-20s %s\n", "get-path", "get the search path"); printf ("%-20s %s\n", "get-qemu", "get the qemu binary"); printf ("%-20s %s\n", "get-state", "get the current state"); @@ -115,8 +116,16 @@ void list_commands (void) printf ("%-20s %s\n", "mkdir", "create a directory"); printf ("%-20s %s\n", "mkdir-p", "create a directory and parents"); printf ("%-20s %s\n", "mkdtemp", "create a temporary directory"); + printf ("%-20s %s\n", "mkfifo", "make FIFO (named pipe)"); printf ("%-20s %s\n", "mkfs", "make a filesystem"); + printf ("%-20s %s\n", "mknod", "make block, character or FIFO devices"); + printf ("%-20s %s\n", "mknod-b", "make block device node"); + printf ("%-20s %s\n", "mknod-c", "make char device node"); + printf ("%-20s %s\n", "mkswap", "create a swap partition"); + printf ("%-20s %s\n", "mkswap-L", "create a swap partition with a label"); + printf ("%-20s %s\n", "mkswap-U", "create a swap partition with an explicit UUID"); printf ("%-20s %s\n", "mount", "mount a guest disk at a position in the filesystem"); + printf ("%-20s %s\n", "mount-loop", "mount a file using the loop device"); printf ("%-20s %s\n", "mount-options", "mount a guest disk with mount options"); printf ("%-20s %s\n", "mount-ro", "mount a guest disk, read-only"); printf ("%-20s %s\n", "mount-vfs", "mount a guest disk with mount options and vfstype"); @@ -141,6 +150,7 @@ void list_commands (void) printf ("%-20s %s\n", "set-autosync", "set autosync mode"); printf ("%-20s %s\n", "set-e2label", "set the ext2/3/4 filesystem label"); printf ("%-20s %s\n", "set-e2uuid", "set the ext2/3/4 filesystem UUID"); + printf ("%-20s %s\n", "set-memsize", "set memory allocated to the qemu subprocess"); printf ("%-20s %s\n", "set-path", "set the search path"); printf ("%-20s %s\n", "set-qemu", "set the qemu binary"); printf ("%-20s %s\n", "set-verbose", "set verbose mode"); @@ -165,6 +175,7 @@ void list_commands (void) printf ("%-20s %s\n", "tgz-out", "pack directory into compressed tarball"); printf ("%-20s %s\n", "touch", "update file timestamps or create a new file"); printf ("%-20s %s\n", "tune2fs-l", "get ext2/ext3/ext4 superblock details"); + printf ("%-20s %s\n", "umask", "set file mode creation mask (umask)"); printf ("%-20s %s\n", "umount", "unmount a filesystem"); printf ("%-20s %s\n", "umount-all", "unmount all filesystems"); printf ("%-20s %s\n", "upload", "upload a file from the local machine"); @@ -192,13 +203,13 @@ void display_command (const char *cmd) pod2text ("kill-subprocess - kill the qemu subprocess", " kill-subprocess\n\nThis kills the qemu subprocess. You should never need to call this."); else if (strcasecmp (cmd, "add_drive") == 0 || strcasecmp (cmd, "add-drive") == 0 || strcasecmp (cmd, "add") == 0) - pod2text ("add-drive - add an image to examine or modify", " add-drive \n\nThis function adds a virtual machine disk image C to the\nguest. The first time you call this function, the disk appears as IDE\ndisk 0 (C) in the guest, the second time as C, and\nso on.\n\nYou don't necessarily need to be root when using libguestfs. However\nyou obviously do need sufficient permissions to access the filename\nfor whatever operations you want to perform (ie. read access if you\njust want to read the image or write access if you want to modify the\nimage).\n\nThis is equivalent to the qemu parameter C<-drive file=filename,cache=off>.\n\nNote that this call checks for the existence of C. This\nstops you from specifying other types of drive which are supported\nby qemu such as C and C URLs. To specify those, use\nthe general C call instead.\n\nYou can use 'add' as an alias for this command."); + pod2text ("add-drive - add an image to examine or modify", " add-drive \n\nThis function adds a virtual machine disk image C to the\nguest. The first time you call this function, the disk appears as IDE\ndisk 0 (C) in the guest, the second time as C, and\nso on.\n\nYou don't necessarily need to be root when using libguestfs. However\nyou obviously do need sufficient permissions to access the filename\nfor whatever operations you want to perform (ie. read access if you\njust want to read the image or write access if you want to modify the\nimage).\n\nThis is equivalent to the qemu parameter\nC<-drive file=filename,cache=off,if=virtio>.\n\nNote that this call checks for the existence of C. This\nstops you from specifying other types of drive which are supported\nby qemu such as C and C URLs. To specify those, use\nthe general C call instead.\n\nYou can use 'add' as an alias for this command."); else if (strcasecmp (cmd, "add_cdrom") == 0 || strcasecmp (cmd, "add-cdrom") == 0 || strcasecmp (cmd, "cdrom") == 0) pod2text ("add-cdrom - add a CD-ROM disk image to examine", " add-cdrom \n\nThis function adds a virtual CD-ROM disk image to the guest.\n\nThis is equivalent to the qemu parameter C<-cdrom filename>.\n\nNote that this call checks for the existence of C. This\nstops you from specifying other types of drive which are supported\nby qemu such as C and C URLs. To specify those, use\nthe general C call instead.\n\nYou can use 'cdrom' as an alias for this command."); else if (strcasecmp (cmd, "add_drive_ro") == 0 || strcasecmp (cmd, "add-drive-ro") == 0 || strcasecmp (cmd, "add-ro") == 0) - pod2text ("add-drive-ro - add a drive in snapshot mode (read-only)", " add-drive-ro \n\nThis adds a drive in snapshot mode, making it effectively\nread-only.\n\nNote that writes to the device are allowed, and will be seen for\nthe duration of the guestfs handle, but they are written\nto a temporary file which is discarded as soon as the guestfs\nhandle is closed. We don't currently have any method to enable\nchanges to be committed, although qemu can support this.\n\nThis is equivalent to the qemu parameter\nC<-drive file=filename,snapshot=on>.\n\nNote that this call checks for the existence of C. This\nstops you from specifying other types of drive which are supported\nby qemu such as C and C URLs. To specify those, use\nthe general C call instead.\n\nYou can use 'add-ro' as an alias for this command."); + pod2text ("add-drive-ro - add a drive in snapshot mode (read-only)", " add-drive-ro \n\nThis adds a drive in snapshot mode, making it effectively\nread-only.\n\nNote that writes to the device are allowed, and will be seen for\nthe duration of the guestfs handle, but they are written\nto a temporary file which is discarded as soon as the guestfs\nhandle is closed. We don't currently have any method to enable\nchanges to be committed, although qemu can support this.\n\nThis is equivalent to the qemu parameter\nC<-drive file=filename,snapshot=on,if=virtio>.\n\nNote that this call checks for the existence of C. This\nstops you from specifying other types of drive which are supported\nby qemu such as C and C URLs. To specify those, use\nthe general C call instead.\n\nYou can use 'add-ro' as an alias for this command."); else if (strcasecmp (cmd, "config") == 0) pod2text ("config - add qemu parameters", " config \n\nThis can be used to add arbitrary qemu command line parameters\nof the form C<-param value>. Actually it's not quite arbitrary - we\nprevent you from setting some parameters which would interfere with\nparameters that we use.\n\nThe first character of C string must be a C<-> (dash).\n\nC can be NULL."); @@ -248,6 +259,12 @@ void display_command (const char *cmd) if (strcasecmp (cmd, "get_state") == 0 || strcasecmp (cmd, "get-state") == 0) pod2text ("get-state - get the current state", " get-state\n\nThis returns the current state as an opaque integer. This is\nonly useful for printing debug and internal error messages.\n\nFor more information on states, see L."); else + if (strcasecmp (cmd, "set_memsize") == 0 || strcasecmp (cmd, "set-memsize") == 0 || strcasecmp (cmd, "memsize") == 0) + pod2text ("set-memsize - set memory allocated to the qemu subprocess", " set-memsize \n\nThis sets the memory size in megabytes allocated to the\nqemu subprocess. This only has any effect if called before\nC.\n\nYou can also change this by setting the environment\nvariable C before the handle is\ncreated.\n\nFor more information on the architecture of libguestfs,\nsee L.\n\nYou can use 'memsize' as an alias for this command."); + else + if (strcasecmp (cmd, "get_memsize") == 0 || strcasecmp (cmd, "get-memsize") == 0) + pod2text ("get-memsize - get memory allocated to the qemu subprocess", " get-memsize\n\nThis gets the memory size in megabytes allocated to the\nqemu subprocess.\n\nIf C was not called\non this handle, and if C was not set,\nthen this returns the compiled-in default value for memsize.\n\nFor more information on the architecture of libguestfs,\nsee L."); + else if (strcasecmp (cmd, "mount") == 0) pod2text ("mount - mount a guest disk at a position in the filesystem", " mount \n\nMount a guest disk at a position in the filesystem. Block devices\nare named C, C and so on, as they were added to\nthe guest. If those block devices contain partitions, they will have\nthe usual names (eg. C). Also LVM C-style\nnames can be used.\n\nThe rules are the same as for L: A filesystem must\nfirst be mounted on C before others can be mounted. Other\nfilesystems can only be mounted on directories which already\nexist.\n\nThe mounted filesystem is writable, if we have sufficient permissions\non the underlying device.\n\nThe filesystem options C and C are set with this\ncall, in order to improve reliability."); else @@ -632,6 +649,33 @@ void display_command (const char *cmd) if (strcasecmp (cmd, "initrd_list") == 0 || strcasecmp (cmd, "initrd-list") == 0) pod2text ("initrd-list - list files in an initrd", " initrd-list \n\nThis command lists out files contained in an initrd.\n\nThe files are listed without any initial C character. The\nfiles are listed in the order they appear (not necessarily\nalphabetical). Directory names are listed as separate items.\n\nOld Linux kernels (2.4 and earlier) used a compressed ext2\nfilesystem as initrd. We I support the newer initramfs\nformat (compressed cpio files)."); else + if (strcasecmp (cmd, "mount_loop") == 0 || strcasecmp (cmd, "mount-loop") == 0) + pod2text ("mount-loop - mount a file using the loop device", " mount-loop \n\nThis command lets you mount C (a filesystem image\nin a file) on a mount point. It is entirely equivalent to\nthe command C."); + else + if (strcasecmp (cmd, "mkswap") == 0) + pod2text ("mkswap - create a swap partition", " mkswap \n\nCreate a swap partition on C."); + else + if (strcasecmp (cmd, "mkswap_L") == 0 || strcasecmp (cmd, "mkswap-L") == 0) + pod2text ("mkswap-L - create a swap partition with a label", " mkswap-L