[Pkg-libvirt-commits] [libguestfs] 11/59: daemon: fstrim: Fix fstrim so it trims the correct filesystem.

Hilko Bengen bengen at moszumanska.debian.org
Thu Mar 20 23:05:34 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch experimental
in repository libguestfs.

commit 5e105e06be4cc6c88b5d3fc5cf79acb48947e197
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Wed Mar 12 13:41:39 2014 +0000

    daemon: fstrim: Fix fstrim so it trims the correct filesystem.
    
    We didn't call sysroot_path, so it was trimming the appliance instead
    of the guest filesystem.
---
 daemon/fstrim.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/daemon/fstrim.c b/daemon/fstrim.c
index bf9dad8..2aad155 100644
--- a/daemon/fstrim.c
+++ b/daemon/fstrim.c
@@ -46,6 +46,7 @@ do_fstrim (const char *path,
   const char *argv[MAX_ARGS];
   size_t i = 0;
   char offset_s[64], length_s[64], mfe_s[64];
+  CLEANUP_FREE char *buf = NULL;
   CLEANUP_FREE char *out = NULL, *err = NULL;
   int r;
 
@@ -88,7 +89,13 @@ do_fstrim (const char *path,
   if (verbose)
     ADD_ARG (argv, i, "-v");
 
-  ADD_ARG (argv, i, path);
+  buf = sysroot_path (path);
+  if (!buf) {
+    reply_with_error ("malloc");
+    return -1;
+  }
+
+  ADD_ARG (argv, i, buf);
   ADD_ARG (argv, i, NULL);
 
   r = commandv (&out, &err, argv);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list