[Libguestfs] [PATCH 4/5] uuid: use existed do_mkswap_U

Chen Hanxiao chenhanxiao at cn.fujitsu.com
Wed Jun 24 07:54:06 UTC 2015


Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
---
 daemon/daemon.h |  3 +++
 daemon/uuids.c  | 13 +------------
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/daemon/daemon.h b/daemon/daemon.h
index aba6ef2..c887cfd 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -275,6 +275,9 @@ extern int btrfstune_set_uuid (const char *device, const char *uuid);
 /*-- in ntfs.c --*/
 extern char *ntfs_get_label (const char *device);
 
+/*-- in swap.c --*/
+extern int do_mkswap_U (const char *device, const char *uuid);
+
 /* ordinary daemon functions use these to indicate errors
  * NB: you don't need to prefix the string with the current command,
  * it is added automatically by the client-side RPC stubs.
diff --git a/daemon/uuids.c b/daemon/uuids.c
index 0520113..704906d 100644
--- a/daemon/uuids.c
+++ b/daemon/uuids.c
@@ -27,8 +27,6 @@
 #include "actions.h"
 #include "optgroups.h"
 
-GUESTFSD_EXT_CMD(str_swaplabel, swaplabel);
-
 static int
 e2uuid (const char *device, const char *uuid)
 {
@@ -59,16 +57,7 @@ xfsuuid (const char *device, const char *uuid)
 static int
 swapuuid (const char *device, const char *uuid)
 {
-  int r;
-  CLEANUP_FREE char *err = NULL;
-
-  r = command (NULL, &err, str_swaplabel, "-U", uuid, device, NULL);
-  if (r == -1) {
-    reply_with_error ("%s", err);
-    return -1;
-  }
-
-  return 0;
+  return do_mkswap_U (device, uuid);
 }
 
 static int
-- 
2.1.0




More information about the Libguestfs mailing list