search for: guestfs_list_devices

Displaying 20 results from an estimated 54 matches for "guestfs_list_devices".

2020 Feb 20
1
[PATCH] lib: Move guestfs_device_index impl from daemon to library.
Although the commit message ties this to https://bugzilla.redhat.com/1804207, in fact I believe this commit could be applied independently. It's a simple optimization. Rich.
2016 Feb 05
1
Re: [PATCH] inspect: get windows drive letters for GPT disks.
...lesystems here?  If you're > trying to get the list of partitions, then guestfs_list_partitions is > what you should be calling. > First, thank you for a prompt review. Yes, I meant to use guestfs_list_filesystems for save myself from doing nested loops - one to pull list of devices (guestfs_list_devices) and another to loop through partitions on each device. If that's a problem, please let me know and I'll change it to follow what map_registry_blob does. > > +  for (i = 0; fses[i] != NULL; i += 2) { > > +    CLEANUP_FREE char *fs_guid = NULL; > > +    CLEANUP_FREE char *...
2011 Nov 22
2
[PATCH] inspection: Handle MD devices in fstab
This patch fixes inspection when fstab contains devices md devices specified as /dev/mdN. The appliance creates these devices without reference to the guest's mdadm.conf so, for e.g. /dev/md0 in the guest will often be created as /dev/md127 in the appliance. With this patch, we match the uuids of detected md devices against uuids specified in mdadm.conf, and map them appropriately when we
2017 Jan 19
3
[PATCH 1/2] daemon: Fix part-to-dev when the partition name includes p<N>.
From: Pino Toscano <ptoscano@redhat.com> If the device name ends with a number, Linux uses partition names of the form <device>p<N>. Handle this case by knocking off the 'p' character. --- daemon/devsparts.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daemon/devsparts.c b/daemon/devsparts.c index 5862ae2..b764f63 100644 --- a/daemon/devsparts.c +++
2012 Aug 20
2
Options for hotplugging
...o add more drives. The API specifies that you refer to drives in other commands in one of two ways. Either you're allowed to use names like "/dev/sda", "/dev/sdb" etc to refer to the first, second etc drive you added, in the same order that you added them. Or you can call guestfs_list_devices which returns a list of device names, opaque strings that you pass to other functions. In the first case (using "/dev/sdX" names), some magic already happens translating these to the real names underneath, but currently that magic is just "/dev/sdX" -> "/dev/vdX" f...
2012 Jul 09
1
[PATCH] NEW API: add new api xfs_info
...rr); + free (out); + return NULL; + } + + return out; +} diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index 5baa9b2..ba0b0de 100644 --- a/generator/generator_actions.ml +++ b/generator/generator_actions.ml @@ -7374,6 +7374,12 @@ be returned if you called C<guestfs_list_devices>. To find out the maximum number of devices that could be added, call C<guestfs_max_disks>."); + ("xfs_info", (RString "information", [String "path"], []), 337, [Optional "xfs"], + [], + "print out the geometry of the filesystem&qu...
2012 May 02
4
[PATCH 0/4] fish: Allow the glob command to expand device patterns (RHBZ#635971).
This patch set fixes a two year old bug in guestfish, namely that the 'glob' command does not expand /dev/* patterns. https://bugzilla.redhat.com/show_bug.cgi?id=635971 Rich.
2017 Jan 19
0
[PATCH 2/2] daemon: Return MD partitions in guestfs_list_partitions (RHBZ#1414510).
...gt;d_name); /* Ignore the root device. */ @@ -131,7 +134,12 @@ add_device (const char *device, struct stringsbuf *r) char ** do_list_devices (void) { - return foreach_block_device (add_device); + /* For backwards compatibility, don't return MD devices in the + * list returned by guestfs_list_devices. This is because most + * API users expect that this list is effectively the same as + * the list of devices added by guestfs_add_drive. + */ + return foreach_block_device (add_device, false); } static int @@ -184,7 +192,7 @@ add_partitions (const char *device, struct stringsbuf *r) ch...
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 May 06
0
Re: libguestfs init problem
...Run the libguestfs back-end. */ > if (guestfs_launch (g) == -1) > exit (EXIT_FAILURE); > > /* Get the list of devices. Because we only added one drive > * above, we expect that this list should contain a single > * element. > */ > char **devices = guestfs_list_devices (g); > if (devices == NULL) > exit (EXIT_FAILURE); > if (devices[0] == NULL || devices[1] != NULL) { > fprintf (stderr, "error: expected a single device from list-devices\n"); > exit (EXIT_FAILURE); > } > > /* Partition the disk as one s...
2017 May 04
4
[PATCH 0/3] generator: Allow returned strings to be annotated as devices.
If we want to permit more than 255 drives to be added, then we will have to add the disks to the same virtio-scsi target using different unit (LUN) numbers. Unfortunately SCSI LUN enumeration in the Linux is not deterministic (eg. two disks with target=0, lun=[0,1] can be enumerated as /dev/sda or /dev/sdb randomly). Dealing with that will require some very complex device name translation on the
2017 Jul 14
0
[PATCH 05/27] daemon: Reimplement several devsparts APIs in OCaml.
...;, device) == -1) { - reply_with_perror ("asprintf"); - return -1; - } - - if (add_string_nodup (r, dev_path) == -1) - return -1; - - return 0; -} - -char ** -do_list_devices (void) -{ - /* For backwards compatibility, don't return MD devices in the list - * returned by guestfs_list_devices. This is because most API users - * expect that this list is effectively the same as the list of - * devices added by guestfs_add_drive. - * - * Also, MD devices are special devices - unlike the devices exposed - * by QEMU, and there is a special API for them, - * guestfs_list_md_devic...
2016 Feb 04
2
[PATCH v2 1/2] daemon: glob: add optarg to control trailing slash for dirs
...controls whether use the C<GLOB_MARK> flag for +L<glob(3)>, and it defaults to true. It can be explicitly set as +off to return no trailing slashes in filenames of directories. + Notice that there is no equivalent command for expanding a device name (eg. F</dev/sd*>). Use C<guestfs_list_devices>, C<guestfs_list_partitions> etc functions instead." }; diff --git a/gobject/Makefile.inc b/gobject/Makefile.inc index 3522eb2..5ba0fc9 100644 --- a/gobject/Makefile.inc +++ b/gobject/Makefile.inc @@ -68,6 +68,7 @@ guestfs_gobject_headers= \ include/guestfs-gobject/optargs-disk_cr...
2012 Jan 31
2
[PATCH 1/2] examples: code cleanups
do a code cleanup by removing the tailing spaces Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com> --- examples/create_disk.c | 2 +- examples/inspect_vm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/create_disk.c b/examples/create_disk.c index f4b9044..bcad6d8 100644 --- a/examples/create_disk.c +++ b/examples/create_disk.c @@ -7,7 +7,7
2013 Feb 07
2
[PATCH 1/2] Fix bogus partition number passed to guestfs___check_for_filesystem_on
Partition number was being passed to guestfs___check_for_filesystem_on based on an index in list_partition. However, this ignores the possibility of multiple block devices. This change makes guestfs___check_for_filesystem_on examine the passed-in device directly to determine if it is a whole device, or what its partition number is. --- src/guestfs-internal.h | 2 +- src/inspect-fs.c | 45
2012 Jul 16
2
[PATCH V4] NEW API: add new api xfs_info
...out); + if (lines) + free_strings (lines); + return ret; +} diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index c83bf70..dd9ea03 100644 --- a/generator/generator_actions.ml +++ b/generator/generator_actions.ml @@ -8995,6 +8995,14 @@ be returned if you called C<guestfs_list_devices>. To find out the maximum number of devices that could be added, call C<guestfs_max_disks>." }; + { defaults with + name = "xfs_info"; + style = RStruct ("info", "xfsinfo"), [Pathname "path"], []; + proc_nr = Some 337; + shortde...
2012 Dec 13
2
[PATCH 1/2] daemon: NFC Use symbolic names in commandrvf
...void); # define O_CLOEXEC 0 #endif +/* For improved readability dealing with pipe arrays */ +#define PIPE_READ 0 +#define PIPE_WRITE 1 + /* If root device is an ext2 filesystem, this is the major and minor. * This is so we can ignore this device from the point of view of the * user, eg. in guestfs_list_devices and many other places. @@ -834,22 +838,22 @@ commandrvf (char **stdoutput, char **stderror, int flags, signal (SIGPIPE, SIG_DFL); close (0); if (flag_copy_stdin) { - dup2 (stdin_fd[0], 0); - close (stdin_fd[0]); - close (stdin_fd[1]); + dup2 (stdin_fd[PIPE_READ],...
2017 Apr 20
1
[PATCH] tests: Replace test-max-disks with several tests.
...RMAT, "raw", + GUESTFS_ADD_DRIVE_OPTS_CACHEMODE, "unsafe", + -1) == -1) + exit (EXIT_FAILURE); + } + + if (guestfs_launch (g) == -1) + exit (EXIT_FAILURE); + + /* Check the disks were added. */ + devices = guestfs_list_devices (g); + n = guestfs_int_count_strings (devices); + if (n != ndisks) { + fprintf (stderr, "%s: incorrect number of devices returned by guestfs_list_devices:\n", + getprogname ()); + fprintf (stderr, "counted %zu, expecting %zu\n", n, ndisks); + fprintf (stde...
2015 May 05
3
libguestfs init problem
Hi ,all : thanks for helping me ! I am using libguestfs-1.28.1 on ubuntu 12.04 to manage vm disk created by KVM. I downloaded libguestfs-1.28.1.tar.gz ,and then executed (1) ./autogen.sh (2) ./configure (3) make (4) make check .there is the error. /usr/Libvmi/libguestfs-1.28.1/run --test guest-aux/make-fedora-img.pl md_create: feature 'mdadm' is not available in this
2012 Oct 08
3
[PATCH v3 0/3] Add support for disk labels and hotplugging.
This is, I guess, version 3 of this patch series which adds disk labels and hotplugging (only hot-add implemented so far). The good news is .. it works! Rich.