Chen Hanxiao
2015-Jul-06 05:34 UTC
[Libguestfs] [PATCH] uuids: return ENOTSUP if could not set UUID for specific fs
Signed-off-by: Chen 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 set the UUID for '%s' filesystems", vfs_type); - r = -1; - } return r; } diff --git a/generator/actions.ml b/generator/actions.ml index 92f80d2..7ecaf98 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -11804,6 +11804,9 @@ parameter. In future we may allow other flags to be adjusted." }; shortdesc = "set the filesystem UUID"; longdesc = "\ Set the filesystem UUID on C<device> to C<uuid>. +If this fails and the errno is ENOTSUP, +means that there is no support for changing the UUID +for the type of the specified filesystem. Only some filesystem types support setting UUIDs. -- 2.1.0
Pino Toscano
2015-Jul-07 08:17 UTC
Re: [Libguestfs] [PATCH] uuids: return ENOTSUP if could not set UUID for specific fs
On Monday 06 July 2015 13:34:06 Chen Hanxiao wrote:> Signed-off-by: Chen 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 set the UUID for '%s' filesystems", > vfs_type); > - r = -1; > - } > > return r; > } > diff --git a/generator/actions.ml b/generator/actions.ml > index 92f80d2..7ecaf98 100644 > --- a/generator/actions.ml > +++ b/generator/actions.ml > @@ -11804,6 +11804,9 @@ parameter. In future we may allow other flags to be adjusted." }; > shortdesc = "set the filesystem UUID"; > longdesc = "\ > Set the filesystem UUID on C<device> to C<uuid>. > +If this fails and the errno is ENOTSUP, > +means that there is no support for changing the UUID > +for the type of the specified filesystem. > > Only some filesystem types support setting UUIDs.LGTM, pushed. Thanks, -- Pino Toscano
Seemingly Similar Threads
- [PATCH v5 0/3] uuid: add btrfs uuid change support and set_uuid_random
- [PATCH v6] New API: set_uuid_random
- [PATCH v4 0/7] uuid: add btrfs uuid change support and set_uuid_random
- Re: [PATCH v2 1/5] uuid: add support to change uuid of btrfs partition
- [PATCH v3 0/4] uuid: add btrfs uuid change support and some rework