search for: devdir

Displaying 20 results from an estimated 25 matches for "devdir".

Did you mean: depdir
2017 Apr 19
1
[PATCH] daemon: Remove use of fixed-size stack buffers.
.../%s", device) == -1) { + reply_with_perror ("asprintf"); return -1; } + if (add_string (r, dev_path) == -1) + return -1; + return 0; } @@ -153,10 +156,13 @@ do_list_devices (void) static int add_partitions (const char *device, struct stringsbuf *r) { - char devdir[256]; + CLEANUP_FREE char *devdir; /* Open the device's directory under /sys/block */ - snprintf (devdir, sizeof devdir, "/sys/block/%s", device); + if (asprintf (&devdir, "/sys/block/%s", device) == -1) { + reply_with_perror ("asprintf"); + retur...
2017 Apr 19
2
[PATCH v2] daemon: Remove use of fixed-size stack buffers.
v1 -> v2: - Fixes as suggested by Pino. Rich.
2017 Apr 19
0
[PATCH v2] daemon: Remove use of fixed-size stack buffers.
...ot;, device) == -1) { + reply_with_perror ("asprintf"); return -1; } + if (add_string_nodup (r, dev_path) == -1) + return -1; + return 0; } @@ -153,10 +156,13 @@ do_list_devices (void) static int add_partitions (const char *device, struct stringsbuf *r) { - char devdir[256]; + CLEANUP_FREE char *devdir = NULL; /* Open the device's directory under /sys/block */ - snprintf (devdir, sizeof devdir, "/sys/block/%s", device); + if (asprintf (&devdir, "/sys/block/%s", device) == -1) { + reply_with_perror ("asprintf"); +...
2009 Aug 03
1
[PATCH] Recognise cd-rom devices in devsparts.c
...oc = 0; - DIR *dir, *dir2; - struct dirent *d; - char buf[256], devname[256]; - dir = opendir ("/sys/block"); - if (!dir) { - reply_with_perror ("opendir: /sys/block"); - return NULL; - } + int find_partitions(const char *device) { + struct dirent *d; + char devdir[256]; - while ((d = readdir (dir)) != NULL) { - if (strncmp (d->d_name, "sd", 2) == 0 || - strncmp (d->d_name, "hd", 2) == 0 || - strncmp (d->d_name, "vd", 2) == 0) { - snprintf (buf, sizeof buf, "/dev/%s", d->d_name); + /* Open the...
2017 Jul 14
0
[PATCH 05/27] daemon: Reimplement several devsparts APIs in OCaml.
...devices are special devices - unlike the devices exposed - * by QEMU, and there is a special API for them, - * guestfs_list_md_devices. - */ - return foreach_block_device (add_device, false); -} - -static int -add_partitions (const char *device, struct stringsbuf *r) -{ - CLEANUP_FREE char *devdir = NULL; - - /* Open the device's directory under /sys/block */ - if (asprintf (&devdir, "/sys/block/%s", device) == -1) { - reply_with_perror ("asprintf"); - return -1; - } - - DIR *dir = opendir (devdir); - if (!dir) { - reply_with_perror ("opendir: %...
2016 Jul 07
0
[PATCH 2/2] daemon: fix cleanup of stringsbuf usages
...gt; 0) @@ -116,7 +111,7 @@ foreach_block_device (block_dev_func_t func) return NULL; } - return r.argv; + return take_stringsbuf (&r); } /* Add a device to the list of devices */ @@ -150,7 +145,6 @@ add_partitions (const char *device, struct stringsbuf *r) DIR *dir = opendir (devdir); if (!dir) { reply_with_perror ("opendir: %s", devdir); - free_stringslen (r->argv, r->size); return -1; } @@ -174,7 +168,6 @@ add_partitions (const char *device, struct stringsbuf *r) /* Check if readdir failed */ if (0 != errno) { reply_with_perror...
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 ---
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.
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
2016 Feb 23
4
[PATCH v3 0/4] [FOR COMMENTS ONLY] Rework inspection.
Previously posted: https://www.redhat.com/archives/libguestfs/2015-December/msg00038.html Inspection now really succeeds on a small number of simple guests. To test it out: $ ./run guestfish -v -x -a /tmp/centos-6.img ><fs> run ><fs> debug sh "guestfs-inspection --verbose" Rich.
2015 Dec 05
6
[PATCH 0/6 v2] [FOR COMMENTS ONLY] Rework inspection.
This is a more working version. Inspection (partially) succeeds on a real guest this time :-) You can test it out on a real guest (in this case, a CentOS disk image located at /tmp/centos-6.img) by doing: $ ./run guestfish -v -x -a /tmp/centos-6.img ><fs> run ><fs> debug sh "guestfs-inspection --verbose" which will print lots of debugging, and at the end the
2017 Jun 03
12
[PATCH v2 00/12] Allow APIs to be implemented in OCaml.
Version 1 was here: https://www.redhat.com/archives/libguestfs/2017-June/msg00003.html This patch series reimplements a few more APIs in OCaml, including some very important core APIs like ?list_filesystems? and ?mount?. All the tests pass after this. The selection of APIs that I have moved may look a little random, but in fact they are all APIs consumed by the inspection code (and some more
2016 Jan 21
8
[PATCH v3 0/6] [FOR COMMENTS ONLY] Rework inspection.
For background on this change, see: https://rwmj.wordpress.com/2015/12/06/inspection-now-with-added-prolog/ v2 was previously posted here: https://www.redhat.com/archives/libguestfs/2015-December/msg00038.html To test this patch series on a real guest, you can do: $ ./run guestfish -v -x -a /var/tmp/centos-6.img ><fs> run ><fs> debug sh "guestfs-inspection
2005 Apr 27
23
xen on suse 9.3 and software raid
Has anyone had issues starting xen0 on a md? I have installed it a few times now w/ and w/o raid. Anytime I have a raid1 mirror, Xen panics on boot when trying to mount /. It gets past waiting for /dev/md0 to appear. John _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
2005 Apr 27
23
xen on suse 9.3 and software raid
Has anyone had issues starting xen0 on a md? I have installed it a few times now w/ and w/o raid. Anytime I have a raid1 mirror, Xen panics on boot when trying to mount /. It gets past waiting for /dev/md0 to appear. John _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
2017 Jun 05
19
[PATCH v3 00/19] Allow APIs to be implemented in OCaml.
v2 was here: https://www.redhat.com/archives/libguestfs/2017-June/msg00008.html This series gets as far as a working (and faster) reimplementation of ‘guestfs_list_filesystems’. I also have another patch series on top of this one which reimplements the inspection APIs inside the daemon, but that needs a bit more work still, since inspection turns out to be a very large piece of code. Rich.
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
2015 Oct 05
0
[PATCH 2/2] Fix whitespace.
...devsparts.c b/daemon/devsparts.c index aebc213..46ca4c1 100644 --- a/daemon/devsparts.c +++ b/daemon/devsparts.c @@ -173,10 +173,10 @@ add_partitions (const char *device, struct stringsbuf *r) /* Check if readdir failed */ if (0 != errno) { - reply_with_perror ("readdir: %s", devdir); - free_stringslen (r->argv, r->size); - closedir (dir); - return -1; + reply_with_perror ("readdir: %s", devdir); + free_stringslen (r->argv, r->size); + closedir (dir); + return -1; } /* Close the directory handle */ @@ -252,8 +252,7 @@ do...
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.