Displaying 18 results from an estimated 18 matches for "swap_label_max".
2017 Apr 19
0
[PATCH] daemon: Add an assertion to suppress a warning with GCC.
swap.c: In function 'do_mkswap_U':
swap.c:62:9: error: argument 1 null where non-null expected [-Werror=nonnull]
if (strlen (label) > SWAP_LABEL_MAX) {
^~~~~~~~~~~~~~
---
daemon/swap.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/daemon/swap.c b/daemon/swap.c
index 028bc1ee2..fea4a9dcf 100644
--- a/daemon/swap.c
+++ b/daemon/swap.c
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h&...
2016 Nov 25
3
[PATCH 1/2] daemon: allow to change the labels of swap partitions
...ndex 9d7839e..028bc1e 100644
--- a/daemon/swap.c
+++ b/daemon/swap.c
@@ -239,3 +239,24 @@ swap_set_uuid (const char *device, const char *uuid)
return 0;
}
+
+int
+swap_set_label (const char *device, 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", er...
2015 Jun 26
1
Re: [PATCH v3.1 7/9] New API: swap_set_uuid_random
...kswap);
> 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 r;
> + char *out;
> + CLEANUP_FREE char *err = NULL;
> +
> + r = command (&out, &err, str_uu...
2015 Jun 26
0
[PATCH v3.1 7/9] New API: swap_set_uuid_random
...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 r;
+ char *out;
+ CLEANUP_FREE char *err = NULL;
+
+ r = command (&out, &err, str_uuidgen, NULL);
+ if (r == -1) {
+ reply_with_error ("%s&q...
2015 Jun 30
0
[PATCH v4 4/7] uuid: use newly introduced swap_set_uuid
...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 *uuid)
+{
+ int r;
+ CLEANUP_FREE char *err = NULL;
+
+ r = command (NULL, &err, str_swaplabel, "-U", uuid...
2015 Oct 05
0
Re: [PATCH] Remove multiple hacks that only apply to RHEL 5.
...gt; 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
> optgroup_linuxfsuuid_available (void)
> {
> - CLEANUP_FREE char *err = NULL;
&g...
2015 Oct 05
2
[PATCH] Remove multiple hacks that only apply to RHEL 5.
...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
optgroup_linuxfsuuid_available (void)
{
- CLEANUP_FREE char *err = NULL;
- int av;
-
- /* Upstream util-linux have bee...
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 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
2011 Jun 09
15
[PATCH 00/13] Fix errors found using Coverity static analyzer.
I ran the Coverity static analyzer[1] on libguestfs, and fixed many
errors as a result.
Coverity found some errors in gnulib, but it doesn't seem to be worth
following those up since the version of gnulib we are using is so old.
There are a couple more errors (possibly 1 false-positive) which I'm
going to send in a separate email.
BTW all the errors found by Coverity were in the daemon
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 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):
2012 Aug 30
2
[PATCH v2] daemon: collect list of called external commands
...on/swap.c
+++ b/daemon/swap.c
@@ -30,6 +30,10 @@
#include "ignore-value.h"
+GUESTFSD_EXT_CMD(str_mkswap, mkswap);
+GUESTFSD_EXT_CMD(str_swapon, swapon);
+GUESTFSD_EXT_CMD(str_swapoff, swapoff);
+
/* Confirmed this is true for Linux swap partitions from the Linux sources. */
#define SWAP_LABEL_MAX 16
@@ -49,7 +53,7 @@ optgroup_linuxfsuuid_available (void)
* return code.
*/
ignore_value (commandf (NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR,
- "mkswap", "--help", NULL));
+ str_mkswap, "--help",...
2012 Aug 30
1
[PATCH] collect list of called external commands
...aemon/swap.c
+++ b/daemon/swap.c
@@ -30,6 +30,10 @@
#include "ignore-value.h"
+GUESTFS_EXT_CMD(str_mkswap, mkswap);
+GUESTFS_EXT_CMD(str_swapon, swapon);
+GUESTFS_EXT_CMD(str_swapoff, swapoff);
+
/* Confirmed this is true for Linux swap partitions from the Linux sources. */
#define SWAP_LABEL_MAX 16
@@ -49,7 +53,7 @@ optgroup_linuxfsuuid_available (void)
* return code.
*/
ignore_value (commandf (NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR,
- "mkswap", "--help", NULL));
+ str_mkswap, "--help",...
2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
...@@
#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_ARG (argv, i, "mkswap");
ADD_ARG (argv, i, "-f");
if (optargs_bitmask & GUESTFS_MKSWAP_LA...
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
..., swapon);
-GUESTFSD_EXT_CMD(str_swapoff, swapoff);
-GUESTFSD_EXT_CMD(str_swaplabel, swaplabel);
+DECLARE_EXTERNAL_COMMANDS ("mkswap", "swapon", "swapoff", "swaplabel")
/* Confirmed this is true for Linux swap partitions from the Linux sources. */
#define SWAP_LABEL_MAX 16
@@ -55,7 +52,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_ARG (argv, i, "mkswap");
ADD_ARG (argv, i, "-f");
if (optargs_bitmask & GUESTFS_MKSWAP_LABE...
2017 Jul 27
3
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
This is a simpler patch that removes GUESTFSD_EXT_CMD completely.
2017 Jul 24
6
[PATCH 0/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
Replace GUESTFSD_EXT_CMD with a command line option
‘./guestfsd --print-external-commands’