From nobody Sat Feb 7 21:16:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1603474655; cv=none; d=zohomail.com; s=zohoarc; b=ZiN7QRdQlQKi8rAGEUH1zxmV+cfgHs/8mTnsrU1L+hoJZTZItnLYmxIjIIOmyy+hv8HMB54E9plI7/mIHw79KxRC6u5wzrmUAF1mZN9t6hP9+j2lIHTb7ALtQz66eSkRj/K29ePSkxBYQ68AkxoaeRKistWM5LHdY2H8cdei4/8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603474655; h=Content-Type:Content-Transfer-Encoding:Cc: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=12m5KfRpgOZlnfxdR02S15uVp1nH8M5F/eZBOyjW/Mk=; b=RH5Y1SPMMZT2pkweDjXk8jZROVVWjG9QkXTjpKKm2lUOLvVZBNUCmIpQB68JtZHjC3wE1mdo47k29ooWyLdAr6yNrxJ8+7qKZfHpvnchWjjnAs+n1OgdYwk1d6OpaX53P5YzvIMVgv8cElNBEmN2cM/10jV4xSCUtrrxwXlCFK8= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1603474654961688.753998120532; Fri, 23 Oct 2020 10:37:34 -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-578-FnURqZ-nP723KgMGxLlH-g-1; Fri, 23 Oct 2020 13:37:31 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F1322640A0; Fri, 23 Oct 2020 17:37:25 +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 92AEA5D9CC; Fri, 23 Oct 2020 17:37:24 +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 A394492304; Fri, 23 Oct 2020 17:37:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 09NHbKBk001444 for ; Fri, 23 Oct 2020 13:37:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id D2AC5207A524; Fri, 23 Oct 2020 17:37:20 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CDBA7207A641 for ; Fri, 23 Oct 2020 17:37:17 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2F14E102F1E1 for ; Fri, 23 Oct 2020 17:37:17 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-542-jFya2kI-Pm-EwTeDpDRu7w-1; Fri, 23 Oct 2020 13:37:11 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09NHWEOW002178; Fri, 23 Oct 2020 13:37:11 -0400 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0b-001b2d01.pphosted.com with ESMTP id 34c1ct4w8c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Oct 2020 13:37:10 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 09NHMF0R028895; Fri, 23 Oct 2020 17:32:09 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma06ams.nl.ibm.com with ESMTP id 347qvheupn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Oct 2020 17:32:09 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 09NHW6ou21496228 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 23 Oct 2020 17:32:06 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AF8264203F; Fri, 23 Oct 2020 17:32:06 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8AE8F4204D; Fri, 23 Oct 2020 17:32:06 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.42.215]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 23 Oct 2020 17:32:06 +0000 (GMT) X-MC-Unique: FnURqZ-nP723KgMGxLlH-g-1 X-MC-Unique: jFya2kI-Pm-EwTeDpDRu7w-1 From: Boris Fiuczynski To: libvir-list@redhat.com Subject: [PATCH 07/10] conf: node_device: refactor CSS formating Date: Fri, 23 Oct 2020 19:31:49 +0200 Message-Id: <20201023173152.45238-8-fiuczy@linux.ibm.com> In-Reply-To: <20201023173152.45238-1-fiuczy@linux.ibm.com> References: <20201023173152.45238-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.737 definitions=2020-10-23_09:2020-10-23, 2020-10-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 impostorscore=0 mlxscore=0 suspectscore=1 clxscore=1015 priorityscore=1501 bulkscore=0 spamscore=0 mlxlogscore=999 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010230109 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: eskultet@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.14 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 Content-Type: text/plain; charset="utf-8" Move XML formating code into a new method. Signed-off-by: Boris Fiuczynski Reviewed-by: Marc Hartmayer Reviewed-by: Bjoern Walk Reviewed-by: J=C3=A1n Tomko --- src/conf/node_device_conf.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index 6fd5b1b038..ebabf20b67 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -533,6 +533,20 @@ virNodeDeviceCapMdevDefFormat(virBufferPtr buf, } } =20 + +static void +virNodeDeviceCapCCWDefFormat(virBufferPtr buf, + const virNodeDevCapData *data) +{ + virBufferAsprintf(buf, "0x%x\n", + data->ccw_dev.cssid); + virBufferAsprintf(buf, "0x%x\n", + data->ccw_dev.ssid); + virBufferAsprintf(buf, "0x%04x\n", + data->ccw_dev.devno); +} + + char * virNodeDeviceDefFormat(const virNodeDeviceDef *def) { @@ -619,12 +633,7 @@ virNodeDeviceDefFormat(const virNodeDeviceDef *def) break; case VIR_NODE_DEV_CAP_CCW_DEV: case VIR_NODE_DEV_CAP_CSS_DEV: - virBufferAsprintf(&buf, "0x%x\n", - data->ccw_dev.cssid); - virBufferAsprintf(&buf, "0x%x\n", - data->ccw_dev.ssid); - virBufferAsprintf(&buf, "0x%04x\n", - data->ccw_dev.devno); + virNodeDeviceCapCCWDefFormat(&buf, data); break; case VIR_NODE_DEV_CAP_MDEV_TYPES: case VIR_NODE_DEV_CAP_FC_HOST: --=20 2.25.1