diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-07-03 13:22:45 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-07-06 17:36:30 +0100 |
commit | a659f2c316fa8a959a6286f214e50911253c5580 (patch) | |
tree | 13d0855bd80fa6e37ae18d719623ac48bdd644a2 /examples/copy_over.c | |
parent | 59e7179c3c8cebee792be9c86481cdc214ad4466 (diff) | |
download | libguestfs-a659f2c316fa8a959a6286f214e50911253c5580.tar.gz libguestfs-a659f2c316fa8a959a6286f214e50911253c5580.tar.xz libguestfs-a659f2c316fa8a959a6286f214e50911253c5580.zip |
New API: guestfs_shutdown: Cleanly shutdown the backend.
The new API splits orderly close into a two-step process:
if (guestfs_shutdown (g) == -1) {
/* handle the error, eg. qemu error */
}
guestfs_close (g);
Note that the explicit shutdown step is only necessary in the case
where you have made changes to the disk image and want to handle write
errors. Read the documentation for further information.
This change also:
- deprecates guestfs_kill_subprocess
- turns guestfs_kill_subprocess into the same as guestfs_shutdown
- changes guestfish and other tools to call shutdown + close
where necessary (not for read-only tools)
- updates documentation
- updates examples
(cherry picked from commit ffbf1475f7ae7c462db289ad4834391469e72edd)
Diffstat (limited to 'examples/copy_over.c')
-rw-r--r-- | examples/copy_over.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/examples/copy_over.c b/examples/copy_over.c index 9cff00bc..45b8fa6d 100644 --- a/examples/copy_over.c +++ b/examples/copy_over.c @@ -145,7 +145,7 @@ main (int argc, char *argv[]) } /* Clean up. */ - if (guestfs_umount_all (destg) == -1) + if (guestfs_shutdown (destg) == -1) exit (EXIT_FAILURE); guestfs_close (destg); @@ -193,10 +193,6 @@ start_srcthread (void *arg) } /* Clean up. */ - if (guestfs_umount_all (srcg) == -1) { - pthread_cancel (threaddata->mainthread); - exit (EXIT_FAILURE); - } guestfs_close (srcg); return NULL; |