From f48cd1f262312ad278a293a20ab442dcfc076a69 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 25 Oct 2010 13:22:17 +0100 Subject: [PATCH] Enable autosync by default. --- TODO | 1 - fish/fish.c | 2 -- fuse/guestmount.c | 1 - generator/generator_actions.ml | 6 +++--- src/guestfs.c | 1 + src/guestfs.pod | 3 +++ 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/TODO b/TODO index e9716f2..6ab6dc6 100644 --- a/TODO +++ b/TODO @@ -181,7 +181,6 @@ To mount read-only, add C 1> like this: which is equivalent to the following sequence of calls: $h = Sys::Guestfs->new (); - $h->set_autosync (1); $h->add_drive_ro ($filename); $h->launch (); $h->mount_ro (\"/dev/sda1\", \"/\"); diff --git a/fish/fish.c b/fish/fish.c index 7cb2e71..8da4ffd 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -230,8 +230,6 @@ main (int argc, char *argv[]) exit (EXIT_FAILURE); } - guestfs_set_autosync (g, 1); - /* If developing, add ./appliance to the path. Note that libtools * interferes with this because uninstalled guestfish is a shell * script that runs the real program with an absolute path. Detect diff --git a/fuse/guestmount.c b/fuse/guestmount.c index 9665059..d17982a 100644 --- a/fuse/guestmount.c +++ b/fuse/guestmount.c @@ -982,7 +982,6 @@ main (int argc, char *argv[]) exit (EXIT_FAILURE); } - guestfs_set_autosync (g, 1); guestfs_set_recovery_proc (g, 0); ADD_FUSE_ARG (program_name); diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index 38f1db3..8add55f 100644 --- a/generator/generator_actions.ml +++ b/generator/generator_actions.ml @@ -286,11 +286,11 @@ best effort attempt to run C followed by C when the handle is closed (also if the program exits without closing handles). -This is disabled by default (except in guestfish where it is -enabled by default)."); +This is enabled by default (since libguestfs 1.5.24, previously it was +disabled by default)."); ("get_autosync", (RBool "autosync", [], []), -1, [], - [InitNone, Always, TestRun ( + [InitNone, Always, TestOutputTrue ( [["get_autosync"]])], "get autosync mode", "\ diff --git a/src/guestfs.c b/src/guestfs.c index 325bdb0..df13d51 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -100,6 +100,7 @@ guestfs_create (void) g->error_cb_data = NULL; g->recovery_proc = 1; + g->autosync = 1; str = getenv ("LIBGUESTFS_DEBUG"); g->verbose = str != NULL && STREQ (str, "1"); diff --git a/src/guestfs.pod b/src/guestfs.pod index c1e595c..305aa38 100644 --- a/src/guestfs.pod +++ b/src/guestfs.pod @@ -701,6 +701,9 @@ Note that in L autosync is the default. So quick and dirty guestfish scripts that forget to sync will work just fine, which can make this very puzzling if you are trying to debug a problem. +Update: Autosync is enabled by default for all API users starting from +libguestfs 1.5.24. + =item Mount option C<-o sync> should not be the default. If you use L, then C<-o sync,noatime> are added -- 1.8.3.1