Signed-off-by: Chen Hanxiao <chenhanx...@cn.fujitsu.com>
---
 daemon/daemon.h | 1 +
 daemon/xfs.c    | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/daemon/daemon.h b/daemon/daemon.h
index 6c07c6a..6d98eb9 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -262,6 +262,7 @@ extern int copy_xattrs (const char *src, const char *dest);
 /* Documented in xfs_admin(8). */
 #define XFS_LABEL_MAX 12
 extern int xfs_set_uuid (const char *device, const char *uuid);
+extern int xfs_set_uuid_random (const char *device);
 
 /*-- debug-bmap.c --*/
 extern char *debug_bmap (const char *subcmd, size_t argc, char *const *const 
argv);
diff --git a/daemon/xfs.c b/daemon/xfs.c
index fb7acb4..2c93311 100644
--- a/daemon/xfs.c
+++ b/daemon/xfs.c
@@ -463,6 +463,13 @@ xfs_set_uuid (const char *device, const char *uuid)
 }
 
 int
+xfs_set_uuid_random (const char *device)
+{
+  optargs_bitmask = GUESTFS_XFS_ADMIN_UUID_BITMASK;
+  return do_xfs_admin (device, 0, 0, 0, 0, 0, NULL, "generate");
+}
+
+int
 do_xfs_admin (const char *device,
               int extunwritten, int imgfile, int v2log,
               int projid32bit,
-- 
2.1.0

_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs

Reply via email to