From nobody Sun Feb 8 20:53:36 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 ARC-Seal: i=1; a=rsa-sha256; t=1594749679; cv=none; d=zohomail.com; s=zohoarc; b=dV+IxxHOysM8c92GQhq6LSklJog5i4vINa/HYpMh+CQa9mJdWP2Kfdn01dbLwtZze7mraCjrGhS21OIxA50DnXUjR+0aY5QCEKYQt67wS5wdmRjb4XXUcMHPYHuyO0qPKcBIZUucy37QU5kAN5xv2rEguykxhQSiDcz6rbSZAuk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594749679; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tsH2wgI0cqsjrL6V98HKY5CKrUTuw8gC9sj5g/BExUo=; b=OLcl/FvUxyOhgu4McWeIR1NNcUZYlorpewkIgi7GaRGy0npoAuww+MkRixn9BSnbGX/5G1yeOIKHyvqqGJQLcNao4w82zianBM8hWfWGdSJyMJUxqufRdlT3nO9TIE0kSeczfRiZDzqsVRlBSek77HOihjQzbYiEJ8q0gIzOY90= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= 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 1594749679724555.3993756581375; Tue, 14 Jul 2020 11:01:19 -0700 (PDT) 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-39-elIUKmMMMB61GDdUiKqsOQ-1; Tue, 14 Jul 2020 14:01:16 -0400 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 9A515A4507; Tue, 14 Jul 2020 18:00:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 93C497D5A6; Tue, 14 Jul 2020 18:00:31 +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 3C3121809554; Tue, 14 Jul 2020 18:00:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06EI0Ped023974 for ; Tue, 14 Jul 2020 14:00:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id B438061465; Tue, 14 Jul 2020 18:00:25 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 07FC861462 for ; Tue, 14 Jul 2020 18:00:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594749678; 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=tsH2wgI0cqsjrL6V98HKY5CKrUTuw8gC9sj5g/BExUo=; b=DGxTP1oohoR/m2Jxs1905L+uz7xXAa3oEeYlUq03USgECwrkHjdPGI1659NeBMFJtlGjvY XMmoQSW0xnxIpsuiXyqRIPcH1M2PQR5l5WkfdI8gp7qz5B38ynMqy3Pbshc+KBkXQP3ee3 MpEZ2sgbJV03l10HVUzYVJy3TYfFYIo= X-MC-Unique: elIUKmMMMB61GDdUiKqsOQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 06/11] virDomainHostdevDefFormatSubsys: Split out formatting of vHBA subsystem Date: Tue, 14 Jul 2020 20:00:11 +0200 Message-Id: <7705e9e79a82c45bd4885a3e75d1d79a8829f280.1594749375.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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" Similarly to previous commit split out formatting of the vHBA subsystem related stuff. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_conf.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7b181e0587..facfddeea7 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -26148,6 +26148,21 @@ virDomainHostdevDefFormatSubsysSCSI(virBufferPtr b= uf, } +static void +virDomainHostdevDefFormatSubsysSCSIHost(virBufferPtr buf, + virDomainHostdevDefPtr def) +{ + g_auto(virBuffer) sourceAttrBuf =3D VIR_BUFFER_INITIALIZER; + virDomainHostdevSubsysSCSIVHostPtr hostsrc =3D &def->source.subsys.u.s= csi_host; + + virBufferAsprintf(&sourceAttrBuf, " protocol=3D'%s' wwpn=3D'%s'", + virDomainHostdevSubsysSCSIHostProtocolTypeToString(h= ostsrc->protocol), + hostsrc->wwpn); + + virXMLFormatElement(buf, "source", &sourceAttrBuf, NULL); +} + + static int virDomainHostdevDefFormatSubsys(virBufferPtr buf, virDomainHostdevDefPtr def, @@ -26155,9 +26170,7 @@ virDomainHostdevDefFormatSubsys(virBufferPtr buf, bool includeTypeInAddr, virDomainXMLOptionPtr xmlopt) { - g_auto(virBuffer) sourceAttrBuf =3D VIR_BUFFER_INITIALIZER; g_auto(virBuffer) sourceChildBuf =3D VIR_BUFFER_INIT_CHILD(buf); - virDomainHostdevSubsysSCSIVHostPtr hostsrc =3D &def->source.subsys.u.s= csi_host; virDomainHostdevSubsysMediatedDevPtr mdevsrc =3D &def->source.subsys.u= .mdev; switch ((virDomainHostdevSubsysType) def->source.subsys.type) { @@ -26172,6 +26185,9 @@ virDomainHostdevDefFormatSubsys(virBufferPtr buf, return virDomainHostdevDefFormatSubsysSCSI(buf, def, flags, includ= eTypeInAddr, xmlopt); case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST: + virDomainHostdevDefFormatSubsysSCSIHost(buf, def); + return 0; + case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: break; @@ -26182,14 +26198,6 @@ virDomainHostdevDefFormatSubsys(virBufferPtr buf, } - if (def->source.subsys.type =3D=3D VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI= _HOST) { - const char *protocol =3D - virDomainHostdevSubsysSCSIHostProtocolTypeToString(hostsrc->pr= otocol); - - virBufferAsprintf(&sourceAttrBuf, " protocol=3D'%s' wwpn=3D'%s'", - protocol, hostsrc->wwpn); - } - switch (def->source.subsys.type) { case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: break; @@ -26210,7 +26218,7 @@ virDomainHostdevDefFormatSubsys(virBufferPtr buf, return -1; } - virXMLFormatElement(buf, "source", &sourceAttrBuf, &sourceChildBuf); + virXMLFormatElement(buf, "source", NULL, &sourceChildBuf); return 0; } --=20 2.26.2