summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-07-12 16:38:57 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-07-14 13:08:21 +0100
commit95d26f02405c090f886fc2c47a9e51ca37f9c09e (patch)
treea02f6d76a67c34f9047c185153a6d228a68046b4
parente055bf4caba24fd24153984770ffe71b42003f76 (diff)
downloadlibguestfs-95d26f02405c090f886fc2c47a9e51ca37f9c09e.tar.gz
libguestfs-95d26f02405c090f886fc2c47a9e51ca37f9c09e.tar.xz
libguestfs-95d26f02405c090f886fc2c47a9e51ca37f9c09e.zip
generator: Rename 'ntfsresize_opts' API to 'ntfsresize'.
By using the once_had_no_optargs flag, this change is backwards compatible for callers.
-rw-r--r--daemon/ntfs.c16
-rw-r--r--generator/generator_actions.ml27
-rw-r--r--gobject/Makefile.am2
-rw-r--r--gobject/Makefile.inc4
-rw-r--r--po/POTFILES2
-rw-r--r--resize/resize.ml2
6 files changed, 15 insertions, 38 deletions
diff --git a/daemon/ntfs.c b/daemon/ntfs.c
index 235ecbcd..2dedc268 100644
--- a/daemon/ntfs.c
+++ b/daemon/ntfs.c
@@ -64,7 +64,7 @@ do_ntfs_3g_probe (int rw, const char *device)
/* Takes optional arguments, consult optargs_bitmask. */
int
-do_ntfsresize_opts (const char *device, int64_t size, int force)
+do_ntfsresize (const char *device, int64_t size, int force)
{
char *err;
int r;
@@ -75,7 +75,7 @@ do_ntfsresize_opts (const char *device, int64_t size, int force)
ADD_ARG (argv, i, "ntfsresize");
ADD_ARG (argv, i, "-P");
- if (optargs_bitmask & GUESTFS_NTFSRESIZE_OPTS_SIZE_BITMASK) {
+ if (optargs_bitmask & GUESTFS_NTFSRESIZE_SIZE_BITMASK) {
if (size <= 0) {
reply_with_error ("size is zero or negative");
return -1;
@@ -86,7 +86,7 @@ do_ntfsresize_opts (const char *device, int64_t size, int force)
ADD_ARG (argv, i, size_str);
}
- if (optargs_bitmask & GUESTFS_NTFSRESIZE_OPTS_FORCE_BITMASK && force)
+ if (optargs_bitmask & GUESTFS_NTFSRESIZE_FORCE_BITMASK && force)
ADD_ARG (argv, i, "--force");
ADD_ARG (argv, i, device);
@@ -104,16 +104,10 @@ do_ntfsresize_opts (const char *device, int64_t size, int force)
}
int
-do_ntfsresize (const char *device)
-{
- return do_ntfsresize_opts (device, 0, 0);
-}
-
-int
do_ntfsresize_size (const char *device, int64_t size)
{
- optargs_bitmask = GUESTFS_NTFSRESIZE_OPTS_SIZE_BITMASK;
- return do_ntfsresize_opts (device, size, 0);
+ optargs_bitmask = GUESTFS_NTFSRESIZE_SIZE_BITMASK;
+ return do_ntfsresize (device, size, 0);
}
/* Takes optional arguments, consult optargs_bitmask. */
diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml
index b530f772..93221269 100644
--- a/generator/generator_actions.ml
+++ b/generator/generator_actions.ml
@@ -6710,26 +6710,6 @@ This command packs the contents of C<directory> and downloads
it to local file C<tarball> (as an xz compressed tar archive)." };
{ defaults with
- name = "ntfsresize";
- style = RErr, [Device "device"], [];
- proc_nr = Some 231;
- optional = Some "ntfsprogs"; deprecated_by = Some "ntfsresize_opts";
- shortdesc = "resize an NTFS filesystem";
- longdesc = "\
-This command resizes an NTFS filesystem, expanding or
-shrinking it to the size of the underlying device.
-
-I<Note:> After the resize operation, the filesystem is marked
-as requiring a consistency check (for safety). You have to boot
-into Windows to perform this check and clear this condition.
-Furthermore, ntfsresize refuses to resize filesystems
-which have been marked in this way. So in effect it is
-not possible to call ntfsresize multiple times on a single
-filesystem without booting into Windows between each resize.
-
-See also L<ntfsresize(8)>." };
-
- { defaults with
name = "vgscan";
style = RErr, [], [];
proc_nr = Some 232;
@@ -7039,7 +7019,7 @@ allows you to specify the new size (in bytes) explicitly." };
name = "ntfsresize_size";
style = RErr, [Device "device"; Int64 "size"], [];
proc_nr = Some 250;
- optional = Some "ntfsprogs"; deprecated_by = Some "ntfsresize_opts";
+ optional = Some "ntfsprogs"; deprecated_by = Some "ntfsresize";
shortdesc = "resize an NTFS filesystem (with size)";
longdesc = "\
This command is the same as C<guestfs_ntfsresize> except that it
@@ -7750,8 +7730,9 @@ returned in this list. Call C<guestfs_lvs> if you want to list logical
volumes." };
{ defaults with
- name = "ntfsresize_opts";
+ name = "ntfsresize";
style = RErr, [Device "device"], [OInt64 "size"; OBool "force"];
+ once_had_no_optargs = true;
proc_nr = Some 288;
optional = Some "ntfsprogs"; camel_name = "NTFSResizeOpts";
shortdesc = "resize an NTFS filesystem";
@@ -7777,7 +7758,7 @@ After the resize operation, the filesystem is always marked
as requiring a consistency check (for safety). You have to boot
into Windows to perform this check and clear this condition.
If you I<don't> set the C<force> option then it is not
-possible to call C<guestfs_ntfsresize_opts> multiple times on a
+possible to call C<guestfs_ntfsresize> multiple times on a
single filesystem without booting into Windows between each resize.
=back
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index 60e4fb9e..ce4a8530 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -47,6 +47,8 @@ CLEANFILES += \
include/guestfs-gobject/optargs-add_drive_opts.h \
src/optargs-mkfs_opts.c \
include/guestfs-gobject/optargs-mkfs_opts.h \
+ src/optargs-ntfsresize_opts.c \
+ include/guestfs-gobject/optargs-ntfsresize_opts.h \
src/optargs-test0.c \
include/guestfs-gobject/optargs-test0.h
diff --git a/gobject/Makefile.inc b/gobject/Makefile.inc
index 543fd9b4..4de56a96 100644
--- a/gobject/Makefile.inc
+++ b/gobject/Makefile.inc
@@ -46,7 +46,7 @@ guestfs_gobject_headers= \
include/guestfs-gobject/optargs-umount_local.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-ntfsresize.h \
include/guestfs-gobject/optargs-btrfs_filesystem_resize.h \
include/guestfs-gobject/optargs-compress_out.h \
include/guestfs-gobject/optargs-compress_device_out.h \
@@ -90,7 +90,7 @@ guestfs_gobject_sources= \
src/optargs-umount_local.c \
src/optargs-mkfs.c \
src/optargs-mount_9p.c \
- src/optargs-ntfsresize_opts.c \
+ src/optargs-ntfsresize.c \
src/optargs-btrfs_filesystem_resize.c \
src/optargs-compress_out.c \
src/optargs-compress_device_out.c \
diff --git a/po/POTFILES b/po/POTFILES
index d09a23ce..7f679115 100644
--- a/po/POTFILES
+++ b/po/POTFILES
@@ -153,7 +153,7 @@ gobject/src/optargs-mount_9p.c
gobject/src/optargs-mount_local.c
gobject/src/optargs-ntfsclone_out.c
gobject/src/optargs-ntfsfix.c
-gobject/src/optargs-ntfsresize_opts.c
+gobject/src/optargs-ntfsresize.c
gobject/src/optargs-set_e2attrs.c
gobject/src/optargs-tune2fs.c
gobject/src/optargs-umount_local.c
diff --git a/resize/resize.ml b/resize/resize.ml
index 9ef2bbd3..90b4e991 100644
--- a/resize/resize.ml
+++ b/resize/resize.ml
@@ -1139,7 +1139,7 @@ let () =
let do_expand_content target = function
| PVResize -> g#pvresize target
| Resize2fs -> g#resize2fs target
- | NTFSResize -> g#ntfsresize_opts ~force:ntfsresize_force target
+ | NTFSResize -> g#ntfsresize ~force:ntfsresize_force target
| BtrfsFilesystemResize ->
(* Complicated ... Btrfs forces us to mount the filesystem
* in order to resize it.