Displaying 20 results from an estimated 33 matches for "guestfs_mount_ro".
2010 Feb 09
1
[PATCH] Use mount-options instead of mount to avoid implicit -o sync.
...--git a/fish/fish.c b/fish/fish.c
index dd73af7..bc518da 100644
--- a/fish/fish.c
+++ b/fish/fish.c
@@ -474,10 +474,13 @@ mount_mps (struct mp *mp)
if (mp) {
mount_mps (mp->next);
- if (!read_only)
- r = guestfs_mount (g, mp->device, mp->mountpoint);
- else
- r = guestfs_mount_ro (g, mp->device, mp->mountpoint);
+
+ /* Don't use guestfs_mount here because that will default to mount
+ * options -o sync,noatime. For more information, see guestfs(3)
+ * section "LIBGUESTFS GOTCHAS".
+ */
+ const char *options = !read_only ? "" :...
2020 Feb 26
1
[PATCH] filesystems: fix size reporting for filesystems
...er (g);
if (!device || !subvolume) {
- size = guestfs_blockdev_getsize64 (g, fses[i]);
+ /* Try mounting and stating the device. This might reasonably
+ * fail, so don't show errors.
+ */
+ guestfs_push_error_handler (g, NULL, NULL);
+
+ if (guestfs_mount_ro (g, fses[i], "/") == 0) {
+ CLEANUP_FREE_STATVFS struct guestfs_statvfs *stat = NULL;
+
+ stat = guestfs_statvfs (g, "/");
+ size = stat->blocks * stat->bsize;
+ guestfs_umount_all (g);
+ } else {
+ size = guestfs_blockde...
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.
2011 Oct 13
9
[PATCH 1/9] Partially fix --disable-erlang
From: Michael Scherer <misc at zarb.org>
Without this, configure will always enable erlang, no matter what
argument are passed. Now, we can disable it, even if configure still
need the erlang compiler for some obscure reason.
---
configure.ac | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index 337a3ed..e0bed2f 100644
---
2016 Dec 06
3
[PATCH 1/2] inspect: fstab: Canonicalize paths appearing in fstab.
For example, converts "///usr//local//" -> "/usr/local".
---
src/inspect-fs-unix.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c
index a1a757c..0fea9c8 100644
--- a/src/inspect-fs-unix.c
+++ b/src/inspect-fs-unix.c
@@ -89,6 +89,7 @@ static char *resolve_fstab_device
2019 Jan 21
0
[PATCH nbdkit v2 3/4] tests: Implement a better nbdkit-partition-filter test.
..._SERVER, server,
- -1);
- if (r == -1)
- exit (EXIT_FAILURE);
-
- if (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 /...
2019 Jan 22
0
[PATCH nbdkit v3 2/5] tests: Implement a better nbdkit-partition-filter test.
..._SERVER, server,
- -1);
- if (r == -1)
- exit (EXIT_FAILURE);
-
- if (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 /...
2012 Mar 09
1
[PATCH 1/2] Close all file descriptors in the recovery process.
From: "Richard W.M. Jones" <rjones at redhat.com>
If the parent process uses a pipe (or any fd, but pipes are a
particular problem), then the recovery process would hold open the
file descriptor(s) of the pipe, meaning that it could not be fully
closed in the parent. Because the recovery process doesn't use
exec(2), this wasn't avoidable even using FD_CLOEXEC.
Avoid this
2010 Aug 02
5
[PATCH v3 0/5] Inspection code in C
The first three patches were posted previously:
https://www.redhat.com/archives/libguestfs/2010-July/msg00082.html
The last two patches in this series change guestfish -i to use
this new code.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to
2010 Jul 29
4
[PATCH 0/3] Inspection code in C
These three patches (two were previously posted) can do simple
operating system inspection in C.
Example of use:
><fs> add-ro rhel55.img
><fs> run
><fs> inspect-os
/dev/VolGroup00/LogVol00
><fs> inspect-get-type /dev/VolGroup00/LogVol00
linux
><fs> inspect-get-distro /dev/VolGroup00/LogVol00
rhel
><fs> inspect-get-arch
2013 Jan 24
2
[PATCH 1/2] lib: Add CLEANUP_FREE macro which automatically calls 'free' when leaving scope.
From: "Richard W.M. Jones" <rjones@redhat.com>
Use the macro like this to create temporary variables which are
automatically cleaned up when the scope is exited:
{
CLEANUP_FREE (char *, foo, strdup (bar)); /* char *foo = strdup (bar) */
...
// no need to call free (foo)!
}
On GCC and LLVM, this is implemented using __attribute__((cleanup(...))).
On other
2010 Aug 17
8
[PATCH v4 0/8] Inspection code in C
Previously discussed here:
https://www.redhat.com/archives/libguestfs/2010-August/msg00002.html
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/
2012 Aug 06
1
[PATCH V2] virt-diff: add new virt-diff tool
...t, so that we end up
+ * mounting the filesystems in the correct order.
+ */
+ qsort (mountpoints, count_strings (mountpoints) / 2, 2 * sizeof (char *),
+ compare_keys_len);
+
+ size_t i;
+ size_t mount_errors = 0;
+ for (i = 0; mountpoints[i] != NULL; i += 2) {
+ int r;
+ r = guestfs_mount_ro (g, mountpoints[i+1], mountpoints[i]);
+ if (r == -1) {
+ /* If the "/" filesystem could not be mounted, give up, else
+ * just count the errors and print a warning.
+ */
+ if (STREQ (mountpoints[i], "/"))
+ exit (EXIT_FAILURE);
+ mount_error...
2020 Feb 20
0
buffer overflow detected in collectd using libguestfs
...amp;
j > 2 && /* so next line is valid*/
strcmp(fses[j-1], "iso9660") == 0) )
{
/* the code below is not executed for the sake of test */
/* the code below is not executed for the sake of test */
if ( 0 && (guestfs_mount_ro (g, (const char *) fses[j], "/") ==
0)) {
fs_stats = guestfs_statvfs(g, "/");
if(fs_stats == NULL) {
ERROR(PLUGIN_NAME " plugin: Failed guestfs_statvfs for
filesystem %s", fses[i]);
continue; //exit(EXIT_FAILURE);...
2009 Nov 20
1
fix new failures from latest-from-gnulib syntax-check
...pen (file, O_RDONLY) == -1) {
perror (file);
- exit (1);
+ exit (EXIT_FAILURE);
}
}
@@ -441,7 +441,7 @@ main (int argc, char *argv[])
cleanup_readline ();
- exit (0);
+ exit (EXIT_SUCCESS);
}
void
@@ -475,7 +475,7 @@ mount_mps (struct mp *mp)
else
r = guestfs_mount_ro (g, mp->device, mp->mountpoint);
if (r == -1)
- exit (1);
+ exit (EXIT_FAILURE);
}
}
@@ -491,7 +491,7 @@ add_drives (struct drv *drv)
else
r = guestfs_add_drive_ro (g, drv->filename);
if (r == -1)
- exit (1);
+ exit (EXIT_FAILURE);
}
}
@@...
2014 Jun 27
3
[PATCH WIP] Can't generate argv variant
Hi everyone,
lately I've been getting familiar with library and working on slight
re-layering of the library. It's about having locking layer in public API and
tracing one layer below that (let's call it __t_ layer. I'm not very good at
making up names, so this is temporary:) ). Then making sure that all generated
public stuff call __t_ layer and all other internal stuff
2013 Feb 12
7
Remaining btrfs patches
[PATCH 1/7] mount: Add mount_vfs_nochroot
This is significantly reworked from before. umount is gone as
discussed, and variable motion is minimised.
[PATCH 2/7] btrfs: Update btrfs_subvolume_list to take
Already provisionally ACKed. Previous comment was that cleanup could
be tidier. I looked into creating a new cleanup function for fs_buf,
but it isn't possible (or simple, anyway) in this
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.
2014 Aug 28
14
[PATCH 00/13] code refactorings for tools
Hi,
this series does a couple of code reorganizations/refactoring in code
used by tools: the windows path handling code, and the two types of
file editing (using editor, and using perl expression).
There's still a code duplication between the two variants of file
editing, but it is just within a single source, and can be easily
solved now (planning as next step).
Pino Toscano (13):
edit:
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.