search for: guestfs_add_drive

Displaying 20 results from an estimated 102 matches for "guestfs_add_drive".

2012 Aug 20
2
Options for hotplugging
libguestfs recently added support for virtio-scsi and libvirt, and when these are both available this lets us relatively easily add hotplugging of drives. This email is about how we would present that through the libguestfs API. (a) The current API Currently you have to add drive(s) via guestfs_add_drive* and then call guestfs_launch, ie. your program must look something like this: guestfs_h *g = guestfs_create (); guestfs_add_drive (g, "/tmp/disk1.img"); guestfs_add_drive (g, "/tmp/disk2.img"); guestfs_launch (g); After guestfs_launch [the qemu backend is running] you...
2014 Mar 18
2
[PATCH 1/2] php: make the test suite failures fatal
So far the failure of some test would have not reported a non-zero return value by run-tests.php. Since now all the PHP tests pass, we can ask for failures to be fatal, by exporting REPORT_EXIT_STATUS=1 for run-tests.php. --- php/run-php-tests.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/php/run-php-tests.sh b/php/run-php-tests.sh index 6f9ae10..e498987 100755 ---
2016 Feb 12
0
[PATCH] php: restructure and expand tests
...index 0000000..e268e98 --- /dev/null +++ b/php/extension/tests/guestfs_070_optargs.phpt @@ -0,0 +1,29 @@ +--TEST-- +Check function with optional arguments. +--FILE-- +<?php +$g = guestfs_create (); +if ($g == false) { + echo ("Failed to create guestfs_php handle.\n"); + exit; +} +if (guestfs_add_drive ($g, "/dev/null") == false) { + echo ("Failed add_drive, no optional arguments: " . guestfs_last_error ($g) . "\n"); + exit; +} +if (guestfs_add_drive ($g, "/dev/null", 0) == false) { + echo ("Failed add_drive, one optional argument: " . guestfs_...
2020 Mar 13
0
Re: Use libguestfs with SAS URI of a disk image
...h has shared access > token/secret on the URL. > > The URL likes like this: > 'https://<account>.blob.core.windows.net/<container>/<VMDiskImage>?sv=2017-04-17&sr=b&si=<guid>&sig=<secret>' > I try to use this API: > > int > guestfs_add_drive_opts (guestfs_h *g, > const char *filename, > ...); > > > My code looks like this: > char const *servers[] = { (char const *)"<account>.blob.core.windows.net", NULL }; > int addDriveRet = guestfs_add_drive_opt...
2012 Oct 10
0
NOTE: Relaunching handles (don't do it!)
It's possible through the API to do a sequence of calls like this: g = guestfs_create (); guestfs_add_drive (g, "foo"); guestfs_launch (g); guestfs_shutdown (g); guestfs_launch (g); # relaunch the handle The question is, what should be the state of the handle at the second launch? Would the verbose flag still be set if it had been set earlier? (I think fairly obviously yes). Would d...
2009 Nov 20
1
fix new failures from latest-from-gnulib syntax-check
...int argc, char *argv[]) if (argc != 3 || access (argv[1], F_OK) != 0) { fprintf (stderr, "Usage: hello disk-image partition\n"); - exit (1); + exit (EXIT_FAILURE); } - if (!(g = guestfs_create ())) exit (1); + if (!(g = guestfs_create ())) exit (EXIT_FAILURE); - if (guestfs_add_drive (g, argv[1]) == -1) exit (1); + if (guestfs_add_drive (g, argv[1]) == -1) exit (EXIT_FAILURE); - if (guestfs_launch (g) == -1) exit (1); + if (guestfs_launch (g) == -1) exit (EXIT_FAILURE); - if (guestfs_mount (g, argv[2], "/") == -1) exit (1); + if (guestfs_mount (g, argv[2], &quo...
2013 Jan 24
0
Libguestfs with Perl 6 :-)
...that it is a thing of beauty ! Here is the libguestfs hello world example in Perl6 $ dd if=/dev/zero of=guest.img bs=1M count=100 $ mke2fs guest.img $ cat guestfs.p6 use NativeCall; say "Defining stubs"; sub guestfs_create() returns OpaquePointer is native('libguestfs') {} sub guestfs_add_drive(OpaquePointer $handle, Str $path) returns Int is native('libguestfs') {} sub guestfs_launch(OpaquePointer $handle) returns Int is native('libguestfs') {} sub guestfs_mount(OpaquePointer $handle, Str $path, Str $target) returns Int is native('libguestfs') {} sub guestfs_touch...
2016 Feb 27
3
Re: [PATCH] added ntfscat_i api
...amd64 tool to administer Linux MD arrays (software RAID) > > Assuming it is installed, what is the output of: > > rm -rf tmp/.guestfs-* > ./run guestfish run : supported > > ? That precise command fails with the following message: libguestfs: error: you must call guestfs_add_drive before guestfs_launch If I feed a disk image I get it to work and returns: acl yes augeas yes blkdiscard yes blkdiscardzeroes yes btrfs no extlinux no fstrim yes gdisk yes grub no hivex yes...
2009 Aug 12
2
[PATCH] Don't use cache=off if device is on tmpfs
[For a bug noted earlier by both Matt Booth and Jim Meyering] If you use the guestfs_add_drive function, then currently it generates a qemu command line element like: -drive ...,cache=off,... This causes qemu to try to open the device with O_DIRECT. Unfortunately some filesystems don't support this flag, notably tmpfs, which means you can't use libguestfs in conjunction with tmpf...
2019 Apr 01
2
Re: guestfish Remote Images IPv6 Support
...and: run: \ /tmp/libguestfs3pGMi6/overlay1.qcow2 >> qemu-img: /tmp/libguestfs3pGMi6/overlay1.qcow2: invalid conf option >> :cefc:1]:6789:auth_supported: No such file or directory >> Could not open backing image to determine size. > The code in libguestfs is supposed to turn the guestfs_add_drive > ‘servers’ parameter into a Ceph URL for qemu: > > https://github.com/libguestfs/libguestfs/blob/f79129b8dc92470e3a5597daf53c84038bd6859e/lib/qemu.c#L905 > > and I suppose this is being done wrong somehow (I don't have a Ceph > server to test). > > At a guess I would...
2018 Apr 06
2
Re: [nbdkit PATCH] tests: Skip guestfs tests on CentOS 6
On 04/06/2018 04:26 AM, Richard W.M. Jones wrote: > On Thu, Apr 05, 2018 at 03:03:41PM -0500, Eric Blake wrote: >> CentOS 6 has libguestfs-devel 1.20.11, which predates the support >> in guestfs_add_drive_opts() for requesting an nbd drive instead >> of a local file. The guestfs plugin can still be built, so no >> configure changes are needed; but skip the tests that fail to >> compile so that 'make check' can at least complete. >> >> Signed-off-by: Eric Blake...
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 +++
2015 Oct 13
2
[PATCH v2 4/4] v2v: reuse main guestfs for virtio win drivers iso
If we're given an ISO image as the source of virtio windows drivers, and the backend supports hot-adding drives, reuse the same guestfs handle that is open for accessing the guest being inspected, rather than creating a new one (which would run another virtual machine instance and is fairly resource-intensive). Signed-off-by: Roman Kagan <rkagan@virtuozzo.com> --- changes since v1: -
2019 Mar 29
2
guestfish Remote Images IPv6 Support
I have scoured the web and can't find anything on the topic: Is IPv6 supported for remote image targets? For example: guestfish --format=raw --ro -a rbd://[fd00::cefc:1]:6789/images/CentOS-7-x86_64-GenericCloud-1901 Does not work citing the following: libguestfs: trace: set_verbose true libguestfs: trace: set_verbose = 0 libguestfs: create: flags = 0, handle = 0x5560231bdfb0, program =
2015 Jun 29
0
Re: URI Handling Patch
.... > The question I asked in the previous e-mail, which still needs to be > answered no matter what scheme is ultimately chosen, is this: > > Under what circumstances should the query string be appended to the path? If there are two separate parameters (path, optional query string) to guestfs_add_drive then I hope it's clear when - you'd append the query string when the query string is passed by the caller. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usag...
2015 Oct 13
0
Re: [PATCH v2 4/4] v2v: reuse main guestfs for virtio win drivers iso
...ed, rather than > creating a new one (which would run another virtual machine instance and > is fairly resource-intensive). I really don't like this specific patch. Hotplugging is not very reliable in my experience. The patch tries to work out if hotplugging is going to work by calling guestfs_add_drive and taking an alternate path, but I'm not so convinced that would work on other architectures (eg. hotplugging on aarch64 is in various states between not working at all and flaky). Are you observing any benefit with this patch? v2v conversion takes a long time - I can't believe the extra...
2016 Feb 27
0
Re: [PATCH] added ntfscat_i api
...ys (software RAID) > > > >Assuming it is installed, what is the output of: > > > > rm -rf tmp/.guestfs-* > > ./run guestfish run : supported > > > >? > That precise command fails with the following message: > > libguestfs: error: you must call guestfs_add_drive before guestfs_launch Ah right, that's because the default backend is 'direct', but on my machine I have it set to 'libvirt', which supports hotplugging and thus doesn't require you to specify any drives. > mdadm no OK this is strange, and wrong. Can you tr...
2017 Jan 19
0
[PATCH 2/2] daemon: Return MD partitions in guestfs_list_partitions (RHBZ#1414510).
...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) char ** do_list_partitions (void) { - return foreach_block_device (add_partitions); + return foreach_block_device (add_partitions, true);...
2018 Apr 06
0
Re: [nbdkit PATCH] tests: Skip guestfs tests on CentOS 6
On Fri, Apr 06, 2018 at 09:02:01AM -0500, Eric Blake wrote: > On 04/06/2018 04:26 AM, Richard W.M. Jones wrote: > > On Thu, Apr 05, 2018 at 03:03:41PM -0500, Eric Blake wrote: > >> CentOS 6 has libguestfs-devel 1.20.11, which predates the support > >> in guestfs_add_drive_opts() for requesting an nbd drive instead > >> of a local file. The guestfs plugin can still be built, so no > >> configure changes are needed; but skip the tests that fail to > >> compile so that 'make check' can at least complete. > >> > >> S...
2019 Mar 30
0
Re: guestfish Remote Images IPv6 Support
...libguestfs: command: run: \ /tmp/libguestfs3pGMi6/overlay1.qcow2 > qemu-img: /tmp/libguestfs3pGMi6/overlay1.qcow2: invalid conf option > :cefc:1]:6789:auth_supported: No such file or directory > Could not open backing image to determine size. The code in libguestfs is supposed to turn the guestfs_add_drive ‘servers’ parameter into a Ceph URL for qemu: https://github.com/libguestfs/libguestfs/blob/f79129b8dc92470e3a5597daf53c84038bd6859e/lib/qemu.c#L905 and I suppose this is being done wrong somehow (I don't have a Ceph server to test). At a guess I would say that it seems as if ':' c...