From 19c08b5644162420f00844d20be201fcee377cf8 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Mon, 11 Jun 2012 12:29:09 +0100 Subject: [PATCH] Only migrate profile in non-privileged libvirtd instance Only the non-privileged libvirtd instance uses $HOME. So avoid running the code for migrating to XDG directories unless using a non-privileged libvirtd --- daemon/libvirtd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index d5ad05e92d..de6c96eab5 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -783,6 +783,8 @@ static int migrateProfile(void) int ret = -1; mode_t old_umask; + VIR_DEBUG("Checking if user profile needs migrating"); + if (!(home = virGetUserDirectory())) goto cleanup; @@ -795,6 +797,9 @@ static int migrateProfile(void) goto cleanup; if (!virFileIsDir(old_base) || virFileExists(config_dir)) { + VIR_DEBUG("No old profile in '%s' / " + "new profile directory already present '%s'", + old_base, config_dir); ret = 0; goto cleanup; } @@ -830,6 +835,7 @@ static int migrateProfile(void) goto cleanup; } + VIR_DEBUG("Profile migrated from %s to %s", old_base, config_dir); ret = 0; cleanup: @@ -1063,7 +1069,8 @@ int main(int argc, char **argv) { exit(EXIT_FAILURE); } - if (migrateProfile() < 0) + if (!privileged && + migrateProfile() < 0) exit(EXIT_FAILURE); if (config->host_uuid && -- 2.47.2