Displaying 20 results from an estimated 82 matches for "commandr".
Did you mean:
command
2015 Jul 13
1
[PATCH] daemon: add a space after func name to fit code-style
...d (const char *device, const char *uuid)
int has_uuid_opts = test_btrfstune_uuid_opt ();
if (has_uuid_opts <= 0)
- NOT_SUPPORTED(-1, "btrfs filesystems' UUID cannot be changed");
+ NOT_SUPPORTED (-1, "btrfs filesystems' UUID cannot be changed");
r = commandr (NULL, &err, str_btrfstune, "-f", "-U", uuid, device, NULL);
@@ -893,10 +893,10 @@ btrfs_set_uuid_random (const char *device)
{
CLEANUP_FREE char *err = NULL;
int r;
- int has_uuid_opts = test_btrfstune_uuid_opt();
+ int has_uuid_opts = test_btrfstune_uuid_opt ();...
2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
...include "actions.h"
#include "optgroups.h"
-GUESTFSD_EXT_CMD(str_grep, grep);
-GUESTFSD_EXT_CMD(str_modprobe, modprobe);
-
int
do_internal_feature_available (const char *group)
{
@@ -79,7 +76,7 @@ test_proc_filesystems (const char *filesystem)
return -1;
}
- r = commandr (NULL, &err, str_grep, regex, "/proc/filesystems", NULL);
+ r = commandr (NULL, &err, "grep", regex, "/proc/filesystems", NULL);
if (r == -1 || r >= 2) {
fprintf (stderr, "grep /proc/filesystems: %s", err);
return -1;
@@ -92,7 +89,7 @...
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
...-GUESTFSD_EXT_CMD(str_grep, grep);
-GUESTFSD_EXT_CMD(str_modprobe, modprobe);
+DECLARE_EXTERNAL_COMMANDS ("grep", "modprobe")
int
do_internal_feature_available (const char *group)
@@ -79,7 +78,7 @@ test_proc_filesystems (const char *filesystem)
return -1;
}
- r = commandr (NULL, &err, str_grep, regex, "/proc/filesystems", NULL);
+ r = commandr (NULL, &err, "grep", regex, "/proc/filesystems", NULL);
if (r == -1 || r >= 2) {
fprintf (stderr, "grep /proc/filesystems: %s", err);
return -1;
@@ -92,7 +91,7 @...
2012 Aug 30
2
[PATCH v2] daemon: collect list of called external commands
...estfs-intro.html
@@ -119,6 +119,7 @@ char *
return get_blkid_tag (device, "TYPE");
}
+GUESTFSD_EXT_CMD(str_blkid, blkid);
static char *
get_blkid_tag (const char *device, const char *tag)
{
@@ -126,7 +127,7 @@ get_blkid_tag (const char *device, const char *tag)
int r;
r = commandr (&out, &err,
- "blkid",
+ str_blkid,
"-c", "/dev/null",
"-o", "value", "-s", tag, device, NULL);
if (r != 0 && r != 2) {
diff --git a/daemon...
2012 Aug 30
1
[PATCH] collect list of called external commands
...uestfs-intro.html
@@ -119,6 +119,7 @@ char *
return get_blkid_tag (device, "TYPE");
}
+GUESTFS_EXT_CMD(str_blkid, blkid);
static char *
get_blkid_tag (const char *device, const char *tag)
{
@@ -126,7 +127,7 @@ get_blkid_tag (const char *device, const char *tag)
int r;
r = commandr (&out, &err,
- "blkid",
+ str_blkid,
"-c", "/dev/null",
"-o", "value", "-s", tag, device, NULL);
if (r != 0 && r != 2) {
diff --git a/daemon...
2011 Dec 05
1
[PATCH] blkid: split the RHEL5 which can't support some options
...(const char *device)
+/* RHEL5 blkid doesn't have the -p(partition info) option and the
+ * -i(I/O limits) option so we must test for these options the first
+ * time the function is called.
+ */
+static int
+test_blkid_p_opt(void)
+{
+ static int result = -1;
+ char *err = NULL;
+
+ int r = commandr (NULL, &err, "blkid", "-p", "/dev/null", NULL);
+ if (r == -1) {
+ reply_with_error("Could not run 'blkid' command");
+ free(err);
+ return -1;
+ }
+
+ if (err && strstr(err, "invalid option --"))
+ result = 0;
+...
2015 Mar 16
2
[PATCH] btrfs-qgroup-show: add check for "--raw"
...n by checking the output of
+ * 'btrfs qgroup show' support --help' command.
+ */
+static int
+test_btrfs_qgroup_show_raw_opt (void)
+{
+ static int result = -1;
+ if (result > 0)
+ return result;
+
+ CLEANUP_FREE char *err = NULL;
+ CLEANUP_FREE char *out = NULL;
+
+ int r = commandr (&out, &err, str_btrfs, "qgroup", "show", "--help", NULL);
+
+ if (r == -1) {
+ reply_with_error ("btrfs qgroup show --help: %s", err);
+ return -1;
+ }
+
+ if (!strstr (out, "--raw"))
+ result = 0;
+
+ return result;
+}
+
gu...
2015 Jun 24
2
Re: [PATCH v2 1/5] uuid: add support to change uuid of btrfs partition
...' option by checking the output of
> + * 'btrfstune' command.
> + */
> +static int
> +test_btrftune_uuid_opt (void)
> +{
> + static int result = -1;
> + if (result != -1)
> + return result;
> +
> + CLEANUP_FREE char *err = NULL;
> +
> + int r = commandr (NULL, &err, str_btrfstune, NULL);
> +
> + if (r == -1) {
> + reply_with_error ("btrfstune: %s", err);
> + return -1;
> + }
> +
> + /* FIXME currently btrfstune do not support '--help'.
> + * If got an invalid options, it will print its usage...
2015 Jun 26
3
Re: [PATCH v3.1 1/9] uuid: add support to change uuid of btrfs partition
...#39; option by checking the output of
> + * 'btrfstune' command.
> + */
> +static int
> +test_btrfstune_uuid_opt (void)
> +{
> + static int result = -1;
> + if (result != -1)
> + return result;
> +
> + CLEANUP_FREE char *err = NULL;
> +
> + int r = commandr (NULL, &err, str_btrfstune, NULL);
> +
> + if (r == -1) {
> + reply_with_error ("btrfstune: %s", err);
> + return -1;
> + }
> +
> + /* FIXME currently btrfstune do not support '--help'.
So --help should be passed anyway to the btrfstune invocatio...
2017 Jul 14
0
[PATCH 06/27] daemon: Add unit tests of the ‘Utils’ module.
...if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *)
+
+open Unix
+open Printf
+
+open Utils
+
+(* Test prog_exists. *)
+let () =
+ assert (prog_exists "ls");
+ assert (prog_exists "true")
+
+(* Test command, commandr. *)
+let () =
+ ignore (command "true" []);
+
+ let r, _, _ = commandr "false" [] in
+ assert (r = 1)
+
+(* Test split_device_partition. *)
+let () =
+ assert (split_device_partition "/dev/sda1" = ("sda", 1));
+ assert (split_device_partition "/dev/...
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 v2 1/5] uuid: add support to change uuid of btrfs partition
...#39;btrfstune' support
+ * '-u' and '-U UUID' option by checking the output of
+ * 'btrfstune' command.
+ */
+static int
+test_btrftune_uuid_opt (void)
+{
+ static int result = -1;
+ if (result != -1)
+ return result;
+
+ CLEANUP_FREE char *err = NULL;
+
+ int r = commandr (NULL, &err, str_btrfstune, NULL);
+
+ if (r == -1) {
+ reply_with_error ("btrfstune: %s", err);
+ return -1;
+ }
+
+ /* FIXME currently btrfstune do not support '--help'.
+ * If got an invalid options, it will print its usage
+ * in stderr.
+ * We had to check...
2012 May 15
1
[PATCH] NEW API: add new api btrfs-fsck
...ff --git a/daemon/btrfs.c b/daemon/btrfs.c
index ab3babc..62f07f3 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -619,3 +619,20 @@ do_btrfs_set_seeding (const char *device, int svalue)
free (err);
return r;
}
+
+int
+do_btrfs_fsck (const char *device)
+{
+ char *err;
+ int r;
+
+ r = commandr (NULL, &err, "btrfsck", device, NULL);
+ if (r == -1) {
+ reply_with_error ("%s: %s", device, err);
+ free (err);
+ return -1;
+ }
+
+ free (err);
+ return r;
+}
diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml
index fc2df42..33ffd6b...
2015 Jun 26
0
[PATCH v3 1/4] uuid: add support to change uuid of btrfs partition
...#39;btrfstune' support
+ * '-u' and '-U UUID' option by checking the output of
+ * 'btrfstune' command.
+ */
+static int
+test_btrftune_uuid_opt (void)
+{
+ static int result = -1;
+ if (result != -1)
+ return result;
+
+ CLEANUP_FREE char *err = NULL;
+
+ int r = commandr (NULL, &err, str_btrfstune, NULL);
+
+ if (r == -1) {
+ reply_with_error ("btrfstune: %s", err);
+ return -1;
+ }
+
+ /* FIXME currently btrfstune do not support '--help'.
+ * If got an invalid options, it will print its usage
+ * in stderr.
+ * We had to check...
2015 Jun 26
0
[PATCH v3.1 1/9] uuid: add support to change uuid of btrfs partition
...39;btrfstune' support
+ * '-u' and '-U UUID' option by checking the output of
+ * 'btrfstune' command.
+ */
+static int
+test_btrfstune_uuid_opt (void)
+{
+ static int result = -1;
+ if (result != -1)
+ return result;
+
+ CLEANUP_FREE char *err = NULL;
+
+ int r = commandr (NULL, &err, str_btrfstune, NULL);
+
+ if (r == -1) {
+ reply_with_error ("btrfstune: %s", err);
+ return -1;
+ }
+
+ /* FIXME currently btrfstune do not support '--help'.
+ * If got an invalid options, it will print its usage
+ * in stderr.
+ * We had to check...
2015 Jun 30
0
[PATCH v4 1/7] uuid: add support to change uuid of btrfs partition
...39;btrfstune' support
+ * '-u' and '-U UUID' option by checking the output of
+ * 'btrfstune' command.
+ */
+static int
+test_btrfstune_uuid_opt (void)
+{
+ static int result = -1;
+ if (result != -1)
+ return result;
+
+ CLEANUP_FREE char *err = NULL;
+
+ int r = commandr (NULL, &err, str_btrfstune, "--help", NULL);
+
+ if (r == -1) {
+ reply_with_error ("btrfstune: %s", err);
+ return -1;
+ }
+
+ /* FIXME currently btrfstune do not support '--help'.
+ * If got an invalid options, it will print its usage
+ * in stderr.
+...
2017 Jul 27
3
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
This is a simpler patch that removes GUESTFSD_EXT_CMD completely.
2015 Jun 25
0
Re: [PATCH v2 1/5] uuid: add support to change uuid of btrfs partition
...rfstune' command.
> > + */
> > +static int
> > +test_btrftune_uuid_opt (void)
> > +{
> > + static int result = -1;
> > + if (result != -1)
> > + return result;
> > +
> > + CLEANUP_FREE char *err = NULL;
> > +
> > + int r = commandr (NULL, &err, str_btrfstune, NULL);
> > +
> > + if (r == -1) {
> > + reply_with_error ("btrfstune: %s", err);
> > + return -1;
> > + }
> > +
> > + /* FIXME currently btrfstune do not support '--help'.
> > + * If got an...
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’
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