render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
a41c76
From 93e06ede9932c53518c7b3c9bff01449f52e2be3 Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <93e06ede9932c53518c7b3c9bff01449f52e2be3@dist-git>
a41c76
From: Peter Krempa <pkrempa@redhat.com>
a41c76
Date: Wed, 19 Feb 2020 15:09:54 +0100
a41c76
Subject: [PATCH] virDomainDiskAddISCSIPoolSourceHost: use g_new0 instead of
a41c76
 VIR_ALLOC_N
a41c76
MIME-Version: 1.0
a41c76
Content-Type: text/plain; charset=UTF-8
a41c76
Content-Transfer-Encoding: 8bit
a41c76
a41c76
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
(cherry picked from commit 5eda34f2e11f7ba4a26b0948dfa0fffa400dfadd)
a41c76
a41c76
https://bugzilla.redhat.com/show_bug.cgi?id=1804603
a41c76
Message-Id: <67e8bcdbcd5c9a22c75d6da6316a0d950664c2b8.1582120424.git.pkrempa@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
---
a41c76
 src/conf/domain_conf.c | 4 +---
a41c76
 1 file changed, 1 insertion(+), 3 deletions(-)
a41c76
a41c76
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
a41c76
index 6973d97e1d..f0365329c6 100644
a41c76
--- a/src/conf/domain_conf.c
a41c76
+++ b/src/conf/domain_conf.c
a41c76
@@ -31186,9 +31186,7 @@ virDomainDiskAddISCSIPoolSourceHost(virDomainDiskDefPtr def,
a41c76
 
a41c76
     /* iscsi pool only supports one host */
a41c76
     def->src->nhosts = 1;
a41c76
-
a41c76
-    if (VIR_ALLOC_N(def->src->hosts, def->src->nhosts) < 0)
a41c76
-        goto cleanup;
a41c76
+    def->src->hosts = g_new0(virStorageNetHostDef, 1);
a41c76
 
a41c76
     def->src->hosts[0].name = g_strdup(pooldef->source.hosts[0].name);
a41c76
 
a41c76
-- 
a41c76
2.25.0
a41c76