search for: guestfs_canonical_device_name

Displaying 20 results from an estimated 37 matches for "guestfs_canonical_device_name".

2016 Mar 01
2
Re: [PATCH 3/3] fish: fix btrfs subvolumes display in error case
...> index da5015d..5c09bfb 100644 > --- a/fish/options.c > +++ b/fish/options.c > @@ -280,7 +280,20 @@ display_mountpoints_on_failure (const char *mp_device, > guestfs_int_program_name); > > for (i = 0; fses[i] != NULL; i += 2) { > - CLEANUP_FREE char *p = guestfs_canonical_device_name (g, fses[i]); > + CLEANUP_FREE char *p = NULL; > + CLEANUP_FREE char *device = guestfs_mountable_device(g, fses[i]); > + CLEANUP_FREE char *volume = guestfs_mountable_subvolume(g, fses[i]); If guestfs_mountable_subvolume fails, then an error is issued to the error handler set: yo...
2018 Oct 04
0
[PATCH v2 3/4] inspector: Use libxml writer macros.
...nd_element (); } static void @@ -351,152 +360,129 @@ output_root (xmlTextWriterPtr xo, char *root) { char *str; int i; - char buf[32]; char *canonical_root; size_t size; - XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "operatingsystem")); - - canonical_root = guestfs_canonical_device_name (g, root); - if (canonical_root == NULL) - exit (EXIT_FAILURE); - XMLERROR (-1, - xmlTextWriterWriteElement (xo, BAD_CAST "root", BAD_CAST canonical_root)); - free (canonical_root); - - str = guestfs_inspect_get_type (g, root); - if (!str) exit (EXIT_FAILURE); - if (STRNEQ (s...
2020 Oct 09
2
Re: [PATCH v3 8/8] lib/canonical-name.c: Hide EINVAL error from underlying API call.
On Fri, Oct 09, 2020 at 11:33:43AM +0100, Richard W.M. Jones wrote: > > This is the patch I tested which works (on top of the > patch posted): > > diff --git a/lib/canonical-name.c b/lib/canonical-name.c > index e0c7918b4..ae4def692 100644 > --- a/lib/canonical-name.c > +++ b/lib/canonical-name.c > @@ -53,8 +53,16 @@ guestfs_impl_canonical_device_name (guestfs_h *g,
2016 Mar 01
0
[PATCH 3/3] fish: fix btrfs subvolumes display in error case
...--git a/fish/options.c b/fish/options.c index da5015d..5c09bfb 100644 --- a/fish/options.c +++ b/fish/options.c @@ -280,7 +280,20 @@ display_mountpoints_on_failure (const char *mp_device, guestfs_int_program_name); for (i = 0; fses[i] != NULL; i += 2) { - CLEANUP_FREE char *p = guestfs_canonical_device_name (g, fses[i]); + CLEANUP_FREE char *p = NULL; + CLEANUP_FREE char *device = guestfs_mountable_device(g, fses[i]); + CLEANUP_FREE char *volume = guestfs_mountable_subvolume(g, fses[i]); + + /* Reformat the internal btrfsvol string into a valid mount option */ + if (device && vo...
2016 Mar 08
0
[PATCH v2 3/3] fish: fix btrfs subvolumes display in error case
...--git a/fish/options.c b/fish/options.c index da5015d..9222b69 100644 --- a/fish/options.c +++ b/fish/options.c @@ -280,7 +280,33 @@ display_mountpoints_on_failure (const char *mp_device, guestfs_int_program_name); for (i = 0; fses[i] != NULL; i += 2) { - CLEANUP_FREE char *p = guestfs_canonical_device_name (g, fses[i]); + CLEANUP_FREE char *p = NULL; + CLEANUP_FREE char *device = guestfs_mountable_device(g, fses[i]); + CLEANUP_FREE char *subvolume = NULL; + int subvolume_errno; + + guestfs_push_error_handler (g, NULL, NULL); + + subvolume = guestfs_mountable_subvolume(g, fses[i]); +...
2017 Jan 19
2
[PATCH 1/2] canonical_device_name: Don't rewrite /dev/mdX as /dev/sdX (RHBZ#1414682).
The guestfs_canonical_device_name API was rewriting /dev/mdX as /dev/sdX. This is wrong since (eg) /dev/sd0 is not a device name, so if you pass the canonicalized name back to the API it will fail. virt-v2v was one tool doing this. --- src/canonical-name.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/canonical-name.c b...
2020 Oct 09
0
Re: [PATCH v3 8/8] lib/canonical-name.c: Hide EINVAL error from underlying API call.
...ers and returns a non-error > original string (see <----- line above) and exit code 0. With the > patch we return an error. This breaks virt-inspector, at least when we run the test suite which has a phony Ubuntu guest with a non-existent /dev/mapper/* in its /etc/fstab. The manpage for guestfs_canonical_device_name[1] is sort of ambiguous here. It says that "/dev/mapper/*" is Converted to /dev/VG/LV form using guestfs_lvm_canonical_lv_name. and guestfs_lvm_canonical_lv_name will certainly return an error for a non-existent name. However it does also say: Other strings are returned unmodifie...
2018 Nov 02
7
[PATCH v3 0/4] common/utils: Move libxml2 writer macros to a common header file.
v1 was here: https://www.redhat.com/archives/libguestfs/2018-October/msg00047.html v2 was here: https://www.redhat.com/archives/libguestfs/2018-October/msg00051.html v3: - Back to using string/string_format and attribute/attribute_format. - Add both single_element and single_element_format. - Rebased and retested. Rich.
2018 Oct 04
2
[PATCH 0/2] Use common macros to help with libxml2 writer.
Consolidate and extend the use of funky start_element() etc macros. Rich.
2016 Mar 01
6
[PATCH 0/3] btrfs subvolumes display fix
Hey there! Here are a few patches to fix unrelated things: one fixes the configure for older ncurses releases having no pkg-config files. The other two are fixing what Richard mentioned about guestfs subvolumes display Cédric Bosdonnat (3): configure: handle older version of ncurses api: add mountable_device and mountable_subvolume fish: fix btrfs subvolumes display in error case
2016 Mar 08
7
[PATCH v2 0/3] btrfs subvolumes display fix
Hi all, Here is version 2 of the patch series, including the changes for Pino's remarks. Cédric Bosdonnat (3): configure: handle older version of ncurses api: add mountable_device and mountable_subvolume fish: fix btrfs subvolumes display in error case fish/options.c | 28 ++++++++++++++++++++++++++- generator/actions.ml | 26 +++++++++++++++++++++++++
2018 Oct 04
6
[PATCH v2 0/4] common/utils: Move libxml2 writer macros to a common header file.
v1 was here: https://www.redhat.com/archives/libguestfs/2018-October/msg00047.html However it was broken in a few ways. First of all the documentation was broken because "/**" enhanced comments were not permitted on macros. This is fixed in the new 1/4 patch. Secondly we didn't use single_element() everywhere possible, which is fixed in the new 4/4 patch. Lastly I've
2016 Feb 05
3
[PATCH] inspect: get windows drive letters for GPT disks.
...IST char **fses = NULL; + size_t i; + + fses = guestfs_list_filesystems (g); + if (fses == NULL) + return NULL; + + for (i = 0; fses[i] != NULL; i += 2) { + CLEANUP_FREE char *fs_guid = NULL; + CLEANUP_FREE char *blob_guid = NULL; + CLEANUP_FREE char *fs_dev = NULL; + + fs_dev = guestfs_canonical_device_name (g, fses[i]); + + if (fs_dev == NULL) + continue; + + int partnum = guestfs_part_to_partnum (g, fs_dev); + CLEANUP_FREE char *device = guestfs_part_to_dev (g, fs_dev); + CLEANUP_FREE char *type = guestfs_part_get_parttype (g, device); + + if (STRCASENEQ(type, "gpt"))...
2016 Mar 08
5
[PATCH v3 0/3] btrfs subvolumes display fix
Hi there, Latest and greatest version including all new remarks from both Pino and Rich. Cédric Bosdonnat (3): configure: handle older version of ncurses api: add mountable_device and mountable_subvolume fish: fix btrfs subvolumes display in error case fish/options.c | 28 ++++++++++++++++++++++++++- generator/actions.ml | 26 +++++++++++++++++++++++++ m4/guestfs_libraries.m4
2016 Feb 05
2
[PATCHv2] inspect: get windows drive letters for GPT disks.
...applied style changes from review * use guestfs_list_partitions instead of guestfs_list_filesystems * do the GUID endianness conversion correctly * check all API calls for errors * do not call guestfs_canonical_device_name to prevent from changing * block device names, i.e /dev/vda1 as it comes from list_partitions * to /dev/sda1 in inspect_get_drive_mappings src/inspect-fs-windows.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 102 insertions(+), 2 deletions(-) diff --git a/src/...
2016 Mar 01
0
Re: [PATCH 3/3] fish: fix btrfs subvolumes display in error case
...rch 2016 11:17:19 Cédric Bosdonnat wrote: [...] > > + if (asprintf (&p, "%s:/:subvol=%s", device, volume) == -1) { > > + perror ("asprintf"); > > + exit (EXIT_FAILURE); > > + } > > + } else { > > + p = guestfs_canonical_device_name (g, fses[i]); > > + } > > Usually there are no curly brackets for blocks of a single > instruction. Even if there is a non-single line block in the same if (or else) part? -- Cedric
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.
2015 Jun 18
3
[PATCH v2 0/3] daemon: parted: Always use -s option even with -m.
version 2: - Turn the "unrecognised disk label" error into errno == EINVAL - Fix virt-alignment-scan - Rework the fix for virt-v2v bug 1232192 (see description of patch 3/3)
2016 Feb 05
0
Re: [PATCH] inspect: get windows drive letters for GPT disks.
...get the list of partitions, then guestfs_list_partitions is what you should be calling. > + for (i = 0; fses[i] != NULL; i += 2) { > + CLEANUP_FREE char *fs_guid = NULL; > + CLEANUP_FREE char *blob_guid = NULL; > + CLEANUP_FREE char *fs_dev = NULL; > + > + fs_dev = guestfs_canonical_device_name (g, fses[i]); > + > + if (fs_dev == NULL) > + continue; > + > + int partnum = guestfs_part_to_partnum (g, fs_dev); Need to check that partnum != -1 and do something. > + CLEANUP_FREE char *device = guestfs_part_to_dev (g, fs_dev); > + CLEANUP_FREE char *typ...
2017 Feb 28
0
ANNOUNCE: libguestfs 1.36 released
...s "guestfs_add_domain" This call now handles libvirt file-based volumes correctly, where previously these would have been ignored. Also handled are disks which require libvirt authentication secrets to open (Pino Toscano). "guestfs_canonical_device_name" This call will no longer incorrectly modify Linux software RAID device names (like /dev/mdX). "guestfs_file_architecture" Previously the "file_architecture" API could return either of the strings "i386" or &quot...