tests: fstrim: Sync before running fstrim.

This makes fstrim work.  It's not clear why exactly.

Thanks: Paolo Bonzini.
This commit is contained in:
Richard W.M. Jones
2014-03-14 13:14:24 +00:00
parent 55730f6118
commit d46ceea601

View File

@@ -50,6 +50,11 @@ do_fstrim (const char *path,
CLEANUP_FREE char *out = NULL, *err = NULL;
int r;
/* Suggested by Paolo Bonzini to fix fstrim problem.
* https://lists.gnu.org/archive/html/qemu-devel/2014-03/msg02978.html
*/
sync_disks ();
ADD_ARG (argv, i, str_fstrim);
if ((optargs_bitmask & GUESTFS_FSTRIM_OFFSET_BITMASK)) {