render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
Blob Blame History Raw
From 93e06ede9932c53518c7b3c9bff01449f52e2be3 Mon Sep 17 00:00:00 2001
Message-Id: <93e06ede9932c53518c7b3c9bff01449f52e2be3@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Wed, 19 Feb 2020 15:09:54 +0100
Subject: [PATCH] virDomainDiskAddISCSIPoolSourceHost: use g_new0 instead of
 VIR_ALLOC_N
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 5eda34f2e11f7ba4a26b0948dfa0fffa400dfadd)

https://bugzilla.redhat.com/show_bug.cgi?id=1804603
Message-Id: <67e8bcdbcd5c9a22c75d6da6316a0d950664c2b8.1582120424.git.pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 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 6973d97e1d..f0365329c6 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -31186,9 +31186,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.25.0