mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
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
This commit is contained in:
parent
d9f6066598
commit
19c08b5644
@ -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 &&
|
||||
|
Loading…
Reference in New Issue
Block a user