umount: use Dev_or_Path for the argument type

Use Dev_or_Path instead of String.

Remove the RESOLVE_DEVICE since Dev_or_Path will generate
REQUIRE_ROOT_OR_RESOLVE_DEVICE instead.

RWMJ:
Note a change in semantics: this now requires root.  However this is
OK and still works with mkmountpoint and friends because
'is_root_mounted' works even if something is mounted below the root.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
This commit is contained in:
Wanlong Gao
2012-07-24 16:47:23 +08:00
committed by Richard W.M. Jones
parent c03cdcc25c
commit d8b2c1afee
2 changed files with 1 additions and 4 deletions

View File

@@ -205,9 +205,6 @@ do_umount (const char *pathordevice,
return -1;
}
if (is_dev)
RESOLVE_DEVICE (buf, , { free (buf); return -1; });
if (!(optargs_bitmask & GUESTFS_UMOUNT_FORCE_BITMASK))
force = 0;
if (!(optargs_bitmask & GUESTFS_UMOUNT_LAZYUNMOUNT_BITMASK))

View File

@@ -2772,7 +2772,7 @@ characters does I<not> work, even if the length is specified." };
{ defaults with
name = "umount";
style = RErr, [String "pathordevice"], [OBool "force"; OBool "lazyunmount"];
style = RErr, [Dev_or_Path "pathordevice"], [OBool "force"; OBool "lazyunmount"];
proc_nr = Some 45;
fish_alias = ["unmount"];
once_had_no_optargs = true;