search for: guestfs_feature_avail

Displaying 20 results from an estimated 55 matches for "guestfs_feature_avail".

2014 Mar 21
2
[PATCH] listfs: If LDM not available, don't inhibit partition detection (RHBZ#1079182).
...deletions(-) diff --git a/src/listfs.c b/src/listfs.c index bbdb0a2..ffb0adc 100644 --- a/src/listfs.c +++ b/src/listfs.c @@ -47,8 +47,11 @@ guestfs__list_filesystems (guestfs_h *g) { size_t i; DECLARE_STRINGSBUF (ret); + const char *lvm2[] = { "lvm2", NULL }; + int has_lvm2 = guestfs_feature_available (g, (char **) lvm2); const char *ldm[] = { "ldm", NULL }; + int has_ldm = guestfs_feature_available (g, (char **) ldm); CLEANUP_FREE_STRING_LIST char **devices = NULL; CLEANUP_FREE_STRING_LIST char **partitions = NULL; @@ -83,7 +86,7 @@ guestfs__list_filesystems (guestfs_h...
2015 Nov 04
2
[PATCH] tests/c-api: cache available features
Build a list of all the features used in action tests, and lazily read them as needed. This reduces the number of guestfs_feature_available calls for a full run from 117 to 18. --- generator/tests_c_api.ml | 77 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 4 deletions(-) diff --git a/generator/tests_c_api.ml b/generator/tests_c_api.ml index 6be753f..8c4e5ef 100644 --- a/generator/tests_c_api....
2013 Dec 23
2
[PATCH] tests/mountable: skip if btrfs is not available
...ternal_mountable *mountable; const char *devices[] = { "/dev/VG/LV", NULL }; + const char *feature[] = { "btrfs", NULL }; g = guestfs_create (); if (g == NULL) { @@ -48,6 +49,12 @@ main (int argc, char *argv[]) if (guestfs_launch (g) == -1) goto error; + if (!guestfs_feature_available (g, (char **) feature)) { + printf ("skipping test because btrfs is not available\n"); + guestfs_close (g); + exit (77); + } + if (guestfs_part_disk (g, "/dev/sda", "mbr") == -1) goto error; if (guestfs_pvcreate (g, "/dev/sda1") == -1) g...
2014 Feb 11
2
[PATCH] list-filesystems: Do not segfault if guestfs_btrfs_subvolume_list returns an error (RHBZ#1064008).
...partitions[i], &ret) == -1) + goto error; + } } /* Use vfs-type to check for filesystems on md devices. */ for (i = 0; mds[i] != NULL; ++i) - check_with_vfs_type (g, mds[i], &ret); + if (check_with_vfs_type (g, mds[i], &ret) == -1) + goto error; if (guestfs_feature_available (g, (char **) lvm2)) { /* Use vfs-type to check for filesystems on LVs. */ @@ -96,7 +100,8 @@ guestfs__list_filesystems (guestfs_h *g) if (lvs == NULL) goto error; for (i = 0; lvs[i] != NULL; ++i) - check_with_vfs_type (g, lvs[i], &ret); + if (check_with_vfs_type...
2015 Nov 04
0
Re: [PATCH] tests/c-api: cache available features
On Wed, Nov 04, 2015 at 06:42:13PM +0100, Pino Toscano wrote: > Build a list of all the features used in action tests, and lazily read > them as needed. This reduces the number of guestfs_feature_available > calls for a full run from 117 to 18. ACK. But even better if you turned guestfs_feature_available into a non_daemon_function, added a new guestfs_internal_feature_available daemon_function, and then cached the results on the library side. They can never change for the duration of a libgu...
2013 Dec 23
1
[PATCH] tests/mountable: skip if btrfs is not available
...ternal_mountable *mountable; const char *devices[] = { "/dev/VG/LV", NULL }; + const char *feature[] = { "btrfs", NULL }; g = guestfs_create (); if (g == NULL) { @@ -48,6 +49,18 @@ main (int argc, char *argv[]) if (guestfs_launch (g) == -1) goto error; + if (!guestfs_feature_available (g, (char **) feature)) { + printf ("skipping test because btrfs is not available\n"); + guestfs_close (g); + exit (77); + } + + if (!guestfs_filesystem_available (g, "btrfs")) { + printf ("skipping test because btrfs filesystem is not available\n");...
2014 Feb 12
0
Re: [PATCH] list-filesystems: Do not segfault if guestfs_btrfs_subvolume_list returns an error (RHBZ#1064008).
...rror; > + } > } > > /* Use vfs-type to check for filesystems on md devices. */ > for (i = 0; mds[i] != NULL; ++i) > - check_with_vfs_type (g, mds[i], &ret); > + if (check_with_vfs_type (g, mds[i], &ret) == -1) > + goto error; > > if (guestfs_feature_available (g, (char **) lvm2)) { > /* Use vfs-type to check for filesystems on LVs. */ > @@ -96,7 +100,8 @@ guestfs__list_filesystems (guestfs_h *g) > if (lvs == NULL) goto error; > > for (i = 0; lvs[i] != NULL; ++i) > - check_with_vfs_type (g, lvs[i], &ret); &g...
2014 Jan 14
0
[PATCH] builder, edit, fish: use copy-attributes
...opy_attributes (const char *src, const char *dest) -{ - CLEANUP_FREE_STAT struct guestfs_stat *stat = NULL; - const char *linuxxattrs[] = { "linuxxattrs", NULL }; - int has_linuxxattrs; - CLEANUP_FREE char *selinux_context = NULL; - size_t selinux_context_size; - - has_linuxxattrs = guestfs_feature_available (g, (char **) linuxxattrs); - - /* Get the mode. */ - stat = guestfs_stat (g, src); - if (stat == NULL) - return -1; - - /* Get the SELinux context. XXX Should we copy over other extended - * attributes too? - */ - if (has_linuxxattrs) { - guestfs_push_error_handler (g, NULL, NU...
2015 Nov 06
2
Re: [PATCH 2/2] actions: refactor available & feature_available
...realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==25905== by 0x4ECF846: guestfs_int_safe_realloc (alloc.c:80) ==25905== by 0x4ED05FF: find_or_cache_feature (available.c:48) ==25905== by 0x4ED073C: guestfs_impl_feature_available (available.c:89) ==25905== by 0x4EA4B21: guestfs_feature_available (actions-5.c:1131) ==25905== by 0x4EF9FDF: guestfs_impl_list_filesystems (listfs.c:49) ==25905== by 0x4E7EDF2: guestfs_list_filesystems (actions-3.c:419) ==25905== by 0x4EE0FD2: guestfs_impl_inspect_os (inspect.c:62) ==25905== by 0x4E50E12: guestfs_inspect_os (actions-0.c:500) ==259...
2015 Nov 05
4
[PATCH 1/2] actions: turn available & feature_available as non-daemon
...error if I<all> requested groups are available. + +It fails with an error if one or more of the requested +groups is unavailable in the appliance. + +If an unknown group name is included in the +list of groups then an error is always returned. + +I<Notes:> + +=over 4 + +=item * + +C<guestfs_feature_available> is the same as this call, but +with a slightly simpler to use API: that call returns a boolean +true/false instead of throwing an error. + +=item * + +You must call C<guestfs_launch> before calling this function. + +The reason is because we don't know what groups are +supported by...
2015 Dec 01
3
[PATCHv2] New API: part_expand_gpt.
.../actions.ml index 7ab8ee4..3a14683 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -12787,6 +12787,20 @@ See also L<ntfsresize(8)>, L<resize2fs(8)>, L<btrfs(8)>, L<xfs_info(8)>." }; longdesc = "\ This is the internal call which implements C<guestfs_feature_available>." }; + { defaults with + name = "part_expand_gpt"; added = (1, 31, 29); + style = RErr, [Device "device"], []; + proc_nr = Some 459; + optional = Some "gdisk"; + shortdesc = "move backup GPT header to the end of the disk"; + l...
2013 Dec 23
0
Re: [PATCH] tests/mountable: skip if btrfs is not available
...evices[] = { "/dev/VG/LV", NULL }; > + const char *feature[] = { "btrfs", NULL }; > > g = guestfs_create (); > if (g == NULL) { > @@ -48,6 +49,12 @@ main (int argc, char *argv[]) > > if (guestfs_launch (g) == -1) goto error; > > + if (!guestfs_feature_available (g, (char **) feature)) { > + printf ("skipping test because btrfs is not available\n"); > + guestfs_close (g); > + exit (77); > + } > + > if (guestfs_part_disk (g, "/dev/sda", "mbr") == -1) goto error; > > if (guestfs_pvcr...
2019 Jun 02
1
[libnbd] Some IRC questions
...version it is linked against (and similarly for other features like URI support). So as you say above a runtime function is better, which can be added as an ordinary API. This is what we did in libguestfs: http://libguestfs.org/guestfs.3.html#guestfs_version http://libguestfs.org/guestfs.3.html#guestfs_feature_available 02:00 < eblake_> ^ make that if libxml2 support for uri parsing were compiled in 02:01 < eblake_> and the spec file needs an update: libnbd-0.1.2-1.fc29.x86_64 gives: 02:01 < eblake_> nbdkit: error: failure while creating nbd handle: nbd_connect_uri: libnbd was compiled witho...
2016 Mar 02
1
Re: Libguestfs as filesystem forensic tool
On 02/03/16 18:24, Richard W.M. Jones wrote: > On Wed, Mar 02, 2016 at 05:59:32PM +0200, noxdafox wrote: >> One of the patches I'm talking about would add TSK (The Sleuth Kit) >> as a dependency within the appliance. >> >> This would bring new APIs such as: >> 'fls' more powerful 'ls' command allowing to get list of deleted >> files or
2014 Jan 10
0
Re: RFC: copy-attributes command
...PIs while preserving binary compatibility). > +=over 4 > + > +=item C<xattributes> > + > +Copy the Linux extended attributes (xattrs) from C<source> to C<destination>. > +This flag does nothing if the I<linuxxattrs> feature is not available > +(see C<guestfs_feature_available>). > + > +=item C<all> ^ Typo in this line. > +Copy the owner uid and the group gid of C<source> to C<destination>. > + > +=item C<all> > + > +Copy B<all> the attributes from C<source> to C<destination>. Rich. -- Richard Jon...
2016 Jan 19
0
[PATCHv2 1/3] New API: part_get_disk_guid and part_set_disk_guid.
.../actions.ml index 7f8e80b..62c4839 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -12793,6 +12793,43 @@ See also L<ntfsresize(8)>, L<resize2fs(8)>, L<btrfs(8)>, L<xfs_info(8)>." }; longdesc = "\ This is the internal call which implements C<guestfs_feature_available>." }; + { defaults with + name = "part_set_disk_guid"; added = (1, 33, 2); + style = RErr, [Device "device"; GUID "guid"], []; + proc_nr = Some 459; + optional = Some "gdisk"; + tests = [ + InitGPT, Always, TestLastFail ( +...
2014 Jan 07
8
RFC: copy-attributes command
Hi, attached there is a prototype of patch for adding a new copy-attributes command. Such command would allow copy the attributes of a "file" to another, so for example in guestfish: copy-attributes foo bar permissions:true xattributes:false would only copy the permissions of foo to bar, not copying its extended attributes too. Just few notes: - my first daemon command, so
2015 Nov 25
1
[PATCH] New API: part_expand_gpt.
.../actions.ml index 7ab8ee4..3a14683 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -12787,6 +12787,20 @@ See also L<ntfsresize(8)>, L<resize2fs(8)>, L<btrfs(8)>, L<xfs_info(8)>." }; longdesc = "\ This is the internal call which implements C<guestfs_feature_available>." }; + { defaults with + name = "part_expand_gpt"; added = (1, 31, 29); + style = RErr, [Device "device"], []; + proc_nr = Some 459; + optional = Some "gdisk"; + shortdesc = "move backup GPT header to the end of the disk"; +...
2014 May 05
2
[PATCH] test-charset-fidelity: allow to skip testing specific FSes
...variable is set.\n", program_name); @@ -113,6 +115,8 @@ static void test_filesystem (guestfs_h *g, const struct filesystem *fs) { const char *feature[] = { fs->fs_feature, NULL }; + char envvar[sizeof (ourenvvar) + 20]; + char *str; if (fs->fs_feature && !guestfs_feature_available (g, (char **) feature)) { printf ("skipped test of %s because %s feature not available\n", @@ -120,6 +124,14 @@ test_filesystem (guestfs_h *g, const struct filesystem *fs) return; } + snprintf (envvar, sizeof (envvar) - 1, "%s_%s", ourenvvar, fs->fs_name);...
2015 May 26
6
[PATCH 0/6] Update the way that API versions are generated for the man page.
The existing mechanism was clunky, slow and used ~ 10 MB of local disk. Rich.