summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-07-03 14:36:45 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-07-06 17:36:30 +0100
commit352219c718c0705661e48f1fd3809ed47cde1555 (patch)
tree1e7ce97e039655a5daa715ce21a655bc21d1b3b1
parentd089d67ca383e2ec4e63e6ee1af72a8e3274d58a (diff)
downloadlibguestfs-352219c718c0705661e48f1fd3809ed47cde1555.tar.gz
libguestfs-352219c718c0705661e48f1fd3809ed47cde1555.tar.xz
libguestfs-352219c718c0705661e48f1fd3809ed47cde1555.zip
examples: In create_disk example, don't call set_autosync.
This is now set by default in all supported versions of libguestfs. It's just confusing if the examples refer to it. (cherry picked from commit 917550a117904ec1a06b77a7870a147014d71adb)
-rwxr-xr-xerlang/examples/create_disk.erl8
-rw-r--r--examples/create_disk.c9
-rw-r--r--java/examples/CreateDisk.java8
-rw-r--r--ocaml/examples/create_disk.ml11
-rwxr-xr-xperl/examples/create_disk.pl7
-rw-r--r--python/examples/create_disk.py7
-rw-r--r--ruby/examples/create_disk.rb7
7 files changed, 1 insertions, 56 deletions
diff --git a/erlang/examples/create_disk.erl b/erlang/examples/create_disk.erl
index 231c3989..a0c90444 100755
--- a/erlang/examples/create_disk.erl
+++ b/erlang/examples/create_disk.erl
@@ -16,10 +16,6 @@ main(_) ->
% Set the trace flag so that we can see each libguestfs call.
ok = guestfs:set_trace(G, true),
- % Set the autosync flag so that the disk will be synchronized
- % automatically when the libguestfs handle is closed.
- ok = guestfs:set_autosync(G, true),
-
% Attach the disk image to libguestfs.
ok = guestfs:add_drive_opts(G, Output,
[{format, "raw"}, {readonly, false}]),
@@ -55,10 +51,6 @@ main(_) ->
% the disk image.
ok = guestfs:upload(G, "/etc/resolv.conf", "/foo/resolv.conf"),
- % Because 'autosync' was set (above) we can just close the handle
- % and the disk contents will be synchronized. You can also do
- % this manually by calling guestfs:umount_all and guestfs:sync.
- %
% Note also that handles are automatically closed if they are
% reaped by the garbage collector. You only need to call close
% if you want to close the handle right away.
diff --git a/examples/create_disk.c b/examples/create_disk.c
index bcad6d85..5380888b 100644
--- a/examples/create_disk.c
+++ b/examples/create_disk.c
@@ -37,11 +37,6 @@ main (int argc, char *argv[])
/* Set the trace flag so that we can see each libguestfs call. */
guestfs_set_trace (g, 1);
- /* Set the autosync flag so that the disk will be synchronized
- * automatically when the libguestfs handle is closed.
- */
- guestfs_set_autosync (g, 1);
-
/* Add the disk image to libguestfs. */
if (guestfs_add_drive_opts (g, "disk.img",
GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", /* raw format */
@@ -104,10 +99,6 @@ main (int argc, char *argv[])
if (guestfs_upload (g, "/etc/resolv.conf", "/foo/resolv.conf") == -1)
exit (EXIT_FAILURE);
- /* Because 'autosync' was set (above) we can just close the handle
- * and the disk contents will be synchronized. You can also do
- * this manually by calling guestfs_umount_all and guestfs_sync.
- */
guestfs_close (g);
/* Free up the lists. */
diff --git a/java/examples/CreateDisk.java b/java/examples/CreateDisk.java
index 4742b5a1..41f8739b 100644
--- a/java/examples/CreateDisk.java
+++ b/java/examples/CreateDisk.java
@@ -22,10 +22,6 @@ public class CreateDisk
// Set the trace flag so that we can see each libguestfs call.
g.set_trace (true);
- // Set the autosync flag so that the disk will be synchronized
- // automatically when the libguestfs handle is closed.
- g.set_autosync (true);
-
// Attach the disk image to libguestfs.
Map<String, Object> optargs = new HashMap<String, Object>() {
{
@@ -70,10 +66,6 @@ public class CreateDisk
// the disk image.
g.upload ("/etc/resolv.conf", "/foo/resolv.conf");
- // Because 'autosync' was set (above) we can just close the handle
- // and the disk contents will be synchronized. You can also do
- // this manually by calling g#umount_all and g#sync.
- //
// Note also that handles are automatically closed if they are
// reaped by the garbage collector. You only need to call close
// if you want to close the handle right away.
diff --git a/ocaml/examples/create_disk.ml b/ocaml/examples/create_disk.ml
index 0f9f9418..75dbdc35 100644
--- a/ocaml/examples/create_disk.ml
+++ b/ocaml/examples/create_disk.ml
@@ -16,11 +16,6 @@ let () =
(* Set the trace flag so that we can see each libguestfs call. *)
g#set_trace true;
- (* Set the autosync flag so that the disk will be synchronized
- * automatically when the libguestfs handle is closed.
- *)
- g#set_autosync true;
-
(* Attach the disk image to libguestfs. *)
g#add_drive_opts ~format:"raw" ~readonly:false output;
@@ -62,11 +57,7 @@ let () =
*)
g#upload "/etc/resolv.conf" "/foo/resolv.conf";
- (* Because 'autosync' was set (above) we can just close the handle
- * and the disk contents will be synchronized. You can also do
- * this manually by calling g#umount_all and g#sync.
- *
- * Note also that handles are automatically closed if they are
+ (* Note also that handles are automatically closed if they are
* reaped by the garbage collector. You only need to call close
* if you want to close the handle right away.
*)
diff --git a/perl/examples/create_disk.pl b/perl/examples/create_disk.pl
index 5a81663f..49538a5f 100755
--- a/perl/examples/create_disk.pl
+++ b/perl/examples/create_disk.pl
@@ -17,10 +17,6 @@ close FILE or die "$output: $!";
# Set the trace flag so that we can see each libguestfs call.
$g->set_trace (1);
-# Set the autosync flag so that the disk will be synchronized
-# automatically when the libguestfs handle is closed.
-$g->set_autosync (1);
-
# Attach the disk image to libguestfs.
$g->add_drive_opts ($output, format => "raw", readonly => 0);
@@ -61,7 +57,4 @@ $g->mkdir ("/foo");
# the disk image.
$g->upload ("/etc/resolv.conf", "/foo/resolv.conf");
-# Because 'autosync' was set (above) we can just exit here
-# and the disk contents will be synchronized. You can also do
-# this manually by calling $g->umount_all and $g->sync.
exit 0
diff --git a/python/examples/create_disk.py b/python/examples/create_disk.py
index c80fc6d9..bf47c916 100644
--- a/python/examples/create_disk.py
+++ b/python/examples/create_disk.py
@@ -15,10 +15,6 @@ f.close ()
# Set the trace flag so that we can see each libguestfs call.
g.set_trace (1)
-# Set the autosync flag so that the disk will be synchronized
-# automatically when the libguestfs handle is closed.
-g.set_autosync (1)
-
# Attach the disk image to libguestfs.
g.add_drive_opts (output, format = "raw", readonly = 0)
@@ -55,7 +51,4 @@ g.mkdir ("/foo")
# the disk image.
g.upload ("/etc/resolv.conf", "/foo/resolv.conf")
-# Because 'autosync' was set (above) we can just close the handle
-# and the disk contents will be synchronized. You can also do
-# this manually by calling g.umount_all and g.sync.
g.close ()
diff --git a/ruby/examples/create_disk.rb b/ruby/examples/create_disk.rb
index 16871cb6..4e42cf6a 100644
--- a/ruby/examples/create_disk.rb
+++ b/ruby/examples/create_disk.rb
@@ -14,10 +14,6 @@ File.open(output, "w") {
# Set the trace flag so that we can see each libguestfs call.
g.set_trace(1)
-# Set the autosync flag so that the disk will be synchronized
-# automatically when the libguestfs handle is closed.
-g.set_autosync(1)
-
# Attach the disk image to libguestfs.
g.add_drive_opts(output, :format => "raw")
@@ -58,7 +54,4 @@ g.mkdir("/foo")
# the disk image.
g.upload("/etc/resolv.conf", "/foo/resolv.conf")
-# Because 'autosync' was set (above) we can just close the handle
-# and the disk contents will be synchronized. You can also do
-# this manually by calling g#umount_all and g#sync.
g.close()