[PATCH 2/9] virDomainDiskAddISCSIPoolSourceHost: use g_new0 instead of VIR_ALLOC_N

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 6124c7520c..7cf555596f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -31339,9 +31339,7 @@ virDomainDiskAddISCSIPoolSourceHost(virDomainDiskDefPtr def,

     /* iscsi pool only supports one host */
     def->src->nhosts = 1;
-
-    if (VIR_ALLOC_N(def->src->hosts, def->src->nhosts) < 0)
-        goto cleanup;
+    def->src->hosts = g_new0(virStorageNetHostDef, 1);

     def->src->hosts[0].name = g_strdup(pooldef->source.hosts[0].name);

-- 
2.24.1





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux