[libvirt] [PATCH 25/42] storage: Don't check the output of virGetUserRuntimeDirectory()

Fabiano Fidêncio fidencio at redhat.com
Thu Dec 19 10:04:30 UTC 2019


virGetUserRuntimeDirectory() *never* *ever* returns NULL, making the
checks for it completely unnecessary.

Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
 src/storage/storage_driver.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 71078dfbd6..a33328db37 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -278,8 +278,6 @@ storageStateInitialize(bool privileged,
     } else {
         configdir = virGetUserConfigDirectory();
         rundir = virGetUserRuntimeDirectory();
-        if (!rundir)
-            goto error;
 
         driver->configDir = g_strdup_printf("%s/storage", configdir);
         driver->autostartDir = g_strdup_printf("%s/storage/autostart", configdir);
-- 
2.24.1




More information about the libvir-list mailing list