summaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-07-15 11:38:21 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-07-15 12:24:51 +0100
commitf173543fd207bdc254a5eb75180d82ef25eacae9 (patch)
tree0f763d61695a1549f6a5f0784fb7e44ab90ad065 /generator
parent4b53a3737b76cad7aca407a0d9e37fed1d42ef69 (diff)
downloadlibguestfs-f173543fd207bdc254a5eb75180d82ef25eacae9.tar.gz
libguestfs-f173543fd207bdc254a5eb75180d82ef25eacae9.tar.xz
libguestfs-f173543fd207bdc254a5eb75180d82ef25eacae9.zip
New APIs: set-pgroup, get-pgroup
If the pgroup flag is set in the handle, then the qemu and recovery subprocesses are placed in separate process groups. The default is false. The purpose for setting up a process group is that ^C will not be passed from the main process down to these processes (killing them). This allows ^C and other keyboard events to be caught and handled in the main process.
Diffstat (limited to 'generator')
-rw-r--r--generator/generator_actions.ml19
1 files changed, 19 insertions, 0 deletions
diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml
index 1ccacdb8..87c934aa 100644
--- a/generator/generator_actions.ml
+++ b/generator/generator_actions.ml
@@ -1526,6 +1526,25 @@ advice before using trademarks in applications.
=back");
+ ("set_pgroup", (RErr, [Bool "pgroup"], []), -1, [FishAlias "pgroup"],
+ [],
+ "set process group flag",
+ "\
+If C<pgroup> is true, child processes are placed into
+their own process group.
+
+The practical upshot of this is that signals like C<SIGINT> (from
+users pressing C<^C>) won't be received by the child process.
+
+The default for this flag is false, because usually you want
+C<^C> to kill the subprocess.");
+
+ ("get_pgroup", (RBool "pgroup", [], []), -1, [],
+ [],
+ "get process group flag",
+ "\
+This returns the process group flag.");
+
]
(* daemon_functions are any functions which cause some action