Displaying 20 results from an estimated 26 matches for "do_md_detail".
2011 Dec 05
1
[PATCH] mdadm: fix a possible memory leak when error
...ned without free the *ret*.
Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com>
---
daemon/md.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/daemon/md.c b/daemon/md.c
index 5a4d815..8d28878 100644
--- a/daemon/md.c
+++ b/daemon/md.c
@@ -294,12 +294,12 @@ do_md_detail(const char *md)
}
}
+ if (add_string(&ret, &size, &alloc, NULL) == -1) goto error;
+
free(out);
free(err);
free(lines); /* We freed the contained strings when we freed out */
- if (add_string(&ret, &size, &alloc, NULL) == -1) return NULL;
-
return r...
2012 Jan 24
14
[PATCH 00/14] Run the daemon under valgrind and fix resultant errors.
This patch series lets you run the daemon under valgrind.
Many errors were found and fixed.
With the complete series applied, valgrind doesn't show any errors.
2016 Jul 07
0
[PATCH 2/2] daemon: fix cleanup of stringsbuf usages
...md_devices (void)
if (end_stringsbuf (&ret) == -1) goto error;
globfree (&mds);
- return ret.argv;
+ return take_stringsbuf (&ret);
error:
globfree (&mds);
- if (ret.argv != NULL)
- free_stringslen (ret.argv, ret.size);
return NULL;
}
@@ -290,19 +288,19 @@ do_md_detail (const char *md)
CLEANUP_FREE char *out = NULL, *err = NULL;
CLEANUP_FREE_STRING_LIST char **lines = NULL;
- DECLARE_STRINGSBUF (ret);
+ CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (ret);
const char *mdadm[] = { str_mdadm, "-D", "--export", md, NULL };
r = comma...
2015 Jul 17
1
[PATCH] daemon: add a space after func/macro to fit code-style
...es (void)
n = dev;
n = mempcpy (n, DEV, strlen (DEV));
- n = mempcpy (n, &mds.gl_pathv[i][strlen(PREFIX)], len);
+ n = mempcpy (n, &mds.gl_pathv[i][strlen (PREFIX)], len);
*n = '\0';
if (!is_raid_device (dev)) {
@@ -273,7 +273,7 @@ error:
}
char **
-do_md_detail(const char *md)
+do_md_detail (const char *md)
{
size_t i;
int r;
@@ -345,15 +345,15 @@ error:
}
int
-do_md_stop(const char *md)
+do_md_stop (const char *md)
{
int r;
CLEANUP_FREE char *err = NULL;
const char *mdadm[] = { str_mdadm, "--stop", md, NULL};
- r = comma...
2016 Jul 07
2
[PATCH 1/2] daemon: free the string on stringsbuf add failure
If add_string_nodup fails free the passed string instead of leaking it,
as that string would have been owned by the stringbuf.
Adapt few places to this behaviour.
---
daemon/btrfs.c | 4 +---
daemon/devsparts.c | 8 ++++----
daemon/guestfsd.c | 1 +
3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 9b52aa8..d70565a 100644
---
2017 Jul 14
0
[PATCH 23/27] daemon: Reimplement ‘md_detail’ API in OCaml.
...++++++++++++++
5 files changed, 66 insertions(+), 66 deletions(-)
diff --git a/daemon/md.c b/daemon/md.c
index 5c9ecd136..549dd89fa 100644
--- a/daemon/md.c
+++ b/daemon/md.c
@@ -218,72 +218,6 @@ do_md_create (const char *name, char *const *devices,
#pragma GCC diagnostic pop
#endif
-char **
-do_md_detail (const char *md)
-{
- size_t i;
- int r;
-
- CLEANUP_FREE char *out = NULL, *err = NULL;
- CLEANUP_FREE_STRING_LIST char **lines = NULL;
-
- CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (ret);
-
- const char *mdadm[] = { str_mdadm, "-D", "--export", md, NULL };
- r = comman...
2012 Feb 06
3
[PATCH 1/3] NEW API: add a new api zero_fs
Add the new api zero_fs to erase the filesystem signatures
on a device but now erase any data.
Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com>
---
daemon/zero.c | 17 +++++++++++++++++
generator/generator_actions.ml | 14 ++++++++++++++
src/MAX_PROC_NR | 2 +-
3 files changed, 32 insertions(+), 1 deletions(-)
diff --git a/daemon/zero.c
2011 Nov 24
1
[PATCH] Rename mdadm_ apis to md_
...SK) {
+ if (optargs_bitmask & GUESTFS_MD_CREATE_CHUNK_BITMASK) {
ADD_ARG (argv, i, "--chunk");
snprintf (chunk_s, sizeof chunk_s, "%" PRIi64, chunk / 1024);
ADD_ARG (argv, i, chunk_s);
@@ -233,7 +233,7 @@ error:
}
char **
-do_mdadm_detail(const char *md)
+do_md_detail(const char *md)
{
int r;
@@ -290,7 +290,7 @@ do_mdadm_detail(const char *md)
} else {
/* Ignore lines with no equals sign (shouldn't happen). Log to stderr so
* it will show up in LIBGUESTFS_DEBUG. */
- fprintf(stderr, "mdadm-detail: unexpected output ignored...
2012 Mar 13
2
[PATCH 0/2] 'int' to 'size_t' changes
These two patches are probably not completely independent, but
separating them is a lot of work.
With *both* patches applied, all the tests and extra-tests pass.
That's no guarantee however that there isn't a mistake, so I don't
think this patch is a candidate for the 1.16 branch, until it's had a
lot more testing in development.
Rich.
2012 Feb 01
1
[PATCH] Clarify the error message when unavailable functions are called (RHBZ#679737).
...ESTFS_MD_CREATE_MISSINGBITMAP_BITMASK))
umissingbitmap = 0;
@@ -184,6 +186,8 @@ do_list_md_devices (void)
int size = 0, alloc = 0;
glob_t mds;
+ IF_NOT_AVAILABLE_ERROR (mdadm, NULL);
+
memset(&mds, 0, sizeof(mds));
#define PREFIX "/sys/block/md"
@@ -244,6 +248,8 @@ do_md_detail(const char *md)
char **ret = NULL;
int size = 0, alloc = 0;
+ IF_NOT_AVAILABLE_ERROR (mdadm, NULL);
+
const char *mdadm[] = { "mdadm", "-D", "--export", md, NULL };
r = commandv (&out, &err, mdadm);
if (r == -1) {
@@ -320,6 +326,8 @@ do_md_sto...
2012 Aug 30
2
[PATCH v2] daemon: collect list of called external commands
...const char *argv[MAX_ARGS];
size_t i = 0;
- ADD_ARG (argv, i, "mdadm");
+ ADD_ARG (argv, i, str_mdadm);
ADD_ARG (argv, i, "--create");
/* --run suppresses "Continue creating array" question */
ADD_ARG (argv, i, "--run");
@@ -244,7 +246,7 @@ do_md_detail(const char *md)
DECLARE_STRINGSBUF (ret);
- const char *mdadm[] = { "mdadm", "-D", "--export", md, NULL };
+ const char *mdadm[] = { str_mdadm, "-D", "--export", md, NULL };
r = commandv (&out, &err, mdadm);
if (r == -1) {...
2012 Aug 30
1
[PATCH] collect list of called external commands
...const char *argv[MAX_ARGS];
size_t i = 0;
- ADD_ARG (argv, i, "mdadm");
+ ADD_ARG (argv, i, str_mdadm);
ADD_ARG (argv, i, "--create");
/* --run suppresses "Continue creating array" question */
ADD_ARG (argv, i, "--run");
@@ -244,7 +246,7 @@ do_md_detail(const char *md)
DECLARE_STRINGSBUF (ret);
- const char *mdadm[] = { "mdadm", "-D", "--export", md, NULL };
+ const char *mdadm[] = { str_mdadm, "-D", "--export", md, NULL };
r = commandv (&out, &err, mdadm);
if (r == -1) {...
2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
...const char *argv[MAX_ARGS];
size_t i = 0;
- ADD_ARG (argv, i, str_mdadm);
+ ADD_ARG (argv, i, "mdadm");
ADD_ARG (argv, i, "--create");
/* --run suppresses "Continue creating array" question */
ADD_ARG (argv, i, "--run");
@@ -292,7 +290,7 @@ do_md_detail (const char *md)
CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (ret);
- const char *mdadm[] = { str_mdadm, "-D", "--export", md, NULL };
+ const char *mdadm[] = { "mdadm", "-D", "--export", md, NULL };
r = commandv (&out, &err, mdad...
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
...const char *argv[MAX_ARGS];
size_t i = 0;
- ADD_ARG (argv, i, str_mdadm);
+ ADD_ARG (argv, i, "mdadm");
ADD_ARG (argv, i, "--create");
/* --run suppresses "Continue creating array" question */
ADD_ARG (argv, i, "--run");
@@ -292,7 +292,7 @@ do_md_detail (const char *md)
CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (ret);
- const char *mdadm[] = { str_mdadm, "-D", "--export", md, NULL };
+ const char *mdadm[] = { "mdadm", "-D", "--export", md, NULL };
r = commandv (&out, &err, mdad...
2015 Oct 05
0
[PATCH 2/2] Fix whitespace.
...--git a/daemon/md.c b/daemon/md.c
index 06b5142..cf826c5 100644
--- a/daemon/md.c
+++ b/daemon/md.c
@@ -264,7 +264,7 @@ do_list_md_devices (void)
return ret.argv;
-error:
+ error:
globfree (&mds);
if (ret.argv != NULL)
free_stringslen (ret.argv, ret.size);
@@ -337,7 +337,7 @@ do_md_detail (const char *md)
return ret.argv;
-error:
+ error:
if (ret.argv != NULL)
free_stringslen (ret.argv, ret.size);
diff --git a/daemon/mknod.c b/daemon/mknod.c
index 9af8701..d2ae02d 100644
--- a/daemon/mknod.c
+++ b/daemon/mknod.c
@@ -38,13 +38,13 @@ optgroup_mknod_available (void)...
2017 Jul 27
23
[PATCH v3 00/23] Reimplement many daemon APIs in OCaml.
I think this fixes everything mentioned:
- Added the Optgroups module as suggested.
- Remove command temporary files.
- Replace command ~flags with ?fold_stdout_on_stderr.
- Nest _with_mounted function.
- Rebase & retest.
Rich.
2017 Jul 21
27
[PATCH v2 00/23] Reimplement many daemon APIs in OCaml.
v1 was posted here:
https://www.redhat.com/archives/libguestfs/2017-July/msg00098.html
This series now depends on two small patches which I posted separately:
https://www.redhat.com/archives/libguestfs/2017-July/msg00207.html
https://www.redhat.com/archives/libguestfs/2017-July/msg00209.html
v1 -> v2:
- Previously changes to generator/daemon.ml were made incrementally
through the patch
2017 Jul 14
45
[PATCH 00/27] Reimplement many daemon APIs in OCaml.
Previously posted as part of the mega utilities/inspection
series here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00232.html
What I've done is to extract just the parts related to rewriting
daemon APIs in OCaml, rebase them on top of the current master, fix a
few things, and recompile and test everything.
Rich.
2015 Oct 05
3
[PATCH 1/2] Change 'fprintf (stdout,...)' -> printf.
Result of earlier copy and paste.
---
align/scan.c | 35 ++++++++++---------
cat/cat.c | 39 +++++++++++----------
cat/filesystems.c | 69 +++++++++++++++++++-------------------
cat/log.c | 35 ++++++++++---------
cat/ls.c | 61 +++++++++++++++++----------------
df/main.c | 43 ++++++++++++------------
diff/diff.c | 67
2017 Jul 27
3
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
This is a simpler patch that removes GUESTFSD_EXT_CMD completely.