summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--daemon/mkfs.c23
-rw-r--r--generator/generator_actions.ml51
-rw-r--r--generator/generator_perl.ml4
-rw-r--r--generator/generator_tests_c_api.ml4
-rw-r--r--gobject/Makefile.am2
-rw-r--r--gobject/Makefile.inc4
-rw-r--r--po/POTFILES2
-rwxr-xr-xtests/guests/guest-aux/make-debian-img.sh10
-rwxr-xr-xtests/guests/guest-aux/make-fedora-img.pl10
-rwxr-xr-xtests/guests/guest-aux/make-ubuntu-img.sh4
10 files changed, 46 insertions, 68 deletions
diff --git a/daemon/mkfs.c b/daemon/mkfs.c
index 85442e01..c7ae50d9 100644
--- a/daemon/mkfs.c
+++ b/daemon/mkfs.c
@@ -33,8 +33,8 @@
/* Takes optional arguments, consult optargs_bitmask. */
int
-do_mkfs_opts (const char *fstype, const char *device, int blocksize,
- const char *features, int inode, int sectorsize)
+do_mkfs (const char *fstype, const char *device, int blocksize,
+ const char *features, int inode, int sectorsize)
{
const char *argv[MAX_ARGS];
size_t i = 0;
@@ -100,7 +100,7 @@ do_mkfs_opts (const char *fstype, const char *device, int blocksize,
}
/* Process blocksize parameter if set. */
- if (optargs_bitmask & GUESTFS_MKFS_OPTS_BLOCKSIZE_BITMASK) {
+ if (optargs_bitmask & GUESTFS_MKFS_BLOCKSIZE_BITMASK) {
if (blocksize <= 0 || !is_power_of_2 (blocksize)) {
reply_with_error ("block size must be > 0 and a power of 2");
return -1;
@@ -146,12 +146,12 @@ do_mkfs_opts (const char *fstype, const char *device, int blocksize,
}
}
- if (optargs_bitmask & GUESTFS_MKFS_OPTS_FEATURES_BITMASK) {
+ if (optargs_bitmask & GUESTFS_MKFS_FEATURES_BITMASK) {
ADD_ARG (argv, i, "-O");
ADD_ARG (argv, i, features);
}
- if (optargs_bitmask & GUESTFS_MKFS_OPTS_INODE_BITMASK) {
+ if (optargs_bitmask & GUESTFS_MKFS_INODE_BITMASK) {
if (!extfs) {
reply_with_error ("inode size (-I) can only be set on ext2/3/4 filesystems");
return -1;
@@ -167,7 +167,7 @@ do_mkfs_opts (const char *fstype, const char *device, int blocksize,
ADD_ARG (argv, i, inode_str);
}
- if (optargs_bitmask & GUESTFS_MKFS_OPTS_SECTORSIZE_BITMASK) {
+ if (optargs_bitmask & GUESTFS_MKFS_SECTORSIZE_BITMASK) {
if (!STREQ (fstype, "ufs")) {
reply_with_error ("sector size (-S) can only be set on ufs filesystems");
return -1;
@@ -198,15 +198,8 @@ do_mkfs_opts (const char *fstype, const char *device, int blocksize,
}
int
-do_mkfs (const char *fstype, const char *device)
-{
- optargs_bitmask = 0;
- return do_mkfs_opts (fstype, device, 0, 0, 0, 0);
-}
-
-int
do_mkfs_b (const char *fstype, int blocksize, const char *device)
{
- optargs_bitmask = GUESTFS_MKFS_OPTS_BLOCKSIZE_BITMASK;
- return do_mkfs_opts (fstype, device, blocksize, 0, 0, 0);
+ optargs_bitmask = GUESTFS_MKFS_BLOCKSIZE_BITMASK;
+ return do_mkfs (fstype, device, blocksize, 0, 0, 0);
}
diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml
index 6f46f80e..b530f772 100644
--- a/generator/generator_actions.ml
+++ b/generator/generator_actions.ml
@@ -1950,7 +1950,7 @@ let daemon_functions = [
tests = [
InitEmpty, Always, TestOutput (
[["part_disk"; "/dev/sda"; "mbr"];
- ["mkfs"; "ext2"; "/dev/sda1"];
+ ["mkfs"; "ext2"; "/dev/sda1"; ""; "NOARG"; ""; ""];
["mount"; "/dev/sda1"; "/"];
["write"; "/new"; "new file contents"];
["cat"; "/new"]], "new file contents")
@@ -2713,24 +2713,6 @@ This creates an LVM logical volume called C<logvol>
on the volume group C<volgroup>, with C<size> megabytes." };
{ defaults with
- name = "mkfs";
- style = RErr, [String "fstype"; Device "device"], [];
- proc_nr = Some 42;
- tests = [
- InitEmpty, Always, TestOutput (
- [["part_disk"; "/dev/sda"; "mbr"];
- ["mkfs"; "ext2"; "/dev/sda1"];
- ["mount_options"; ""; "/dev/sda1"; "/"];
- ["write"; "/new"; "new file contents"];
- ["cat"; "/new"]], "new file contents")
- ];
- shortdesc = "make a filesystem";
- longdesc = "\
-This creates a filesystem on C<device> (usually a partition
-or LVM logical volume). The filesystem type is C<fstype>, for
-example C<ext3>." };
-
- { defaults with
name = "sfdisk";
style = RErr, [Device "device";
Int "cyls"; Int "heads"; Int "sectors";
@@ -2793,12 +2775,12 @@ characters does I<not> work, even if the length is specified." };
tests = [
InitEmpty, Always, TestOutputListOfDevices (
[["part_disk"; "/dev/sda"; "mbr"];
- ["mkfs"; "ext2"; "/dev/sda1"];
+ ["mkfs"; "ext2"; "/dev/sda1"; ""; "NOARG"; ""; ""];
["mount_options"; ""; "/dev/sda1"; "/"];
["mounts"]], ["/dev/sda1"]);
InitEmpty, Always, TestOutputList (
[["part_disk"; "/dev/sda"; "mbr"];
- ["mkfs"; "ext2"; "/dev/sda1"];
+ ["mkfs"; "ext2"; "/dev/sda1"; ""; "NOARG"; ""; ""];
["mount_options"; ""; "/dev/sda1"; "/"];
["umount"; "/"];
["mounts"]], [])
@@ -2841,9 +2823,9 @@ See also: C<guestfs_mountpoints>" };
["part_add"; "/dev/sda"; "p"; "64"; "204799"];
["part_add"; "/dev/sda"; "p"; "204800"; "409599"];
["part_add"; "/dev/sda"; "p"; "409600"; "-64"];
- ["mkfs"; "ext2"; "/dev/sda1"];
- ["mkfs"; "ext2"; "/dev/sda2"];
- ["mkfs"; "ext2"; "/dev/sda3"];
+ ["mkfs"; "ext2"; "/dev/sda1"; ""; "NOARG"; ""; ""];
+ ["mkfs"; "ext2"; "/dev/sda2"; ""; "NOARG"; ""; ""];
+ ["mkfs"; "ext2"; "/dev/sda3"; ""; "NOARG"; ""; ""];
["mount_options"; ""; "/dev/sda1"; "/"];
["mkdir"; "/mp1"];
["mount_options"; ""; "/dev/sda2"; "/mp1"];
@@ -4093,7 +4075,7 @@ the human-readable, canonical hex dump of the file." };
tests = [
InitNone, Always, TestOutput (
[["part_disk"; "/dev/sda"; "mbr"];
- ["mkfs"; "ext3"; "/dev/sda1"];
+ ["mkfs"; "ext3"; "/dev/sda1"; ""; "NOARG"; ""; ""];
["mount_options"; ""; "/dev/sda1"; "/"];
["write"; "/new"; "test file"];
["umount"; "/dev/sda1"];
@@ -4217,7 +4199,7 @@ are activated or deactivated." };
["pvcreate"; "/dev/sda1"];
["vgcreate"; "VG"; "/dev/sda1"];
["lvcreate"; "LV"; "VG"; "10"];
- ["mkfs"; "ext2"; "/dev/VG/LV"];
+ ["mkfs"; "ext2"; "/dev/VG/LV"; ""; "NOARG"; ""; ""];
["mount_options"; ""; "/dev/VG/LV"; "/"];
["write"; "/new"; "test content"];
["umount"; "/"];
@@ -4331,11 +4313,11 @@ Sleep for C<secs> seconds." };
tests = [
InitNone, Always, TestOutputInt (
[["part_disk"; "/dev/sda"; "mbr"];
- ["mkfs"; "ntfs"; "/dev/sda1"];
+ ["mkfs"; "ntfs"; "/dev/sda1"; ""; "NOARG"; ""; ""];
["ntfs_3g_probe"; "true"; "/dev/sda1"]], 0);
InitNone, Always, TestOutputInt (
[["part_disk"; "/dev/sda"; "mbr"];
- ["mkfs"; "ext2"; "/dev/sda1"];
+ ["mkfs"; "ext2"; "/dev/sda1"; ""; "NOARG"; ""; ""];
["ntfs_3g_probe"; "true"; "/dev/sda1"]], 12)
];
shortdesc = "probe NTFS volume";
@@ -5700,7 +5682,7 @@ and C<guestfs_setcon>" };
name = "mkfs_b";
style = RErr, [String "fstype"; Int "blocksize"; Device "device"], [];
proc_nr = Some 187;
- deprecated_by = Some "mkfs_opts";
+ deprecated_by = Some "mkfs";
tests = [
InitEmpty, Always, TestOutput (
[["part_disk"; "/dev/sda"; "mbr"];
@@ -7565,13 +7547,14 @@ not refer to a logical volume.
See also C<guestfs_is_lv>, C<guestfs_canonical_device_name>." };
{ defaults with
- name = "mkfs_opts";
+ name = "mkfs";
style = RErr, [String "fstype"; Device "device"], [OInt "blocksize"; OString "features"; OInt "inode"; OInt "sectorsize"];
proc_nr = Some 278;
+ once_had_no_optargs = true;
tests = [
InitEmpty, Always, TestOutput (
[["part_disk"; "/dev/sda"; "mbr"];
- ["mkfs_opts"; "ext2"; "/dev/sda1"; ""; "NOARG"; ""; ""];
+ ["mkfs"; "ext2"; "/dev/sda1"; ""; "NOARG"; ""; ""];
["mount_options"; ""; "/dev/sda1"; "/"];
["write"; "/new"; "new file contents"];
["cat"; "/new"]], "new file contents")
@@ -8293,7 +8276,7 @@ device." };
optional = Some "ntfs3g";
tests = [
InitPartition, IfAvailable "ntfs3g", TestRun (
- [["mkfs"; "ntfs"; "/dev/sda1"];
+ [["mkfs"; "ntfs"; "/dev/sda1"; ""; "NOARG"; ""; ""];
["ntfsfix"; "/dev/sda1"; "false"]])
];
shortdesc = "fix common errors and force Windows to check NTFS";
@@ -8352,7 +8335,7 @@ any existing contents of this device." };
[["set_label"; "/dev/sda1"; "testlabel"];
["vfs_label"; "/dev/sda1"]], "testlabel");
InitPartition, IfAvailable "ntfs3g", TestOutput (
- [["mkfs"; "ntfs"; "/dev/sda1"];
+ [["mkfs"; "ntfs"; "/dev/sda1"; ""; "NOARG"; ""; ""];
["set_label"; "/dev/sda1"; "testlabel2"];
["vfs_label"; "/dev/sda1"]], "testlabel2");
InitPartition, Always, TestLastFail (
@@ -8539,7 +8522,7 @@ For more information on the optional arguments, see L<mkfs.btrfs(8)>.
Since btrfs filesystems can span multiple devices, this takes a
non-empty list of devices.
-To create general filesystems, use C<guestfs_mkfs_opts>." };
+To create general filesystems, use C<guestfs_mkfs>." };
{ defaults with
name = "get_e2attrs";
diff --git a/generator/generator_perl.ml b/generator/generator_perl.ml
index b363bfc6..3fd5c2d8 100644
--- a/generator/generator_perl.ml
+++ b/generator/generator_perl.ml
@@ -938,7 +938,7 @@ containing useful introspection information about the method
(further fields may be added to this in future).
use Sys::Guestfs;
- $Sys::Guestfs::guestfs_introspection{mkfs_opts}
+ $Sys::Guestfs::guestfs_introspection{mkfs}
=> {
ret => 'void', # return type
args => [ # required arguments
@@ -951,7 +951,7 @@ containing useful introspection information about the method
inode => [ 'inode', 'int', 2 ],
sectorsize => [ 'sectorsize', 'int', 3 ],
},
- name => \"mkfs_opts\",
+ name => \"mkfs\",
description => \"make a filesystem\",
}
diff --git a/generator/generator_tests_c_api.ml b/generator/generator_tests_c_api.ml
index 6505e910..83087dae 100644
--- a/generator/generator_tests_c_api.ml
+++ b/generator/generator_tests_c_api.ml
@@ -452,7 +452,7 @@ and generate_one_test_body name i test_name init test =
["umount_all"];
["lvm_remove_all"];
["part_disk"; "/dev/sda"; "mbr"];
- ["mkfs"; "ext2"; "/dev/sda1"];
+ ["mkfs"; "ext2"; "/dev/sda1"; ""; "NOARG"; ""; ""];
["mount_options"; ""; "/dev/sda1"; "/"]]
| InitBasicFSonLVM ->
pr " /* InitBasicFSonLVM for %s: create ext2 on /dev/VG/LV */\n"
@@ -465,7 +465,7 @@ and generate_one_test_body name i test_name init test =
["pvcreate"; "/dev/sda1"];
["vgcreate"; "VG"; "/dev/sda1"];
["lvcreate"; "LV"; "VG"; "8"];
- ["mkfs"; "ext2"; "/dev/VG/LV"];
+ ["mkfs"; "ext2"; "/dev/VG/LV"; ""; "NOARG"; ""; ""];
["mount_options"; ""; "/dev/VG/LV"; "/"]]
| InitISOFS ->
pr " /* InitISOFS for %s */\n" test_name;
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index cc360c81..60e4fb9e 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -45,6 +45,8 @@ CLEANFILES = \
CLEANFILES += \
src/optargs-add_drive_opts.c \
include/guestfs-gobject/optargs-add_drive_opts.h \
+ src/optargs-mkfs_opts.c \
+ include/guestfs-gobject/optargs-mkfs_opts.h \
src/optargs-test0.c \
include/guestfs-gobject/optargs-test0.h
diff --git a/gobject/Makefile.inc b/gobject/Makefile.inc
index d8c6eed4..543fd9b4 100644
--- a/gobject/Makefile.inc
+++ b/gobject/Makefile.inc
@@ -44,7 +44,7 @@ guestfs_gobject_headers= \
include/guestfs-gobject/optargs-inspect_get_icon.h \
include/guestfs-gobject/optargs-mount_local.h \
include/guestfs-gobject/optargs-umount_local.h \
- include/guestfs-gobject/optargs-mkfs_opts.h \
+ include/guestfs-gobject/optargs-mkfs.h \
include/guestfs-gobject/optargs-mount_9p.h \
include/guestfs-gobject/optargs-ntfsresize_opts.h \
include/guestfs-gobject/optargs-btrfs_filesystem_resize.h \
@@ -88,7 +88,7 @@ guestfs_gobject_sources= \
src/optargs-inspect_get_icon.c \
src/optargs-mount_local.c \
src/optargs-umount_local.c \
- src/optargs-mkfs_opts.c \
+ src/optargs-mkfs.c \
src/optargs-mount_9p.c \
src/optargs-ntfsresize_opts.c \
src/optargs-btrfs_filesystem_resize.c \
diff --git a/po/POTFILES b/po/POTFILES
index f659a9d4..d09a23ce 100644
--- a/po/POTFILES
+++ b/po/POTFILES
@@ -147,8 +147,8 @@ gobject/src/optargs-fstrim.c
gobject/src/optargs-inspect_get_icon.c
gobject/src/optargs-internal_test.c
gobject/src/optargs-md_create.c
+gobject/src/optargs-mkfs.c
gobject/src/optargs-mkfs_btrfs.c
-gobject/src/optargs-mkfs_opts.c
gobject/src/optargs-mount_9p.c
gobject/src/optargs-mount_local.c
gobject/src/optargs-ntfsclone_out.c
diff --git a/tests/guests/guest-aux/make-debian-img.sh b/tests/guests/guest-aux/make-debian-img.sh
index 659e8ec5..00a68d5a 100755
--- a/tests/guests/guest-aux/make-debian-img.sh
+++ b/tests/guests/guest-aux/make-debian-img.sh
@@ -48,18 +48,18 @@ lvcreate var debian 32
lvcreate home debian 32
# Phony /boot filesystem.
-mkfs-opts ext2 /dev/sda1 blocksize:4096
+mkfs ext2 /dev/sda1 blocksize:4096
set-label /dev/sda1 BOOT
set-e2uuid /dev/sda1 01234567-0123-0123-0123-012345678901
# Phony root and other filesystems.
-mkfs-opts ext2 /dev/debian/root blocksize:4096
+mkfs ext2 /dev/debian/root blocksize:4096
set-e2uuid /dev/debian/root 01234567-0123-0123-0123-012345678902
-mkfs-opts ext2 /dev/debian/usr blocksize:4096
+mkfs ext2 /dev/debian/usr blocksize:4096
set-e2uuid /dev/debian/usr 01234567-0123-0123-0123-012345678903
-mkfs-opts ext2 /dev/debian/var blocksize:4096
+mkfs ext2 /dev/debian/var blocksize:4096
set-e2uuid /dev/debian/var 01234567-0123-0123-0123-012345678904
-mkfs-opts ext2 /dev/debian/home blocksize:4096
+mkfs ext2 /dev/debian/home blocksize:4096
set-e2uuid /dev/debian/home 01234567-0123-0123-0123-012345678905
# Enough to fool inspection API.
diff --git a/tests/guests/guest-aux/make-fedora-img.pl b/tests/guests/guest-aux/make-fedora-img.pl
index 6a0a183e..9991b73d 100755
--- a/tests/guests/guest-aux/make-fedora-img.pl
+++ b/tests/guests/guest-aux/make-fedora-img.pl
@@ -125,12 +125,12 @@ $g->lvcreate ('LV2', 'VG', 32);
$g->lvcreate ('LV3', 'VG', 64);
# Phony /boot filesystem
-$g->mkfs_opts ('ext2', $bootdev, blocksize => 4096);
+$g->mkfs ('ext2', $bootdev, blocksize => 4096);
$g->set_label ($bootdev, 'BOOT');
$g->set_e2uuid ($bootdev, '01234567-0123-0123-0123-012345678901');
# Phony root filesystem.
-$g->mkfs_opts ('ext2', '/dev/VG/Root', blocksize => 4096);
+$g->mkfs ('ext2', '/dev/VG/Root', blocksize => 4096);
$g->set_label ('/dev/VG/Root', 'ROOT');
$g->set_e2uuid ('/dev/VG/Root', '01234567-0123-0123-0123-012345678902');
@@ -190,9 +190,9 @@ $g->mknod (0777, 10, 10, '/bin/test7');
# Other filesystems.
# Note that these should be empty, for testing virt-df.
-$g->mkfs_opts ('ext2', '/dev/VG/LV1', blocksize => 4096);
-$g->mkfs_opts ('ext2', '/dev/VG/LV2', blocksize => 1024);
-$g->mkfs_opts ('ext2', '/dev/VG/LV3', blocksize => 2048);
+$g->mkfs ('ext2', '/dev/VG/LV1', blocksize => 4096);
+$g->mkfs ('ext2', '/dev/VG/LV2', blocksize => 1024);
+$g->mkfs ('ext2', '/dev/VG/LV3', blocksize => 2048);
# Cleanup
$g->shutdown ();
diff --git a/tests/guests/guest-aux/make-ubuntu-img.sh b/tests/guests/guest-aux/make-ubuntu-img.sh
index 81388602..7a583198 100755
--- a/tests/guests/guest-aux/make-ubuntu-img.sh
+++ b/tests/guests/guest-aux/make-ubuntu-img.sh
@@ -49,12 +49,12 @@ part-add /dev/sda p 64 524287
part-add /dev/sda p 524288 -64
# Phony /boot filesystem.
-mkfs-opts ext2 /dev/sda1 blocksize:4096
+mkfs ext2 /dev/sda1 blocksize:4096
set-label /dev/sda1 BOOT
set-e2uuid /dev/sda1 01234567-0123-0123-0123-012345678901
# Phony root filesystem (Ubuntu doesn't use LVM by default).
-mkfs-opts ext2 /dev/sda2 blocksize:4096
+mkfs ext2 /dev/sda2 blocksize:4096
set-e2uuid /dev/sda2 01234567-0123-0123-0123-012345678902
# Enough to fool inspection API.