summaryrefslogtreecommitdiffstats
path: root/daemon/guestfsd.c
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-11-04 15:55:13 +0000
committerRichard W.M. Jones <rjones@redhat.com>2011-11-09 22:08:06 +0000
commit400b2cb03d5f7e606707d01ef278438c4b8440dc (patch)
treed7d40effd5011191459022b90a1b9cc1212315e1 /daemon/guestfsd.c
parent95ee3c98cf37dee3806cb9e8cdab1d1f024ae0e5 (diff)
downloadlibguestfs-400b2cb03d5f7e606707d01ef278438c4b8440dc.tar.gz
libguestfs-400b2cb03d5f7e606707d01ef278438c4b8440dc.tar.xz
libguestfs-400b2cb03d5f7e606707d01ef278438c4b8440dc.zip
daemon: Use a private copy of /etc/lvm so we don't modify the real config.
In the libguestfs live case we need to be careful not to modify the real /etc/lvm/lvm.conf file (when setting the filter rule). When the daemon starts, make a complete copy of /etc/lvm in a temporary directory, and adjust LVM_SYSTEM_DIR to point to the copy. All changes are made in the temporary copy. (cherry picked from commit 9c299b64bb24cefafa582fe425bb65b78373d205)
Diffstat (limited to 'daemon/guestfsd.c')
-rw-r--r--daemon/guestfsd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
index 51bb0b73..6373f34a 100644
--- a/daemon/guestfsd.c
+++ b/daemon/guestfsd.c
@@ -239,6 +239,11 @@ main (int argc, char *argv[])
_umask (0);
#endif
+ /* Make a private copy of /etc/lvm so we can change the config (see
+ * daemon/lvm-filter.c).
+ */
+ copy_lvm ();
+
/* Connect to virtio-serial channel. */
int sock = open (VIRTIO_SERIAL_CHANNEL, O_RDWR | O_CLOEXEC);
if (sock == -1) {