diff options
author | Richard Jones <rjones@redhat.com> | 2010-04-10 13:13:07 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2010-04-10 13:41:45 +0100 |
commit | f8210da95888f0060b25dcca2ae299d5c16ff814 (patch) | |
tree | 40b676b65c3fd650be602118789f3a61c0f19de9 /daemon/ntfs.c | |
parent | e323d93ed2ab3b55885273ab6bd911e2996346d9 (diff) | |
download | libguestfs-f8210da95888f0060b25dcca2ae299d5c16ff814.tar.gz libguestfs-f8210da95888f0060b25dcca2ae299d5c16ff814.tar.xz libguestfs-f8210da95888f0060b25dcca2ae299d5c16ff814.zip |
New API: ntfsresize.
This implements the ntfsresize operation, using the external
program from ntfsprogs.
Diffstat (limited to 'daemon/ntfs.c')
-rw-r--r-- | daemon/ntfs.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/daemon/ntfs.c b/daemon/ntfs.c index 73ccbbcd..8938dbde 100644 --- a/daemon/ntfs.c +++ b/daemon/ntfs.c @@ -35,6 +35,13 @@ optgroup_ntfs3g_available (void) } int +optgroup_ntfsprogs_available (void) +{ + int r = access ("/usr/sbin/ntfsresize", X_OK); + return r == 0; +} + +int do_ntfs_3g_probe (int rw, const char *device) { char *err; @@ -52,3 +59,19 @@ do_ntfs_3g_probe (int rw, const char *device) return r; } + +int +do_ntfsresize (const char *device) +{ + char *err; + int r; + + r = command (NULL, &err, "ntfsresize", "-P", device, NULL); + if (r == -1) { + reply_with_error ("%s: %s", device, err); + free (err); + return -1; + } + + return 0; +} |