search for: do_list_disk_labels

Displaying 5 results from an estimated 5 matches for "do_list_disk_labels".

2016 Jul 07
2
[PATCH 1/2] daemon: free the string on stringsbuf add failure
...ret, ss) == -1) return NULL; - } } else { if (add_string (&ret, "") == -1) return NULL; diff --git a/daemon/devsparts.c b/daemon/devsparts.c index 7c690f8..41c728c 100644 --- a/daemon/devsparts.c +++ b/daemon/devsparts.c @@ -311,7 +311,6 @@ do_list_disk_labels (void) { DIR *dir = NULL; struct dirent *d; - char *rawdev = NULL; DECLARE_STRINGSBUF (ret); dir = opendir (GUESTFSDIR); @@ -330,6 +329,7 @@ do_list_disk_labels (void) errno = 0; while ((d = readdir (dir)) != NULL) { CLEANUP_FREE char *path = NULL; + char *rawdev;...
2016 Mar 02
1
[PATCH] daemon: do not fail list-disk-labels w/o labels set
...irectory was there, but empty. --- daemon/devsparts.c | 7 +++++++ generator/actions.ml | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/daemon/devsparts.c b/daemon/devsparts.c index 7b92bf6..7c690f8 100644 --- a/daemon/devsparts.c +++ b/daemon/devsparts.c @@ -316,6 +316,13 @@ do_list_disk_labels (void) dir = opendir (GUESTFSDIR); if (!dir) { + if (errno == ENOENT) { + /* The directory does not exist, and usually this happens when + * there are no labels set. In this case, act as if the directory + * was empty. + */ + return empty_list (); + }...
2016 Jul 07
0
[PATCH 2/2] daemon: fix cleanup of stringsbuf usages
...82,7 +175,6 @@ add_partitions (const char *device, struct stringsbuf *r) /* Close the directory handle */ if (closedir (dir) == -1) { reply_with_perror ("closedir: /sys/block/%s", device); - free_stringslen (r->argv, r->size); return -1; } @@ -311,7 +303,7 @@ do_list_disk_labels (void) { DIR *dir = NULL; struct dirent *d; - DECLARE_STRINGSBUF (ret); + CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (ret); dir = opendir (GUESTFSDIR); if (!dir) { @@ -336,14 +328,12 @@ do_list_disk_labels (void) if (asprintf (&path, "%s/%s", GUESTFSDIR, d->...
2012 Oct 08
3
[PATCH v3 0/3] Add support for disk labels and hotplugging.
This is, I guess, version 3 of this patch series which adds disk labels and hotplugging (only hot-add implemented so far). The good news is .. it works! Rich.
2012 Oct 08
5
[PATCH v4 0/5] Finish hotplugging support.
This rounds off hotplugging support by allowing you to add and remove drives at any stage (before and after launch). Rich.