search for: str_swaplabel

Displaying 20 results from an estimated 23 matches for "str_swaplabel".

2015 Jun 30
0
[PATCH v4 4/7] uuid: use newly introduced swap_set_uuid
...y by the client-side RPC stubs. diff --git a/daemon/swap.c b/daemon/swap.c index 83f4d7c..26fe30d 100644 --- a/daemon/swap.c +++ b/daemon/swap.c @@ -33,6 +33,7 @@ GUESTFSD_EXT_CMD(str_mkswap, mkswap); GUESTFSD_EXT_CMD(str_swapon, swapon); GUESTFSD_EXT_CMD(str_swapoff, swapoff); +GUESTFSD_EXT_CMD(str_swaplabel, swaplabel); /* Confirmed this is true for Linux swap partitions from the Linux sources. */ #define SWAP_LABEL_MAX 16 @@ -239,3 +240,18 @@ do_swapoff_uuid (const char *uuid) { return swaponoff (str_swapoff, "-U", uuid); } + +int +swap_set_uuid (const char *device, const char *uui...
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 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 Jun 24
0
[PATCH 4/5] uuid: use existed do_mkswap_U
...e 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,...
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
2014 Nov 28
3
[PATCH 1/3] uuid: add support to change uuid of swap partition
...2 -- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/daemon/uuids.c b/daemon/uuids.c index 672f3db..431d867 100644 --- a/daemon/uuids.c +++ b/daemon/uuids.c @@ -29,6 +29,7 @@ GUESTFSD_EXT_CMD(str_tune2fs, tune2fs); GUESTFSD_EXT_CMD(str_xfs_admin, xfs_admin); +GUESTFSD_EXT_CMD(str_swaplabel, swaplabel); static int e2uuid (const char *device, const char *uuid) @@ -75,6 +76,21 @@ xfsuuid (const char *device, const char *uuid) return 0; } +static int +swapuuid (const char *device, const char *uuid) +{ + int r; + CLEANUP_FREE char *err = NULL; + + r = command (NULL, &err,...
2015 Jun 23
2
[PATCH] uuid: add support to change uuid of btrfs partition
...4 ++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/daemon/uuids.c b/daemon/uuids.c index 06b33e9..c18cb55 100644 --- a/daemon/uuids.c +++ b/daemon/uuids.c @@ -30,6 +30,7 @@ GUESTFSD_EXT_CMD(str_tune2fs, tune2fs); GUESTFSD_EXT_CMD(str_xfs_admin, xfs_admin); GUESTFSD_EXT_CMD(str_swaplabel, swaplabel); +GUESTFSD_EXT_CMD(str_btrfstune, btrfstune); static int e2uuid (const char *device, const char *uuid) @@ -91,6 +92,21 @@ swapuuid (const char *device, const char *uuid) return 0; } +static int +btrfsuuid (const char *device, const char *uuid) +{ + int r; + CLEANUP_FREE char...
2015 Jun 26
1
Re: [PATCH v3.1 7/9] New API: swap_set_uuid_random
...ff --git a/daemon/swap.c b/daemon/swap.c > index 26fe30d..923adb2 100644 > --- a/daemon/swap.c > +++ b/daemon/swap.c > @@ -34,6 +34,7 @@ GUESTFSD_EXT_CMD(str_mkswap, mkswap); > GUESTFSD_EXT_CMD(str_swapon, swapon); > GUESTFSD_EXT_CMD(str_swapoff, swapoff); > GUESTFSD_EXT_CMD(str_swaplabel, swaplabel); > +GUESTFSD_EXT_CMD(str_uuidgen, uuidgen); > > /* Confirmed this is true for Linux swap partitions from the Linux sources. */ > #define SWAP_LABEL_MAX 16 > @@ -255,3 +256,34 @@ swap_set_uuid (const char *device, const char *uuid) > > return 0; > } >...
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 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 24
0
[PATCH 2/5] uuid: use existed function of ext2
...t a/daemon/uuids.c b/daemon/uuids.c index f7791ab..8626884 100644 --- a/daemon/uuids.c +++ b/daemon/uuids.c @@ -27,16 +27,12 @@ #include "actions.h" #include "optgroups.h" -GUESTFSD_EXT_CMD(str_tune2fs, tune2fs); GUESTFSD_EXT_CMD(str_xfs_admin, xfs_admin); GUESTFSD_EXT_CMD(str_swaplabel, swaplabel); static int e2uuid (const char *device, const char *uuid) { - int r; - CLEANUP_FREE char *err = NULL; - /* Don't allow the magic values here. If callers want to do this * we'll add alternate set_uuid_* calls. */ @@ -46,13 +42,7 @@ e2uuid (const char *device, c...
2015 Jun 24
0
[PATCH 3/5] uuid: use newly introduced do_xfs_admin_uuid of xfs
...t argc, char *const *const argv); diff --git a/daemon/uuids.c b/daemon/uuids.c index 8626884..0520113 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, &qu...
2015 Jun 26
0
[PATCH v3.1 7/9] New API: swap_set_uuid_random
...string with the current command, diff --git a/daemon/swap.c b/daemon/swap.c index 26fe30d..923adb2 100644 --- a/daemon/swap.c +++ b/daemon/swap.c @@ -34,6 +34,7 @@ GUESTFSD_EXT_CMD(str_mkswap, mkswap); GUESTFSD_EXT_CMD(str_swapon, swapon); GUESTFSD_EXT_CMD(str_swapoff, swapoff); GUESTFSD_EXT_CMD(str_swaplabel, swaplabel); +GUESTFSD_EXT_CMD(str_uuidgen, uuidgen); /* Confirmed this is true for Linux swap partitions from the Linux sources. */ #define SWAP_LABEL_MAX 16 @@ -255,3 +256,34 @@ swap_set_uuid (const char *device, const char *uuid) return 0; } + +char * +get_random_uuid (void) +{ + int...
2015 Jun 30
0
[PATCH v4 3/7] uuid: use newly introduced xfs_set_uuid of xfs
...t argc, char *const *const argv); diff --git a/daemon/uuids.c b/daemon/uuids.c index b8b820a..dce0d60 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, &qu...
2015 Jun 30
0
[PATCH v4 2/7] uuid: use existing function of ext2
...t a/daemon/uuids.c b/daemon/uuids.c index f98d8e5..b8b820a 100644 --- a/daemon/uuids.c +++ b/daemon/uuids.c @@ -27,16 +27,12 @@ #include "actions.h" #include "optgroups.h" -GUESTFSD_EXT_CMD(str_tune2fs, tune2fs); GUESTFSD_EXT_CMD(str_xfs_admin, xfs_admin); GUESTFSD_EXT_CMD(str_swaplabel, swaplabel); static int e2uuid (const char *device, const char *uuid) { - int r; - CLEANUP_FREE char *err = NULL; - /* Don't allow the magic values here. If callers want to do this * we'll add alternate set_uuid_* calls. */ @@ -46,13 +42,7 @@ e2uuid (const char *device, c...
2015 Oct 05
0
Re: [PATCH] Remove multiple hacks that only apply to RHEL 5.
...th RHEL 5). Therefore remove a bunch of hacks > that were only needed on RHEL 5. > --- Mostly LGTM, just two notes: > diff --git a/daemon/swap.c b/daemon/swap.c > index 26fe30d..9d7839e 100644 > --- a/daemon/swap.c > +++ b/daemon/swap.c > @@ -38,26 +38,10 @@ GUESTFSD_EXT_CMD(str_swaplabel, swaplabel); > /* Confirmed this is true for Linux swap partitions from the Linux sources. */ > #define SWAP_LABEL_MAX 16 > > -/* Convenient place to test for the later version of e2fsprogs > - * and util-linux which supports -U parameters to specify UUIDs. > - * (Not supporte...
2015 Jun 23
0
Re: [PATCH] uuid: add support to change uuid of btrfs partition
...2 deletions(-) > > diff --git a/daemon/uuids.c b/daemon/uuids.c > index 06b33e9..c18cb55 100644 > --- a/daemon/uuids.c > +++ b/daemon/uuids.c > @@ -30,6 +30,7 @@ > GUESTFSD_EXT_CMD(str_tune2fs, tune2fs); > GUESTFSD_EXT_CMD(str_xfs_admin, xfs_admin); > GUESTFSD_EXT_CMD(str_swaplabel, swaplabel); > +GUESTFSD_EXT_CMD(str_btrfstune, btrfstune); > > static int > e2uuid (const char *device, const char *uuid) > @@ -91,6 +92,21 @@ swapuuid (const char *device, const char *uuid) > return 0; > } > > +static int > +btrfsuuid (const char *device, c...
2015 Oct 05
2
[PATCH] Remove multiple hacks that only apply to RHEL 5.
...print_partition_table (device, PARTED_OPT_NO_M); + CLEANUP_FREE char *out = print_partition_table (device, false); if (!out) return NULL; diff --git a/daemon/swap.c b/daemon/swap.c index 26fe30d..9d7839e 100644 --- a/daemon/swap.c +++ b/daemon/swap.c @@ -38,26 +38,10 @@ GUESTFSD_EXT_CMD(str_swaplabel, swaplabel); /* Confirmed this is true for Linux swap partitions from the Linux sources. */ #define SWAP_LABEL_MAX 16 -/* Convenient place to test for the later version of e2fsprogs - * and util-linux which supports -U parameters to specify UUIDs. - * (Not supported in RHEL 5). - */ int optgr...
2016 Nov 25
3
[PATCH 1/2] daemon: allow to change the labels of swap partitions
...e, const char *label) +{ + int r; + CLEANUP_FREE char *err = NULL; + + if (strlen (label) > SWAP_LABEL_MAX) { + reply_with_error ("%s: Linux swap labels are limited to %d bytes", + label, SWAP_LABEL_MAX); + return -1; + } + + r = command (NULL, &err, str_swaplabel, "-L", label, device, NULL); + if (r == -1) { + reply_with_error ("%s", err); + return -1; + } + + return 0; +} diff --git a/generator/actions.ml b/generator/actions.ml index 43de38b..5e0356f 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -10304,6 +1030...
2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
...aemon/swap.c b/daemon/swap.c index fea4a9dcf..a00937292 100644 --- a/daemon/swap.c +++ b/daemon/swap.c @@ -31,11 +31,6 @@ #include "ignore-value.h" -GUESTFSD_EXT_CMD(str_mkswap, mkswap); -GUESTFSD_EXT_CMD(str_swapon, swapon); -GUESTFSD_EXT_CMD(str_swapoff, swapoff); -GUESTFSD_EXT_CMD(str_swaplabel, swaplabel); - /* Confirmed this is true for Linux swap partitions from the Linux sources. */ #define SWAP_LABEL_MAX 16 @@ -55,7 +50,7 @@ do_mkswap (const char *device, const char *label, const char *uuid) int r; CLEANUP_FREE char *err = NULL; - ADD_ARG (argv, i, str_mkswap); + ADD_AR...