search for: hash_initialize

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

2009 Aug 03
2
[PATCH] New commands to list devices by UUID and label
...* even create this directory. In this case let's return + * an empty hashtable. + */ + perror (udevpath); + if (add_string (&ret, &size, &alloc, NULL) == -1) + return NULL; + return ret; + } + + /* First pass, over the udev /dev/disk directory. */ + hash1 = hash_initialize (128, NULL, hasher1, comparator1, freer1); + if (hash1 == NULL) { + reply_with_perror ("hash_initialize"); + goto error; + } + + while ((d = readdir (dir)) != NULL) { + snprintf (path, sizeof path, "%s/%s", udevpath, d->d_name); + if (stat (path, &statbuf)...
2011 Dec 01
2
[PATCH 0/2] handle MD devices in fstab
Only change from previous post is explicitly checking md_map for NULL before hash_free and lookup.
2011 Nov 25
2
[PATCH 0/2] MD device inspection
These patches are rebased on top of current master. In addition, I've made the following changes: * Fixed whitespace error. * Functions return -1 on error. * Added a debug message when guest contains md devices, but nothing was parsed from mdadm.conf.
2011 Dec 02
3
[PATCH 1/3] build: Add more suppressions for valgrind tests
--- extratests/suppressions | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/extratests/suppressions b/extratests/suppressions index 97d4b78..78ca4ab 100644 --- a/extratests/suppressions +++ b/extratests/suppressions @@ -3,19 +3,19 @@ Memcheck:Cond fun:* fun:numa_node_size64 - fun:numa_init + obj:/usr/lib64/libnuma.so.1 } {
2012 Mar 28
2
[PATCH v2] New APIs: mount-local and umount-local using FUSE
This version doesn't crash or cause hung processes or stuck mountpoints, so that's an improvement. Rich.
2012 Mar 27
3
[PATCH 0/3] Enable FUSE support in the API via 'mount-local' call.
This patch is just for review. It enables FUSE support in the API via two new calls, 'guestfs_mount_local' and 'guestfs_umount_local'. FUSE turns out to be very easy to deadlock (necessitating that the machine be rebooted). Running the test from the third patch is usually an effective way to demonstrate this. However I have not yet managed to produce a simple reproducer that
2012 Mar 29
3
[PATCH v3] New APIs: mount-local, mount-local-run and umount-local using FUSE
This changes the proposed API slightly. Previously 'mount-local' generating a 'mounted' event when the filesystem was ready, and from the 'mounted' event you had to effectively do a fork. Now, 'mount-local' just initializes the mountpoint and you have to call 'mount-local-run' to enter the FUSE main loop. Between these calls you can do a fork or whatever
2015 Jun 06
0
[PATCH 2/5] threads: Acquire and release the lock around each public guestfs_* API.
...ivate-data.c index 725b74b..d54033b 100644 --- a/src/private-data.c +++ b/src/private-data.c @@ -68,6 +68,8 @@ guestfs_set_private (guestfs_h *g, const char *key, void *data) { struct pda_entry *new_entry, *old_entry, *entry; + ACQUIRE_LOCK (g); + if (g->pda == NULL) { g->pda = hash_initialize (16, NULL, hasher, comparator, freer); if (g->pda == NULL) @@ -85,10 +87,12 @@ guestfs_set_private (guestfs_h *g, const char *key, void *data) if (entry == NULL) g->abort_cb (); assert (entry == new_entry); + + RELEASE_LOCK (g); } -void * -guestfs_get_private (guestfs_h *g...
2011 Nov 23
8
[PATCH 0/8] Add MD inspection support to libguestfs
This series fixes inspection in the case that fstab contains references to md devices. I've made a few changes since the previous posting, which I've summarised below. [PATCH 1/8] build: Create an MD variant of the dummy Fedora image I've double checked that no timestamp is required in the Makefile. The script will not run a second time to build fedora-md2.img. [PATCH 2/8] build:
2010 Mar 11
2
[PATCH FOR DISCUSSION ONLY] Rewrite libguestfs-supermin-helper in C.
...ding the + * directory over again. However this means you really must not + * alter the array of strings that are returned. + * + * Returns an empty list if the directory cannot be opened. + */ +static char ** +read_dir (const char *name) +{ + static Hash_table *ht = NULL; + + if (!ht) + ht = hash_initialize (1024, NULL, dir_cache_hash, dir_cache_compare, NULL); + + struct dir_cache key = { .path = (char *) name }; + struct dir_cache *p = hash_lookup (ht, &key); + if (p) + return p->files; + + char **files = NULL; + size_t size = 0, alloc = 0; + + DIR *dir = opendir (name); + if (!dir)...
2017 Jan 12
3
[PATCH 0/3] library: improve handling of external tools
Hi, the libguestfs library uses a number of external tools; for some of them, we search for them at build time, enabling some feature only if found, and later on assuming at runtime they are installed. However, the situation is more complex than that: - hardcoding the full path means that there is an incoherency in the way some of the tools are used, as some other tools (e.g. qemu-img) are
2017 Feb 02
4
[PATCH v2 0/3] library: improve handling of external tools
Hi, the libguestfs library uses a number of external tools; for some of them, we search for them at build time, enabling some feature only if found, and later on assuming at runtime they are installed. However, the situation is more complex than that: - hardcoding the full path means that there is an incoherency in the way some of the tools are used, as some other tools (e.g. qemu-img) are
2009 Nov 20
1
fix new failures from latest-from-gnulib syntax-check
...if (str == NULL) { perror ("malloc"); - exit (1); + exit (EXIT_FAILURE); } strcpy (str, home); diff --git a/fuse/dircache.c b/fuse/dircache.c index 86760f0..157035e 100644 --- a/fuse/dircache.c +++ b/fuse/dircache.c @@ -138,7 +138,7 @@ init_dir_caches (void) rlc_ht = hash_initialize (1024, NULL, gen_hash, gen_compare, rlc_free); if (!lsc_ht || !xac_ht || !rlc_ht) { fprintf (stderr, "guestmount: could not initialize dir cache hashtables\n"); - exit (1); + exit (EXIT_FAILURE); } } diff --git a/fuse/guestmount.c b/fuse/guestmount.c index 05cacef..07c2...
2015 Jun 06
7
[PATCH 0/5] Add support for thread-safe handle.
This patch isn't ready to go upstream. In fact, I think we might do a quick 1.30 release soon, and save this patch, and also the extensive changes proposed for the test suite[1], to after 1.30. Currently it is not safe to use the same handle from multiple threads, unless you implement your own mutexes. See: http://libguestfs.org/guestfs.3.html#multiple-handles-and-multiple-threads These
2010 Aug 31
13
[PATCH v2] Add progress bars
This is an updated and extended version of the original patch: https://www.redhat.com/archives/libguestfs/2010-August/msg00163.html This adds OCaml and Perl bindings (both tested), support for progress bars in virt-resize, and adds progress notifications to a number of the simpler commands. Still to do is to add progress messages to more commands. There are still a few commands which would be
2015 Oct 05
0
[PATCH 2/2] Fix whitespace.
...a debug message if we've got md devices, but nothing in mdadm.conf */ if (matches[0] == NULL) { debug(g, "Appliance has MD devices, but augeas returned no array matches " - "in mdadm.conf"); + "in mdadm.conf"); return 0; } *map = hash_initialize(16, NULL, mdadm_app_hash, mdadm_app_cmp, - mdadm_app_free); + mdadm_app_free); if (!*map) g->abort_cb(); for (char **m = matches; *m != NULL; m++) { @@ -1654,15 +1654,15 @@ map_md_devices(guestfs_h *g, Hash_table **map) entry->app = safe_str...
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 21
10
[PATCH v10 00/10] Reimplement inspection in the daemon.
v9 was here: https://www.redhat.com/archives/libguestfs/2017-July/msg00139.html This depends on these three series (the first two being single minor patches): https://www.redhat.com/archives/libguestfs/2017-July/msg00207.html https://www.redhat.com/archives/libguestfs/2017-July/msg00209.html https://www.redhat.com/archives/libguestfs/2017-July/msg00215.html There is no substantive change. I
2017 Jul 17
12
[PATCH v9 00/11] Reimplement inspection in the daemon.
This depends on the patch series "[PATCH 00/27] Reimplement many daemon APIs in OCaml." (https://www.redhat.com/archives/libguestfs/2017-July/msg00098.html) v8 was posted here: https://www.redhat.com/archives/libguestfs/2017-June/msg00274.html v9: - I split up the mega-patch into a more reviewable series of smaller, incremental patches. There are some other changes vs v8, but
2017 Aug 09
16
[PATCH v12 00/11] Reimplement inspection in the daemon.
This fixes almost everything. Note that it adds an extra commit which fixes the whole utf8/iconv business. It's probably better to list what isn't fixed: (1) I didn't leave the osinfo code around because I'm still haven't looked too closely at virt-builder-repository. Can't we just fetch this code from the git history when we need it? (2) I didn't change the way