Displaying 20 results from an estimated 25 matches for "do_set_uuid".
2015 Jun 23
2
[PATCH] uuid: add support to change uuid of btrfs partition
...d (const char *device, const char *uuid)
+{
+ int r;
+ CLEANUP_FREE char *err = NULL;
+
+ r = command (NULL, &err, str_btrfstune, "-f", "-U", uuid, device, NULL);
+ if (r == -1) {
+ reply_with_error ("%s", err);
+ return -1;
+ }
+
+ return 0;
+}
+
int
do_set_uuid (const char *device, const char *uuid)
{
@@ -111,8 +127,7 @@ do_set_uuid (const char *device, const char *uuid)
r = swapuuid (device, uuid);
else if (STREQ (vfs_type, "btrfs")) {
- reply_with_error ("btrfs filesystems' UUID cannot be changed");
- r = -1;
+...
2014 Nov 28
3
[PATCH 1/3] uuid: add support to change uuid of swap partition
...tic 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;
+}
+
int
do_set_uuid (const char *device, const char *uuid)
{
@@ -91,6 +107,9 @@ do_set_uuid (const char *device, const char *uuid)
else if (STREQ (vfs_type, "xfs"))
r = xfsuuid (device, uuid);
+ else if (STREQ (vfs_type, "swap"))
+ r = swapuuid (device, uuid);
+
else {
reply_...
2015 Jun 24
2
Re: [PATCH v2 1/5] uuid: add support to change uuid of btrfs partition
...2 @@ swapuuid (const char *device, const char *uuid)
> return 0;
> }
>
> +static int
> +btrfsuuid (const char *device, const char *uuid)
> +{
> + return btrfstune_set_uuid (device, uuid);
> +}
What is this wrapper for? Just call btrfs_set_uuid below.
> int
> do_set_uuid (const char *device, const char *uuid)
> {
> @@ -111,8 +117,7 @@ do_set_uuid (const char *device, const char *uuid)
> r = swapuuid (device, uuid);
>
> else if (STREQ (vfs_type, "btrfs")) {
> - reply_with_error ("btrfs filesystems' UUID cannot be ch...
2015 Jun 30
0
[PATCH v4 4/7] uuid: use newly introduced swap_set_uuid
...tic 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;
-}
-
int
do_set_uuid (const char *device, const char *uuid)
{
@@ -88,7 +72,7 @@ do_set_uuid (const char *device, const char *uuid)
r = xfsuuid (device, uuid);
else if (STREQ (vfs_type, "swap"))
- r = swapuuid (device, uuid);
+ r = swap_set_uuid (device, uuid);
else if (STREQ (vfs_type, &...
2015 Jul 06
1
[PATCH] uuids: return ENOTSUP if could not set UUID for specific fs
...en Hanxiao <chenhanxiao@cn.fujitsu.com>
---
daemon/uuids.c | 6 ++----
generator/actions.ml | 3 +++
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/daemon/uuids.c b/daemon/uuids.c
index 20eabe3..00c47d8 100644
--- a/daemon/uuids.c
+++ b/daemon/uuids.c
@@ -77,11 +77,9 @@ do_set_uuid (const char *device, const char *uuid)
else if (STREQ (vfs_type, "btrfs"))
r = btrfs_set_uuid (device, uuid);
- else {
- reply_with_error ("don't know how to set the UUID for '%s' filesystems",
+ else
+ NOT_SUPPORTED(-1, "don't know how to...
2015 Jun 23
0
Re: [PATCH] uuid: add support to change uuid of btrfs partition
...or ("%s", err);
> + return -1;
> + }
> +
> + return 0;
> +}
While other uuid methods are currently here in uuids.c, IMHO they would
better fit together with their filesystem implementations. Similar to
what I did with 6db3c100 and 8ad667f1 for labels.
> int
> do_set_uuid (const char *device, const char *uuid)
> {
> @@ -111,8 +127,7 @@ do_set_uuid (const char *device, const char *uuid)
> r = swapuuid (device, uuid);
>
> else if (STREQ (vfs_type, "btrfs")) {
> - reply_with_error ("btrfs filesystems' UUID cannot be ch...
2015 Jun 24
0
[PATCH v2 1/5] uuid: add support to change uuid of btrfs partition
...ds.c b/daemon/uuids.c
index 06b33e9..f7791ab 100644
--- a/daemon/uuids.c
+++ b/daemon/uuids.c
@@ -91,6 +91,12 @@ swapuuid (const char *device, const char *uuid)
return 0;
}
+static int
+btrfsuuid (const char *device, const char *uuid)
+{
+ return btrfstune_set_uuid (device, uuid);
+}
+
int
do_set_uuid (const char *device, const char *uuid)
{
@@ -111,8 +117,7 @@ do_set_uuid (const char *device, const char *uuid)
r = swapuuid (device, uuid);
else if (STREQ (vfs_type, "btrfs")) {
- reply_with_error ("btrfs filesystems' UUID cannot be changed");
- r = -1;
+...
2015 Jul 01
5
[PATCH v5 0/3] uuid: add btrfs uuid change support and set_uuid_random
- Btrfs-progs v4.1 introduced new feature of changing
uuid of btrfs partition.
This patch add support of this.
- Introduce set_uuid_random
- uuids.c did a lot of deplicated work for changing uuid
of fs. Use existing functions.
v5: use NOT_SUPPORTED macro
improve testcases
v4: introduce get_random_uuid
improve testcases
squash internal API patches
v3.1: fix typos
v3: set errno
2015 Jun 26
5
[PATCH v3 0/4] uuid: add btrfs uuid change support and some rework
- Btrfs-progs v4.1 introduced new feature of changing
uuid of btrfs partition.
This patch add support of this.
- uuids.c did a lot of deplicated work for changing uuid
of fs. Use existing functions.
v3: set errno if feature is not available.
Chen Hanxiao (4):
uuid: add support to change uuid of btrfs partition
uuid: use existing function of ext2
uuid: use newly introduced
2015 Jun 25
0
Re: [PATCH v2 1/5] uuid: add support to change uuid of btrfs partition
...return 0;
> > }
> >
> > +static int
> > +btrfsuuid (const char *device, const char *uuid)
> > +{
> > + return btrfstune_set_uuid (device, uuid);
> > +}
>
> What is this wrapper for? Just call btrfs_set_uuid below.
>
> > int
> > do_set_uuid (const char *device, const char *uuid)
> > {
> > @@ -111,8 +117,7 @@ do_set_uuid (const char *device, const char *uuid)
> > r = swapuuid (device, uuid);
> >
> > else if (STREQ (vfs_type, "btrfs")) {
> > - reply_with_error ("btrfs filesy...
2015 Jun 26
14
[PATCH v3.1 0/9] uuid: add btrfs uuid change support and set_uuid_random
- Btrfs-progs v4.1 introduced new feature of changing
uuid of btrfs partition.
This patch add support of this.
- Introduce set_uuid_random
- uuids.c did a lot of deplicated work for changing uuid
of fs. Use existing functions.
v3.1: fix typos
v3: set errno if feature is not available.
Chen Hanxiao (9):
uuid: add support to change uuid of btrfs partition
uuid: use existing function of
2015 Jun 30
13
[PATCH v4 0/7] uuid: add btrfs uuid change support and set_uuid_random
- Btrfs-progs v4.1 introduced new feature of changing
uuid of btrfs partition.
This patch add support of this.
- Introduce set_uuid_random
- uuids.c did a lot of deplicated work for changing uuid
of fs. Use existing functions.
v4: introduce get_random_uuid
improve testcases
squash internal API patches
v3.1: fix typos
v3: set errno if feature is not available.
Chen Hanxiao (7):
2015 Jun 24
10
[PATCH 0/5] uuid: add btrfs uuid change support and some rework
- Btrfs-progs v4.1 introduced new feature of changing
uuid of btrfs partition.
This patch add support of this.
- uuids.c did a lot of deplicated work for changing uuid
of fs. Use existed functions.
-- Introduce new API: btrfstune_set_uuid_random
Chen Hanxiao (5):
uuid: add support to change uuid of btrfs partition
uuid: use existed function of ext2
uuid: use newly introduced
2015 Jul 02
1
[PATCH v6] New API: set_uuid_random
...0;
}
+int
+ext_set_uuid_random (const char *device)
+{
+ return do_set_e2uuid (device, "random");
+}
+
char *
do_get_e2uuid (const char *device)
{
diff --git a/daemon/uuids.c b/daemon/uuids.c
index 5238f3e..20eabe3 100644
--- a/daemon/uuids.c
+++ b/daemon/uuids.c
@@ -85,3 +85,35 @@ do_set_uuid (const char *device, const char *uuid)
return r;
}
+
+int
+do_set_uuid_random (const char *device)
+{
+ int r;
+
+ /* How we set the UUID depends on the filesystem type. */
+ CLEANUP_FREE char *vfs_type = get_blkid_tag (device, "TYPE");
+ if (vfs_type == NULL)
+ return -1;
+...
2015 Jun 26
0
[PATCH v3.1 9/9] New API: set_uuid_random
...| 16 ++++++++++++++++
src/MAX_PROC_NR | 2 +-
tests/btrfs/test-btrfs-misc.pl | 11 +++++++++++
4 files changed, 59 insertions(+), 1 deletion(-)
diff --git a/daemon/uuids.c b/daemon/uuids.c
index 5238f3e..4530491 100644
--- a/daemon/uuids.c
+++ b/daemon/uuids.c
@@ -85,3 +85,34 @@ do_set_uuid (const char *device, const char *uuid)
return r;
}
+
+int
+do_set_uuid_random (const char *device)
+{
+ int r;
+
+ /* How we set the UUID depends on the filesystem type. */
+ CLEANUP_FREE char *vfs_type = get_blkid_tag (device, "TYPE");
+ if (vfs_type == NULL)
+ return -1;
+...
2015 Jun 30
0
[PATCH v4 7/7] New API: set_uuid_random
...16 ++++++++++++++++
src/MAX_PROC_NR | 2 +-
tests/btrfs/test-btrfs-misc.pl | 15 +++++++++++++++
4 files changed, 63 insertions(+), 1 deletion(-)
diff --git a/daemon/uuids.c b/daemon/uuids.c
index 5238f3e..cd5787f 100644
--- a/daemon/uuids.c
+++ b/daemon/uuids.c
@@ -85,3 +85,34 @@ do_set_uuid (const char *device, const char *uuid)
return r;
}
+
+int
+do_set_uuid_random (const char *device)
+{
+ int r;
+
+ /* How we set the UUID depends on the filesystem type. */
+ CLEANUP_FREE char *vfs_type = get_blkid_tag (device, "TYPE");
+ if (vfs_type == NULL)
+ return -1;
+...
2014 Nov 28
0
[PATCH 2/3] uuid: cannot change btrfs filesystem's UUID
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
---
daemon/uuids.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/daemon/uuids.c b/daemon/uuids.c
index 431d867..06b33e9 100644
--- a/daemon/uuids.c
+++ b/daemon/uuids.c
@@ -110,6 +110,11 @@ do_set_uuid (const char *device, const char *uuid)
else if (STREQ (vfs_type, "swap"))
r = swapuuid (device, uuid);
+ else if (STREQ (vfs_type, "btrfs")) {
+ reply_with_error ("btrfs filesystems' UUID cannot be changed");
+ r = -1;
+ }
+
else {
reply_w...
2015 Jun 26
0
[PATCH v3 1/4] uuid: add support to change uuid of btrfs partition
...const char *device);
+extern int btrfs_set_uuid (const char *device, const char *uuid);
/*-- in ntfs.c --*/
extern char *ntfs_get_label (const char *device);
diff --git a/daemon/uuids.c b/daemon/uuids.c
index 06b33e9..f98d8e5 100644
--- a/daemon/uuids.c
+++ b/daemon/uuids.c
@@ -110,10 +110,8 @@ do_set_uuid (const char *device, const char *uuid)
else if (STREQ (vfs_type, "swap"))
r = swapuuid (device, uuid);
- else if (STREQ (vfs_type, "btrfs")) {
- reply_with_error ("btrfs filesystems' UUID cannot be changed");
- r = -1;
- }
+ else if (STREQ (vfs_t...
2015 Jun 26
0
[PATCH v3.1 1/9] uuid: add support to change uuid of btrfs partition
...const char *device);
+extern int btrfs_set_uuid (const char *device, const char *uuid);
/*-- in ntfs.c --*/
extern char *ntfs_get_label (const char *device);
diff --git a/daemon/uuids.c b/daemon/uuids.c
index 06b33e9..f98d8e5 100644
--- a/daemon/uuids.c
+++ b/daemon/uuids.c
@@ -110,10 +110,8 @@ do_set_uuid (const char *device, const char *uuid)
else if (STREQ (vfs_type, "swap"))
r = swapuuid (device, uuid);
- else if (STREQ (vfs_type, "btrfs")) {
- reply_with_error ("btrfs filesystems' UUID cannot be changed");
- r = -1;
- }
+ else if (STREQ (vfs_t...
2015 Jun 30
0
[PATCH v4 1/7] uuid: add support to change uuid of btrfs partition
...const char *device);
+extern int btrfs_set_uuid (const char *device, const char *uuid);
/*-- in ntfs.c --*/
extern char *ntfs_get_label (const char *device);
diff --git a/daemon/uuids.c b/daemon/uuids.c
index 06b33e9..f98d8e5 100644
--- a/daemon/uuids.c
+++ b/daemon/uuids.c
@@ -110,10 +110,8 @@ do_set_uuid (const char *device, const char *uuid)
else if (STREQ (vfs_type, "swap"))
r = swapuuid (device, uuid);
- else if (STREQ (vfs_type, "btrfs")) {
- reply_with_error ("btrfs filesystems' UUID cannot be changed");
- r = -1;
- }
+ else if (STREQ (vfs_t...