diff options
author | Richard Jones <rjones@trick.home.annexia.org> | 2009-07-18 10:43:52 +0100 |
---|---|---|
committer | Richard Jones <rjones@trick.home.annexia.org> | 2009-07-18 10:43:52 +0100 |
commit | 78029b529ad98769685d607230b70f71832d5906 (patch) | |
tree | f103cb7252ccca7efc3e39f4400f961d5972937c /daemon/daemon.h | |
parent | e8c954933b2bfb3bc3ead5a151d49d164f1a8eab (diff) | |
download | libguestfs-78029b529ad98769685d607230b70f71832d5906.tar.gz libguestfs-78029b529ad98769685d607230b70f71832d5906.tar.xz libguestfs-78029b529ad98769685d607230b70f71832d5906.zip |
Make /sysroot path configurable.
Currently /sysroot is hard-coded throughout the daemon code.
This patch turns the path into a variable so that we can change
it in future, for example to allow standalone mode to be implemented.
This patch was tested by running all the C API tests successfully.
Diffstat (limited to 'daemon/daemon.h')
-rw-r--r-- | daemon/daemon.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/daemon/daemon.h b/daemon/daemon.h index 814d2b18..c2bbf3ed 100644 --- a/daemon/daemon.h +++ b/daemon/daemon.h @@ -29,6 +29,13 @@ #include "../src/guestfs_protocol.h" /*-- in guestfsd.c --*/ +extern int verbose; + +extern const char *sysroot; +extern int sysroot_len; + +extern char *sysroot_path (const char *path); + extern int xwrite (int sock, const void *buf, size_t len); extern int xread (int sock, void *buf, size_t len); @@ -53,8 +60,6 @@ extern int device_name_translation (char *device, const char *func); extern void udev_settle (void); -extern int verbose; - /*-- in names.c (auto-generated) --*/ extern const char *function_names[]; @@ -172,7 +177,7 @@ extern void reply (xdrproc_t xdrp, char *ret); #define CHROOT_IN \ do { \ int __old_errno = errno; \ - if (chroot ("/sysroot") == -1) \ + if (chroot (sysroot) == -1) \ perror ("CHROOT_IN: sysroot"); \ errno = __old_errno; \ } while (0) |