[Pkg-libvirt-commits] [libguestfs] 03/29: uuid: use newly introduced xfs_set_uuid of xfs
Hilko Bengen
bengen at moszumanska.debian.org
Sun Nov 1 17:15:01 UTC 2015
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag upstream/1.29.49
in repository libguestfs.
commit 516638891472441710c4df912b28229ffd52918e
Author: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
Date: Tue Jun 30 19:23:10 2015 +0800
uuid: use newly introduced xfs_set_uuid of xfs
Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
---
daemon/daemon.h | 1 +
daemon/uuids.c | 12 +-----------
daemon/xfs.c | 7 +++++++
3 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/daemon/daemon.h b/daemon/daemon.h
index e977095..0e6efdd 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -262,6 +262,7 @@ extern int copy_xattrs (const char *src, const char *dest);
/*-- in xfs.c --*/
/* Documented in xfs_admin(8). */
#define XFS_LABEL_MAX 12
+extern int xfs_set_uuid (const char *device, const char *uuid);
/*-- debug-bmap.c --*/
extern char *debug_bmap (const char *subcmd, size_t argc, char *const *const argv);
diff --git a/daemon/uuids.c b/daemon/uuids.c
index eafe62b..7635e76 100644
--- a/daemon/uuids.c
+++ b/daemon/uuids.c
@@ -27,7 +27,6 @@
#include "actions.h"
#include "optgroups.h"
-GUESTFSD_EXT_CMD(str_xfs_admin, xfs_admin);
GUESTFSD_EXT_CMD(str_swaplabel, swaplabel);
static int
@@ -48,22 +47,13 @@ e2uuid (const char *device, const char *uuid)
static int
xfsuuid (const char *device, const char *uuid)
{
- int r;
- CLEANUP_FREE char *err = NULL;
-
/* Don't allow special values. */
if (STREQ (uuid, "nil") || STREQ (uuid, "generate")) {
reply_with_error ("xfs: invalid new UUID");
return -1;
}
- r = command (NULL, &err, str_xfs_admin, "-U", uuid, device, NULL);
- if (r == -1) {
- reply_with_error ("%s", err);
- return -1;
- }
-
- return 0;
+ return xfs_set_uuid (device, uuid);
}
static int
diff --git a/daemon/xfs.c b/daemon/xfs.c
index 687013b..fb7acb4 100644
--- a/daemon/xfs.c
+++ b/daemon/xfs.c
@@ -456,6 +456,13 @@ do_xfs_growfs (const char *path,
}
int
+xfs_set_uuid (const char *device, const char *uuid)
+{
+ optargs_bitmask = GUESTFS_XFS_ADMIN_UUID_BITMASK;
+ return do_xfs_admin (device, 0, 0, 0, 0, 0, NULL, uuid);
+}
+
+int
do_xfs_admin (const char *device,
int extunwritten, int imgfile, int v2log,
int projid32bit,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list