Permalink
Browse files

daemon: lvm: Fix various paths relative to new lvm_system_dir.

This fixes commit 9fd41ab.
  • Loading branch information...
1 parent 312d02a commit d8f14591d10df847fad2e24f2f430b2543020912 @rwmjones rwmjones committed Jan 18, 2013
Showing with 11 additions and 4 deletions.
  1. +11 −4 daemon/lvm-filter.c
View
@@ -37,7 +37,13 @@ GUESTFSD_EXT_CMD(str_rm, rm);
/* This runs during daemon start up and creates a complete copy of
* /etc/lvm so that we can modify it as we desire. We set
- * LVM_SYSTEM_DIR to point to the copy.
+ * LVM_SYSTEM_DIR to point to the copy. Note that the final directory
+ * layout is:
+ * /tmp/lvmXXXXXX (lvm_system_dir set to this)
+ * /tmp/lvmXXXXXX/lvm ($LVM_SYSTEM_DIR set to this)
+ * /tmp/lvmXXXXXX/lvm/lvm.conf (configuration file)
+ * /tmp/lvmXXXXXX/lvm/cache
+ * etc.
*/
static char lvm_system_dir[] = "/tmp/lvmXXXXXX";
@@ -130,10 +136,11 @@ static int
set_filter (const char *filter)
{
char lvm_conf[64];
- snprintf (lvm_conf, sizeof lvm_conf, "%s/lvm.conf", lvm_system_dir);
+ snprintf (lvm_conf, sizeof lvm_conf, "%s/lvm/lvm.conf", lvm_system_dir);
char lvm_conf_new[64];
- snprintf (lvm_conf_new, sizeof lvm_conf, "%s/lvm.conf.new", lvm_system_dir);
+ snprintf (lvm_conf_new, sizeof lvm_conf, "%s/lvm/lvm.conf.new",
+ lvm_system_dir);
FILE *ifp = fopen (lvm_conf, "r");
if (ifp == NULL) {
@@ -224,7 +231,7 @@ static int
rescan (void)
{
char lvm_cache[64];
- snprintf (lvm_cache, sizeof lvm_cache, "%s/cache/.cache", lvm_system_dir);
+ snprintf (lvm_cache, sizeof lvm_cache, "%s/lvm/cache/.cache", lvm_system_dir);
unlink (lvm_cache);

0 comments on commit d8f1459

Please sign in to comment.