generator: Rename 'ntfsresize_opts' API to 'ntfsresize'.

By using the once_had_no_optargs flag, this change is backwards
compatible for callers.
This commit is contained in:
Richard W.M. Jones
2012-07-12 16:38:57 +01:00
parent e055bf4cab
commit 95d26f0240
6 changed files with 15 additions and 38 deletions

View File

@@ -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);
@@ -103,17 +103,11 @@ do_ntfsresize_opts (const char *device, int64_t size, int force)
return 0;
}
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. */

View File

@@ -6709,26 +6709,6 @@ I<xz compressed> tar file) into C<directory>." };
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, [], [];
@@ -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

View File

@@ -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

View File

@@ -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 \

View File

@@ -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

View File

@@ -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.