diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 32da9a735184c5f6a0862c601794f9dd9d744d4f..a946b05d5d47c7e6500ea532c728c9053711ae34 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -193,10 +193,10 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged) if (virAsprintf(&cfg->swtpmStorageDir, "%s/lib/libvirt/swtpm", LOCALSTATEDIR) < 0) goto error; - if (virDoesUserExist("tss") != 0 || + if (!virDoesUserExist("tss") || virGetUserID("tss", &cfg->swtpm_user) < 0) cfg->swtpm_user = 0; /* fall back to root */ - if (virDoesGroupExist("tss") != 0 || + if (!virDoesGroupExist("tss") || virGetGroupID("tss", &cfg->swtpm_group) < 0) cfg->swtpm_group = 0; /* fall back to root */ } else {