From nobody Sun Feb 8 17:03:26 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1580910112531741.8246720359214; Wed, 5 Feb 2020 05:41:52 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-249-i4LTw3sTMtKy1fb7PbBJsQ-1; Wed, 05 Feb 2020 08:41:49 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 224E3802566; Wed, 5 Feb 2020 13:41:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D425460C05; Wed, 5 Feb 2020 13:41:43 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id DE1658175A; Wed, 5 Feb 2020 13:41:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 015Df8bG008418 for ; Wed, 5 Feb 2020 08:41:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id CC1151001DC2; Wed, 5 Feb 2020 13:41:08 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 54C441001B05 for ; Wed, 5 Feb 2020 13:41:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580910111; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=BDfcqc6+F6KzHud1FCSWNXLmb+R8J7Z48KZEEqY4u7E=; b=FUo1W1Xatei45BZqBTMrkNh+B9sPw+9/SM1lTbMPXWjQgdivKDiy/ZlgIpIHGqLGj5EQFB BVaCKoW0pjfXxyqlC++c778i+qimmyg2TUSZ/v50qpvr1clF5QZxrZiAs4wK64AUu5Irbq 8COO6FPwe+FUWvC/ijEBW3haXB92Ou0= From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/9] virDomainDiskAddISCSIPoolSourceHost: Take virStorageSourcePtr instead of virDomainDiskDefPtr Date: Wed, 5 Feb 2020 14:40:56 +0100 Message-Id: <67141bc05602cca3b6bbb261cc03fdb02c07a7e8.1580909976.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: i4LTw3sTMtKy1fb7PbBJsQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Only 'def->src' was ever used in this function. Use the source directly. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_conf.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5ef12c7ee7..bcb17dcc6e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -31323,7 +31323,7 @@ virDomainNetResolveActualType(virDomainNetDefPtr if= ace) static int -virDomainDiskAddISCSIPoolSourceHost(virDomainDiskDefPtr def, +virDomainDiskAddISCSIPoolSourceHost(virStorageSourcePtr src, virStoragePoolDefPtr pooldef) { VIR_AUTOSTRINGLIST tokens =3D NULL; @@ -31337,38 +31337,38 @@ virDomainDiskAddISCSIPoolSourceHost(virDomainDisk= DefPtr def, } /* iscsi pool only supports one host */ - def->src->nhosts =3D 1; - def->src->hosts =3D g_new0(virStorageNetHostDef, 1); + src->nhosts =3D 1; + src->hosts =3D g_new0(virStorageNetHostDef, 1); - def->src->hosts[0].name =3D g_strdup(pooldef->source.hosts[0].name); + src->hosts[0].name =3D g_strdup(pooldef->source.hosts[0].name); if (pooldef->source.hosts[0].port !=3D 0) - def->src->hosts[0].port =3D pooldef->source.hosts[0].port; + src->hosts[0].port =3D pooldef->source.hosts[0].port; else - def->src->hosts[0].port =3D 3260; + src->hosts[0].port =3D 3260; /* iscsi volume has name like "unit:0:0:1" */ - if (!(tokens =3D virStringSplitCount(def->src->srcpool->volume, ":", 0= , &ntokens))) + if (!(tokens =3D virStringSplitCount(src->srcpool->volume, ":", 0, &nt= okens))) return -1; if (ntokens !=3D 4) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected iscsi volume name '%s'"), - def->src->srcpool->volume); + src->srcpool->volume); return -1; } /* iscsi pool has only one source device path */ - def->src->path =3D g_strdup_printf("%s/%s", pooldef->source.devices[0]= .path, - tokens[3]); + src->path =3D g_strdup_printf("%s/%s", pooldef->source.devices[0].path, + tokens[3]); /* Storage pool have not supported these 2 attributes yet, * use the defaults. */ - def->src->hosts[0].transport =3D VIR_STORAGE_NET_HOST_TRANS_TCP; - def->src->hosts[0].socket =3D NULL; + src->hosts[0].transport =3D VIR_STORAGE_NET_HOST_TRANS_TCP; + src->hosts[0].socket =3D NULL; - def->src->protocol =3D VIR_STORAGE_NET_PROTOCOL_ISCSI; + src->protocol =3D VIR_STORAGE_NET_PROTOCOL_ISCSI; return 0; } @@ -31411,7 +31411,7 @@ virDomainDiskTranslateISCSIDirect(virDomainDiskDefP= tr def, def->src->auth->secrettype =3D g_strdup(secrettype); } - if (virDomainDiskAddISCSIPoolSourceHost(def, pooldef) < 0) + if (virDomainDiskAddISCSIPoolSourceHost(def->src, pooldef) < 0) return -1; if (!def->src->initiator.iqn && pooldef->source.initiator.iqn && --=20 2.24.1