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/daemon.h | |
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/daemon.h')
-rw-r--r-- | daemon/daemon.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/daemon/daemon.h b/daemon/daemon.h index da991b17..4a686c09 100644 --- a/daemon/daemon.h +++ b/daemon/daemon.h @@ -33,6 +33,8 @@ /*-- in guestfsd.c --*/ extern int verbose; +extern int autosync_umount; + extern const char *sysroot; extern int sysroot_len; @@ -253,17 +255,21 @@ extern void notify_progress (uint64_t position, uint64_t total); */ #define CHROOT_IN \ do { \ - int __old_errno = errno; \ - if (chroot (sysroot) == -1) \ - perror ("CHROOT_IN: sysroot"); \ - errno = __old_errno; \ + if (sysroot_len > 0) { \ + int __old_errno = errno; \ + if (chroot (sysroot) == -1) \ + perror ("CHROOT_IN: sysroot"); \ + errno = __old_errno; \ + } \ } while (0) #define CHROOT_OUT \ do { \ - int __old_errno = errno; \ - if (chroot (".") == -1) \ - perror ("CHROOT_OUT: ."); \ - errno = __old_errno; \ + if (sysroot_len > 0) { \ + int __old_errno = errno; \ + if (chroot (".") == -1) \ + perror ("CHROOT_OUT: ."); \ + errno = __old_errno; \ + } \ } while (0) /* Marks functions which are not implemented. |