search for: guestfs_cat

Displaying 20 results from an estimated 27 matches for "guestfs_cat".

2015 Feb 07
4
getting guestfs_rsync_out to work
.../using-rsync-with-libguestfs/ We are trying to get the libguestfs API guestfs_rsync_out to work. We’ve tried combinations similar to: guestfs_rsync_out(g, “/HostShared”, “rsync://root@10.0.1.90:2999/backup/ -av”, -1) surrounding it with APIs as in the recipe examples, for example replacing libguestfs_cat(), with no luck. In the above example the "backup" rsync module name matches the script on Richard's wordpress.com blog page (above link). Typically in the rsync daemon log we see something like: receiving file list sent 17 bytes received 24 bytes total size 0 but no data is tr...
2015 Feb 09
2
Re: getting guestfs_rsync_out to work
...est and use a regular network backup. We don't need to use rsync. We know which files will change. For example even if we do this (error checking removed): while (1) { guestfs_mount_options(g, "sync", "/dev/sda2", "/"); printf("%s\n", guestfs_cat(g, "/HostShared/temp.txt")); guestfs_umount(g, "/"); guestfs_fsync(g); usleep(1000*1000); } temp.txt from the Win7 guest is copied correctly the first time, but afterwards any change we make to it (e.g. using Win7 Notepad) is never seen. That's the...
2015 Feb 08
1
Re: getting guestfs_rsync_out to work
...t the libguestfs API guestfs_rsync_out to work. We’ve tried combinations similar to: >>> >>> guestfs_rsync_out(g, “/HostShared”, “rsync://root@10.0.1.90:2999/backup/ -av”, -1) >>> >>> surrounding it with APIs as in the recipe examples, for example replacing libguestfs_cat(), with no luck. In the >>> above >>> example the "backup" rsync module name matches the script on Richard's wordpress.com blog page (above link). >>> Typically in the rsync daemon log we see something like: >>> >>> receiving file list &g...
2015 Feb 09
2
Re: getting guestfs_rsync_out to work
...use rsync. We know which files will change. For example even if we do this (error checking >> removed): >> >> while (1) { >> >> guestfs_mount_options(g, "sync", "/dev/sda2", "/"); >> >> printf("%s\n", guestfs_cat(g, "/HostShared/temp.txt")); >> >> guestfs_umount(g, "/"); >> >> guestfs_fsync(g); >> >> usleep(1000*1000); >> } >> >> temp.txt from the Win7 guest is copied correctly the first time, but >> afterwa...
2013 May 09
1
PATCH: Allow specifying the filesystem driver for guestmount
Currently guestfish has mount-vfs, and the libguestfs API has guestfs_mount_vfs(), but guestmount doesn't allow the user to specify a filesystem. This patch extends the --mount argument, so you can force an ext2 partition to mount as ext4: guestmount -a mydisk.img -m /dev/vda:/:defaults:ext4 mountpoint You could also use it to choose between ntfs and ntfs-3g, or between hfsplus and the
2015 Feb 08
0
Re: getting guestfs_rsync_out to work
...> > We are trying to get the libguestfs API guestfs_rsync_out to work. We’ve tried combinations similar to: > > guestfs_rsync_out(g, “/HostShared”, “rsync://root@10.0.1.90:2999/backup/ -av”, -1) > > surrounding it with APIs as in the recipe examples, for example replacing libguestfs_cat(), with no luck. In the above > example the "backup" rsync module name matches the script on Richard's wordpress.com blog page (above link). > Typically in the rsync daemon log we see something like: > > receiving file list > sent 17 bytes received 24 bytes total...
2015 Feb 09
1
Re: getting guestfs_rsync_out to work
...h just runs vmlinux > as a userspace process) you'll experience approximately the same > overhead. Ok got it. Thanks again for your reply. We tried guestfs_drop_caches() as follows: while(1) { guestfs_mount(g, "/dev/sda2", "/"); printf("%s\n", guestfs_cat(g, "/HostShared/temp.txt")); guestfs_umount(g, "/"); guestfs_drop_caches(g, 3); usleep(1000*1000); } and still we cannot see changes made to temp.txt (from inside the Win7 guest VM) while this loop continues to run on the host Linux. We still have to re-laun...
2015 Feb 09
0
Re: getting guestfs_rsync_out to work
...t; > We don't need to use rsync. We know which files will change. For example even if we do this (error checking removed): > > while (1) { > > guestfs_mount_options(g, "sync", "/dev/sda2", "/"); > > printf("%s\n", guestfs_cat(g, "/HostShared/temp.txt")); > > guestfs_umount(g, "/"); > > guestfs_fsync(g); > > usleep(1000*1000); > } > > temp.txt from the Win7 guest is copied correctly the first time, but > afterwards any change we make to it (e.g. us...
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 Feb 10
1
host Linux - guest Win7 fast file sharing [was: getting guestfs_rsync_out to work]
...kend (which just runs vmlinux as a userspace process) you'll experience approximately the same overhead. Ok got it. Thanks again for your reply. We tried guestfs_drop_caches() as follows: while(1) { guestfs_mount(g, "/dev/sda2", "/"); printf("%s\n", guestfs_cat(g, "/HostShared/temp.txt")); guestfs_umount(g, "/"); guestfs_drop_caches(g, 3); usleep(1000*1000); } and still we cannot see changes made to temp.txt (from inside the Win7 guest VM) while this loop continues to run on the host Linux. We still have to re-launch...
2019 Jan 21
0
[PATCH nbdkit v2 3/4] tests: Implement a better nbdkit-partition-filter test.
...(guestfs_launch (g) == -1) - exit (EXIT_FAILURE); - - /* Because we're using the partition filter, the device should - * appear to be a filesystem directly on a whole disk. - */ - if (guestfs_mount_ro (g, "/dev/sda", "/") == -1) - exit (EXIT_FAILURE); - - data = guestfs_cat (g, "/hello.txt"); - if (!data) - exit (EXIT_FAILURE); - - if (strcmp (data, "hello,world") != 0) { - fprintf (stderr, - "%s FAILED: unexpected content of /hello.txt file " - "(actual: %s, expected: \"hello,world\")\n&quot...
2019 Jan 22
0
[PATCH nbdkit v3 2/5] tests: Implement a better nbdkit-partition-filter test.
...(guestfs_launch (g) == -1) - exit (EXIT_FAILURE); - - /* Because we're using the partition filter, the device should - * appear to be a filesystem directly on a whole disk. - */ - if (guestfs_mount_ro (g, "/dev/sda", "/") == -1) - exit (EXIT_FAILURE); - - data = guestfs_cat (g, "/hello.txt"); - if (!data) - exit (EXIT_FAILURE); - - if (strcmp (data, "hello,world") != 0) { - fprintf (stderr, - "%s FAILED: unexpected content of /hello.txt file " - "(actual: %s, expected: \"hello,world\")\n&quot...
2018 Aug 20
1
[PATCH nbdkit] tests: Add a root only test of the file plugin with
In libguestfs we have a few tests that require root privileges and they are skipped by default (normally you should not build or test as root), but you can do this to run them: sudo make check-root In nbdkit I wanted to check that the file plugin works with block devices (this is not tested), and the only way I can sensibly think to do this is using a loopback device and root. This commit
2012 Dec 13
0
ANNOUNCE: libguestfs 1.20 - tools for accessing and modifying virtual machine disk images
...tthew Booth). Hivex (Windows Registry editing) is now directly supported through the API, making reading or editing the Windows Registry much more efficient. Several libguestfs APIs were reimplemented so they no longer have any limits on output. The reimplemented APIs are: guestfs_cat, guestfs_find, guestfs_read_file, guestfs_read_lines, guestfs_write, guestfs_write_append, guestfs_lstatlist, guestfs_lxattrlist, guestfs_readlinklist, guestfs_ls. virt tools guestfish touch 'win:c:\new_file' now works as expected. guestfish has a new --network opti...
2019 Apr 01
1
[PATCH nbdkit v2] Add readahead filter.
Simpler, and including tests. Rich.
2018 Jun 07
4
[PATCH nbdkit 0/4] plugins: Add new "ext2" plugin, for accessing ext2, ext3 or ext4 filesystems.
There is a small test provided. I tested this a lot more locally and it seems pretty robust. Rich.
2019 Jan 22
7
[PATCH nbdkit v3 0/5] partition filter: Support MBR logical partitions.
I think this addresses everything in Eric's v2 review. Note that the first patch is best viewed using ‘-w’ to ignore whitespaces changes. Rich.
2017 Apr 20
1
[PATCH] tests: Replace test-max-disks with several tests.
...LL, *actual = NULL; + + if (asprintf (&file, "/mp%zu/disk%zu", i, i) == -1) + error (EXIT_FAILURE, errno, "asprintf"); + if (asprintf (&expected, "This is disk %zu.", i) == -1) + error (EXIT_FAILURE, errno, "asprintf"); + + actual = guestfs_cat (g, file); + if (actual == NULL) + exit (EXIT_FAILURE); + + if (STRNEQ (expected, actual)) { + fprintf (stderr, + "%s: unexpected content in file %s: " + "expected \"%s\", actual \"%s\"\n", + getprogna...
2019 Jan 20
5
[PATCH nbdkit 0/4] partition: Support MBR logical partitions.
This implements support for MBR logical partitions in nbdkit-partition-filter, complementing existing support in the partitioning plugin. Rich.
2019 Jan 21
8
[PATCH nbdkit v2 0/4] Support MBR logical partitions.
This is a revised version of the two series previously posted here: https://www.redhat.com/archives/libguestfs/2019-January/msg00137.html https://www.redhat.com/archives/libguestfs/2019-January/msg00139.html There have been many smaller changes but the highlights are: - Using SECTOR_SIZE instead of hard-coding 512 everywhere. - Additional safety checks that the EBR chain doesn't jump