X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fgenerator.ml;h=9393bdec725f143883c6a7e9d07f4069d164617c;hb=dd922bedb7c3e85fbbe1eed10e371aec47138a1d;hp=51c6704bd0f1419c173fcf596ce588e53bbcd5fe;hpb=da54ae6abbd840e28c294949bc796a231f050d6d;p=libguestfs.git diff --git a/src/generator.ml b/src/generator.ml index 51c6704..9393bde 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -139,6 +139,7 @@ and argt = | Dev_or_Path of string (* /dev device name or Pathname, cannot be NULL *) | OptString of string (* const char *name, may be NULL *) | StringList of string(* list of strings (each string cannot be NULL) *) + | DeviceList of string(* list of Device names (each cannot be NULL) *) | Bool of string (* boolean *) | Int of string (* int (smallish ints, signed, <= 31 bits) *) (* These are treated as filenames (simple string parameters) in @@ -1320,7 +1321,7 @@ This creates an LVM physical volume on the named C, where C should usually be a partition name such as C."); - ("vgcreate", (RErr, [String "volgroup"; StringList "physvols"]), 40, [], + ("vgcreate", (RErr, [String "volgroup"; DeviceList "physvols"]), 40, [], [InitEmpty, Always, TestOutputList ( [["sfdiskM"; "/dev/sda"; ",100 ,200 ,"]; ["pvcreate"; "/dev/sda1"]; @@ -2093,10 +2094,10 @@ C."); (let uuid = uuidgen () in [InitBasicFS, Always, TestOutput ( [["set_e2uuid"; "/dev/sda1"; uuid]; - ["get_e2uuid"; "/dev/sda1"]], uuid); + ["get_e2uuid"; "/dev/sda1"]], uuid); InitBasicFS, Always, TestOutput ( [["set_e2uuid"; "/dev/sda1"; "clear"]; - ["get_e2uuid"; "/dev/sda1"]], ""); + ["get_e2uuid"; "/dev/sda1"]], ""); (* We can't predict what UUIDs will be, so just check the commands run. *) InitBasicFS, Always, TestRun ( [["set_e2uuid"; "/dev/sda1"; "random"]]); @@ -2822,7 +2823,7 @@ a limitation of the kernel or swap tools."); (let uuid = uuidgen () in [InitEmpty, Always, TestRun ( [["sfdiskM"; "/dev/sda"; ","]; - ["mkswap_U"; uuid; "/dev/sda1"]])]), + ["mkswap_U"; uuid; "/dev/sda1"]])]), "create a swap partition with an explicit UUID", "\ Create a swap partition on C with UUID C."); @@ -3334,8 +3335,8 @@ labeled swap partition."); (let uuid = uuidgen () in [InitEmpty, Always, TestRun ( [["mkswap_U"; uuid; "/dev/sdb"]; - ["swapon_uuid"; uuid]; - ["swapoff_uuid"; uuid]])]), + ["swapon_uuid"; uuid]; + ["swapoff_uuid"; uuid]])]), "enable swap on swap partition by UUID", "\ This command enables swap to a swap partition with the given UUID. @@ -3475,6 +3476,99 @@ This gets the SELinux security context of the daemon. See the documentation about SELINUX in L, and C"); + ("mkfs_b", (RErr, [String "fstype"; Int "blocksize"; Device "device"]), 187, [], + [InitEmpty, Always, TestOutput ( + [["sfdiskM"; "/dev/sda"; ","]; + ["mkfs_b"; "ext2"; "4096"; "/dev/sda1"]; + ["mount"; "/dev/sda1"; "/"]; + ["write_file"; "/new"; "new file contents"; "0"]; + ["cat"; "/new"]], "new file contents")], + "make a filesystem with block size", + "\ +This call is similar to C, but it allows you to +control the block size of the resulting filesystem. Supported +block sizes depend on the filesystem type, but typically they +are C<1024>, C<2048> or C<4096> only."); + + ("mke2journal", (RErr, [Int "blocksize"; Device "device"]), 188, [], + [InitEmpty, Always, TestOutput ( + [["sfdiskM"; "/dev/sda"; ",100 ,"]; + ["mke2journal"; "4096"; "/dev/sda1"]; + ["mke2fs_J"; "ext2"; "4096"; "/dev/sda2"; "/dev/sda1"]; + ["mount"; "/dev/sda2"; "/"]; + ["write_file"; "/new"; "new file contents"; "0"]; + ["cat"; "/new"]], "new file contents")], + "make ext2/3/4 external journal", + "\ +This creates an ext2 external journal on C. It is equivalent +to the command: + + mke2fs -O journal_dev -b blocksize device"); + + ("mke2journal_L", (RErr, [Int "blocksize"; String "label"; Device "device"]), 189, [], + [InitEmpty, Always, TestOutput ( + [["sfdiskM"; "/dev/sda"; ",100 ,"]; + ["mke2journal_L"; "4096"; "JOURNAL"; "/dev/sda1"]; + ["mke2fs_JL"; "ext2"; "4096"; "/dev/sda2"; "JOURNAL"]; + ["mount"; "/dev/sda2"; "/"]; + ["write_file"; "/new"; "new file contents"; "0"]; + ["cat"; "/new"]], "new file contents")], + "make ext2/3/4 external journal with label", + "\ +This creates an ext2 external journal on C with label C