search for: cleanup_pclose

Displaying 20 results from an estimated 21 matches for "cleanup_pclose".

Did you mean: cleanup_fclose
2017 Mar 24
0
Re: [PATCH] p2v: Use lscpu instead of libvirt to get CPU information.
...lags from F</proc/cpuinfo>. > + * Get the output of lscpu as a list of (key, value) pairs (as a > + * flattened list of strings). > */ > -static void > -cpuinfo_flags (struct cpu_config *cpu) > +static char ** > +get_lscpu (void) > { > const char *cmd; > CLEANUP_PCLOSE FILE *fp = NULL; > - CLEANUP_FREE char *flag = NULL; > + CLEANUP_FREE char *line = NULL; > ssize_t len; > size_t buflen = 0; > + char **ret = NULL; > + size_t ret_size = 0; > > - /* Get the flags, one per line. */ > - cmd = "< /proc/cpuinfo " &g...
2019 Apr 30
0
Re: 1.39 proposal: Let's split up the libguestfs git repo and tarballs
...C However, even if it looks simple, in reality there are number of common things used from the rest of the libguestfs tree: 1) gnulib 2) some build system bits (e.g. m4/guestfs-v2v.m4) 3) auto-cleanup bits (e.g. CLEANUP_FREE), although only few are used (CLEANUP_FREE, CLEANUP_FREE_STRING_LIST, CLEANUP_PCLOSE, CLEANUP_FCLOSE, and CLEANUP_XMLFREETEXTWRITER) 4) other internal macros, i.e. guestfs-utils.h 5) the list of credits generated by the generator (i.e. generator/authors.ml) 6) the p2v configuration generated by the generator (i.e. generator/p2v_config.ml) 7) test images/data (phony images,...
2017 Mar 16
0
[PATCH 1/4] p2v: Pass host CPU details to virt-v2v.
...(struct cpu_config *cpu) +{ + if (cpu->vendor) + free (cpu->vendor); + if (cpu->model) + free (cpu->model); + memset (cpu, 0, sizeof *cpu); +} + +/** + * Read flags from F</proc/cpuinfo>. + */ +static void +cpuinfo_flags (struct cpu_config *cpu) +{ + const char *cmd; + CLEANUP_PCLOSE FILE *fp = NULL; + CLEANUP_FREE char *flag = NULL; + ssize_t len; + size_t buflen = 0; + + /* Get the flags, one per line. */ + cmd = "< /proc/cpuinfo " +#if defined(__arm__) + "grep ^Features" +#else + "grep ^flags" +#endif + " | awk '{ for (...
2019 Jun 10
3
Re: 1.39 proposal: Let's split up the libguestfs git repo and tarballs
...l of which are likely to be easily worked around. > 2) some build system bits (e.g. m4/guestfs-v2v.m4) Right, although this in itself should be split up, so no bad thing. > 3) auto-cleanup bits (e.g. CLEANUP_FREE), although only few are used > (CLEANUP_FREE, CLEANUP_FREE_STRING_LIST, CLEANUP_PCLOSE, > CLEANUP_FCLOSE, and CLEANUP_XMLFREETEXTWRITER) > 4) other internal macros, i.e. guestfs-utils.h Common code is a bit tricker, as is ... > 5) the list of credits generated by the generator > (i.e. generator/authors.ml) > 6) the p2v configuration generated by the generator &...
2019 Jul 01
0
Re: 1.39 proposal: Let's split up the libguestfs git repo and tarballs
...getprogname.h, and c-ctype.h, all of which are likely > to be easily worked around. True, however for now it can stay, as it is one obstacle less for the split. > > 3) auto-cleanup bits (e.g. CLEANUP_FREE), although only few are used > > (CLEANUP_FREE, CLEANUP_FREE_STRING_LIST, CLEANUP_PCLOSE, > > CLEANUP_FCLOSE, and CLEANUP_XMLFREETEXTWRITER) > > 4) other internal macros, i.e. guestfs-utils.h > > Common code is a bit tricker, as is ... So far it is ~4K of bits of code copied, with ~9K more of straight copies of libxml2-cleanups.c + libxml2-writer-macros.h from co...
2017 Mar 23
2
[PATCH] p2v: Use lscpu instead of libvirt to get CPU information.
...nfig (struct cpu_config *cpu) } /** - * Read flags from F</proc/cpuinfo>. + * Get the output of lscpu as a list of (key, value) pairs (as a + * flattened list of strings). */ -static void -cpuinfo_flags (struct cpu_config *cpu) +static char ** +get_lscpu (void) { const char *cmd; CLEANUP_PCLOSE FILE *fp = NULL; - CLEANUP_FREE char *flag = NULL; + CLEANUP_FREE char *line = NULL; ssize_t len; size_t buflen = 0; + char **ret = NULL; + size_t ret_size = 0; - /* Get the flags, one per line. */ - cmd = "< /proc/cpuinfo " -#if defined(__arm__) - "grep ^Features...
2018 Feb 09
6
1.39 proposal: Let's split up the libguestfs git repo and tarballs
My contention is that the libguestfs git repository is too large and unwieldy. There are too many separate, unrelated projects and as a result of that the source has too many dependencies and takes too long to build and test. The project divides (sort of) naturally into layers -- the library, the bindings, the various virt tools -- and could be split along those lines into separate projects
2017 Jun 15
0
[PATCH v6 05/41] utils: Split out cleanups into common/cleanups.
...ute__((cleanup(guestfs_int_cleanup_hash_free))) +#define CLEANUP_UNLINK_FREE \ + __attribute__((cleanup(guestfs_int_cleanup_unlink_free))) +#define CLEANUP_FCLOSE \ + __attribute__((cleanup(guestfs_int_cleanup_fclose))) +#define CLEANUP_PCLOSE \ + __attribute__((cleanup(guestfs_int_cleanup_pclose))) +#define CLEANUP_XMLFREE \ + __attribute__((cleanup(guestfs_int_cleanup_xmlFree))) +#define CLEANUP_XMLBUFFERFREE \ + __attribute__((cleanup...
2015 Jun 16
5
[PATCH threads v2 0/5] Add support for thread-safe handle.
Previous discussion here: https://www.redhat.com/archives/libguestfs/2015-June/thread.html#00048 v2: - Use a cleanup handler to release the lock. - Rebase to upstream. Note I have not fixed the problem(s) with error handling (patch 3).
2017 Jun 27
9
[PATCH v3 0/5] threads: Add support for thread-safe handle.
Previously posted in 2015: v1: https://www.redhat.com/archives/libguestfs/2015-June/msg00048.html v2: https://www.redhat.com/archives/libguestfs/2015-June/msg00118.html I have rebased and tidied up the patches, fixing a few spelling mistakes, but they are broadly the same as before. I also ran all the tests, which pass. As with the previous versions, this makes a change to the API, where you
2017 Mar 16
7
[PATCH 0/4] Pass CPU vendor, model and topology from source to target.
This is tangentially related to: https://bugzilla.redhat.com/show_bug.cgi?id=1372668 The problem in that bug is that we didn't pass the source CPU model (Sandybridge in that case) through to the target RHV hypervisor. So when the Windows guest booted on the target it gives an error about CPU hardware being disconnected (although it otherwise boots and works fine). This patch series
2016 Feb 05
7
[PATCH 0/7] lib: Stop exporting the safe_malloc, etc. functions.
The safe_malloc (etc) functions call g->abort_fn on failure. That's not appropriate for language bindings, and we never intended that these internal functions be used from language bindings, that was just a historical accident. This patch series removes any external use of the safe_* functions. Rich.
2017 Mar 17
7
[PATCH v2 0/6] v2v: Pass CPU vendor, model and topology from source to target.
v1 -> v2: - Support for passing topology through -o glance. - Support for passing topology through -o rhv. - Use bool for acpi/apic/pae struct fields in virt-p2v. - Write the xpath expression in error messages instead of file/line. - Fix more memory leaks in virt-p2v cpuid.c. - Passes make check & check-valgrind. There may be some other minor changes. I believe that everything
2017 Jun 19
16
[PATCH v7 00/13] Refactor utilities
This is just the utilities part of the patch series from: https://www.redhat.com/archives/libguestfs/2017-June/msg00103.html I believe this addresses everything raised in comments on that patch series. Rich.
2019 Jul 09
7
[PATCH 0/5] Split virt-p2v in own repository
Hi, as it was already discussed on this list, here it is my attempt in splitting virt-p2v in an own repository. Sadly there are things that must be copied from libguestfs, as it cannot be avoided. The approach taken was to run a script (will send separately) to just get the "p2v" subdirectory with its history as own repository, and then add in few followup commits all the bits needed
2017 Jun 09
12
[PATCH 00/12] Refactor utility functions.
This turned out to be rather more involved than I thought. We have lots of utility functions, spread all over the repository, with not a lot of structure. This moves many of them under common/ and structures them so there are clear dependencies. This doesn't complete the job by any means. Other items I had on my to-do list for this change were: - Split up mllib/common_utils into: -
2017 Jun 12
32
[PATCH v5 00/32] Refactor utilities, implement some APIs in OCaml.
This is a combination of: https://www.redhat.com/archives/libguestfs/2017-June/msg00046.html [PATCH 00/12] Refactor utility functions. plus: https://www.redhat.com/archives/libguestfs/2017-June/msg00023.html [PATCH v3 00/19] Allow APIs to be implemented in OCaml. with the second patches rebased on top of the utility refactoring, and some other adjustments and extensions. This passes
2017 Jun 15
45
[PATCH v6 00/41] Refactor utilities, reimplement inspection in the daemon.
v5: https://www.redhat.com/archives/libguestfs/2017-June/msg00065.html Since v5, this now implements inspection almost completely for Linux and Windows guests. Rich.
2017 Jun 21
45
[PATCH v8 00/42] Refactor utilities and reimplement inspection.
v7 was: https://www.redhat.com/archives/libguestfs/2017-June/msg00169.html https://www.redhat.com/archives/libguestfs/2017-June/msg00184.html I believe this addresses all comments received so far. Also it now passes a test where I compared about 100 disk images processed with old and new virt-inspector binaries. The output is identical in all cases except one which is caused by a bug in blkid
2015 Feb 14
2
[PATCH 0/2] Change guestfs__*
libguestfs has used double and triple underscores in identifiers. These aren't valid for global names in C++. (http://stackoverflow.com/a/228797) These large but completely mechanical patches change the illegal identifiers to legal ones. Rich.