diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2011-01-27 16:54:48 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2011-02-03 18:50:44 +0000 |
commit | 338ecaac0546fe0308df3ae5d0927a171b15edd7 (patch) | |
tree | f18175e8812c5f0d92be523dd889affd560be69c /daemon/guestfsd.c | |
parent | 7eb012f3710bb554d5fc2c4229036901b0b5ad90 (diff) | |
download | libguestfs-338ecaac0546fe0308df3ae5d0927a171b15edd7.tar.gz libguestfs-338ecaac0546fe0308df3ae5d0927a171b15edd7.tar.xz libguestfs-338ecaac0546fe0308df3ae5d0927a171b15edd7.zip |
daemon: Allow -r option to run daemon standalone.
This changes several aspects of the daemon. Currently:
* sysroot will be "" (ie. operate directly on /)
* CHROOT_IN/CHROOT_OUT are disabled
* autosync doesn't try to unmount everything
Diffstat (limited to 'daemon/guestfsd.c')
-rw-r--r-- | daemon/guestfsd.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c index a8b53e73..8e77cba6 100644 --- a/daemon/guestfsd.c +++ b/daemon/guestfsd.c @@ -118,6 +118,9 @@ winsock_init (void) const char *sysroot = "/sysroot"; /* No trailing slash. */ int sysroot_len = 8; +/* If set (the default), do 'umount-all' when performing autosync. */ +int autosync_umount = 1; + /* Not used explicitly, but required by the gnulib 'error' module. */ const char *program_name = "guestfsd"; @@ -125,13 +128,13 @@ static void usage (void) { fprintf (stderr, - "guestfsd [-f|--foreground] [-v|--verbose]\n"); + "guestfsd [-f|--foreground] [-v|--verbose] [-r]\n"); } int main (int argc, char *argv[]) { - static const char *options = "fv?"; + static const char *options = "frv?"; static const struct option long_options[] = { { "foreground", 0, 0, 'f' }, { "help", 0, 0, '?' }, @@ -173,6 +176,15 @@ main (int argc, char *argv[]) dont_fork = 1; break; + /* The -r flag is used when running standalone. It changes + * several aspects of the daemon. + */ + case 'r': + sysroot = ""; + sysroot_len = 0; + autosync_umount = 0; + break; + case 'v': verbose = 1; break; |