From nobody Sun Feb 8 21:12:30 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 1580910223160462.78195719617304; Wed, 5 Feb 2020 05:43:43 -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-287-otvakOFvN4KuS8f7qQDG2Q-1; Wed, 05 Feb 2020 08:43:39 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5BF7C802684; Wed, 5 Feb 2020 13:43:33 +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 328E11001B09; Wed, 5 Feb 2020 13:43:33 +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 D2F7F85CD9; Wed, 5 Feb 2020 13:43:32 +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 015DfAC2008444 for ; Wed, 5 Feb 2020 08:41:10 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6FC0110018FF; Wed, 5 Feb 2020 13:41:10 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED40D1001B05 for ; Wed, 5 Feb 2020 13:41:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580910222; 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=zXipiA0iyqnmudoHU1DYjJgk92y2Ot57isv7zMumQw8=; b=TcpoxGscAC588/TXLBmCuhqR9kL/j8LxKUu5TX/qXaBuUXa9j6cE8uwMSbgVxq+P2m95sA Vu38aDSCTqeeTNhAIf6GNi/ZcONikmgPtWQowlsfkjRnwgNEN8NVKNvvDUSq8jtvOc3w+G PIUJ6R6j5JPr9PW7EdcxSvYyjOWeguU= From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 7/9] virDomainDiskTranslateISCSIDirect: Take virStorageSourcePtr instead of virDomainDiskDefPtr Date: Wed, 5 Feb 2020 14:40:58 +0100 Message-Id: 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.84 on 10.5.11.22 X-MC-Unique: otvakOFvN4KuS8f7qQDG2Q-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 | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4545c6b314..531c765032 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -31392,30 +31392,30 @@ virDomainDiskTranslateSourcePoolAuth(virStorageSo= urcePtr src, static int -virDomainDiskTranslateISCSIDirect(virDomainDiskDefPtr def, +virDomainDiskTranslateISCSIDirect(virStorageSourcePtr src, virStoragePoolDefPtr pooldef) { - def->src->srcpool->actualtype =3D VIR_STORAGE_TYPE_NETWORK; - def->src->protocol =3D VIR_STORAGE_NET_PROTOCOL_ISCSI; + src->srcpool->actualtype =3D VIR_STORAGE_TYPE_NETWORK; + src->protocol =3D VIR_STORAGE_NET_PROTOCOL_ISCSI; - if (virDomainDiskTranslateSourcePoolAuth(def->src, + if (virDomainDiskTranslateSourcePoolAuth(src, &pooldef->source) < 0) return -1; /* Source pool may not fill in the secrettype field, * so we need to do so here */ - if (def->src->auth && !def->src->auth->secrettype) { + if (src->auth && !src->auth->secrettype) { const char *secrettype =3D virSecretUsageTypeToString(VIR_SECRET_USAGE_TYPE_ISCSI); - def->src->auth->secrettype =3D g_strdup(secrettype); + src->auth->secrettype =3D g_strdup(secrettype); } - if (virDomainDiskAddISCSIPoolSourceHost(def->src, pooldef) < 0) + if (virDomainDiskAddISCSIPoolSourceHost(src, pooldef) < 0) return -1; - if (!def->src->initiator.iqn && pooldef->source.initiator.iqn && - virStorageSourceInitiatorCopy(&def->src->initiator, + if (!src->initiator.iqn && pooldef->source.initiator.iqn && + virStorageSourceInitiatorCopy(&src->initiator, &pooldef->source.initiator) < 0) { return -1; } @@ -31540,7 +31540,7 @@ virDomainDiskTranslateSourcePool(virDomainDiskDefPt= r def) return -1; } - if (virDomainDiskTranslateISCSIDirect(def, pooldef) < 0) + if (virDomainDiskTranslateISCSIDirect(def->src, pooldef) < 0) return -1; break; @@ -31565,7 +31565,7 @@ virDomainDiskTranslateSourcePool(virDomainDiskDefPt= r def) break; case VIR_STORAGE_SOURCE_POOL_MODE_DIRECT: - if (virDomainDiskTranslateISCSIDirect(def, pooldef) < 0) + if (virDomainDiskTranslateISCSIDirect(def->src, pooldef) < 0) return -1; break; } --=20 2.24.1