[Libguestfs] [PATCH] mkfs: enable to make xfs filesystems when the device already has a filesystem

Wanlong Gao wanlong.gao at gmail.com
Fri Dec 2 13:47:51 UTC 2011


Just add the -f option to mkfs.xfs to make sure we can
make a xfs filesystem when the device already has a
filesystem on it.

Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com>
---
 daemon/mkfs.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/daemon/mkfs.c b/daemon/mkfs.c
index f3975dc..a2c2366 100644
--- a/daemon/mkfs.c
+++ b/daemon/mkfs.c
@@ -85,6 +85,9 @@ do_mkfs_opts (const char *fstype, const char *device, int blocksize,
   if (STREQ (fstype, "jfs"))
     ADD_ARG (argv, i, "-f");
 
+  if (STREQ (fstype, "xfs"))
+    ADD_ARG (argv, i, "-f");
+
   /* For GFS, GFS2, assume a single node. */
   if (STREQ (fstype, "gfs") || STREQ (fstype, "gfs2")) {
     ADD_ARG (argv, i, "-p");
-- 
1.7.8.rc3




More information about the Libguestfs mailing list