mkfs: optimization and code cleanup v1->v2: fix a typo pointed by Matt Optimizations by reducing the STREQ operations and do some code cleanup. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> RWMJ: Whitespace changes.
mkfs: enable to make xfs filesystems when the device already has a filesystem Just add the -f option to mkfs.xfs to make sure we can make a xfs filesystem when the device already has a filesystem on it. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
daemon: Define safe ADD_ARG macro for constructing arg lists on the stack.
Update FSF address.
mkfs: Don't die if mke2fs is not available. Allow other types of filesystems to be created.
mkfs-opts: Add optional sectorsize parameter.
Implement inode option to mkfs_opts command. This is needed because older versions of grub(for example in centos) do not understand filesystems created with newer version of e2fsprogs. By default in e2fsprogs 1.4+ creates partitions with 256 bit inode size, and grub expect 128 bit size.
RHEL 5: Use mke4fs on RHEL 5 as replacement for mke2fs.
mkfs: Force mke2fs to create a filesystem even on raw IDE device (RHBZ#690819).
mkfs-opts: Add optional "features" parameter. This allows the -O parameter to be added to the mkfs command line. This is used to select filesystem features.
Remove several unused local variables. (Revealed by compiling under Debian where this is a warning).
New API: mkfs_opts, mkfs with optional arguments. This is an extensible version of 'mkfs' which supports optional arguments. There is now no need for 'mkfs_b' since you should use 'mkfs_opts' with the optional 'blocksize' argument instead.
mkfs-b: Map block size to cluster size for VFAT and NTFS partitions (RHBZ#599464). This also adds a regression test for VFAT and (conditionally) NTFS filesystems.
mkfs-b: Check that blocksize parameter is > 0 and a power of 2.
appliance: Set $PATH instead of hard-coding paths to binaries everywhere. Change the appliance so PATH includes common directories. Thus we don't need to hard-code paths to binaries (eg. "/sbin/fdisk") everywhere.
daemon: Don't need to prefix error messages with the command name. The RPC stubs already prefix the command name to error messages. The daemon doesn't have to do this. As a (small) benefit this also makes the daemon slightly smaller. Code in the daemon such as: if (argv[0] == NULL) { reply_with_error ("passed an empty list"); return NULL; } now results in error messages like this: ><fs> command "" libguestfs: error: command: passed an empty list (whereas previously you would have seen ..command: command:..)
use STREQ, not strcmp: part 1 git grep -l 'strcmp *([^=]*== *0'|xargs \ perl -pi -e 's/\bstrcmp( *\(.*?\)) *== *0/STREQ$1/g'
appliance: Enhance mkfs to support many more filesystem types. This fixes support for NTFS, and adds support for: - reiserfs - btrfs - GFS and GFS2 - JFS - HFS and HFS+ - NILFS - OCFS2 (disabled) We don't enable OCFS2 by default, because it pulls in about 140 extra packages into the appliance. GFS & GFS2 default to single node (no lock manager etc).
indent with spaces, not TABs
New commands: mkfs-b, mke2journal*, mke2fs-J* mkfs-b: Pass the -b (blocksize) parameter to mkfs. mke2journal and friends: Lets you create external ext2 journals on devices. mke2fs-J and friends: Lets you create ext2/3/4 filesystems with external journals.