From nobody Sun Feb 8 13:09:37 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1652437897145134.13686382785647; Fri, 13 May 2022 03:31:37 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-621-8uB-DdiRPO2ltS7xydwQ2g-1; Fri, 13 May 2022 06:31:34 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A034586B8B9; Fri, 13 May 2022 10:31:32 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C924415F5E; Fri, 13 May 2022 10:31:32 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 318D51932115; Fri, 13 May 2022 10:31:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DC716194975B for ; Fri, 13 May 2022 10:31:29 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C05FC438BE0; Fri, 13 May 2022 10:31:29 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BC1B4438BDE for ; Fri, 13 May 2022 10:31:29 +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-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A4C643C11C68 for ; Fri, 13 May 2022 10:31:29 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-212-RwGBhukbNy-o16Z9087Mkg-1; Fri, 13 May 2022 06:31:28 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24D8EFlD011521 for ; Fri, 13 May 2022 10:31:27 GMT Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3g1kmvjfun-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 13 May 2022 10:31:27 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 24DANMpE027511 for ; Fri, 13 May 2022 10:31:25 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma03fra.de.ibm.com with ESMTP id 3g0kn79yrk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 13 May 2022 10:31:25 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 24DAVMSn36110828 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 May 2022 10:31:22 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3D4A611C052; Fri, 13 May 2022 10:31:22 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1FCA511C054; Fri, 13 May 2022 10:31:22 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.93.141]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 13 May 2022 10:31:22 +0000 (GMT) X-MC-Unique: 8uB-DdiRPO2ltS7xydwQ2g-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: RwGBhukbNy-o16Z9087Mkg-1 From: Boris Fiuczynski To: libvir-list@redhat.com Subject: [PATCH 04/17] util: make reuse of ccw device address format constant Date: Fri, 13 May 2022 12:31:03 +0200 Message-Id: <20220513103116.3751-5-fiuczy@linux.ibm.com> In-Reply-To: <20220513103116.3751-1-fiuczy@linux.ibm.com> References: <20220513103116.3751-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: _CG5apjHNdN1A-s5e5Ge2qwzCkc1mPPF X-Proofpoint-ORIG-GUID: _CG5apjHNdN1A-s5e5Ge2qwzCkc1mPPF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-13_04,2022-05-13_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxlogscore=936 adultscore=0 impostorscore=0 priorityscore=1501 spamscore=0 clxscore=1015 bulkscore=0 phishscore=0 lowpriorityscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205130043 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.85 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Fiuczynski Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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-ZM-MESSAGEID: 1652437899337100003 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Boris Fiuczynski --- src/conf/device_conf.h | 1 - src/qemu/qemu_command.c | 2 +- src/util/virccw.c | 2 +- src/util/virccw.h | 2 ++ 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h index 60d90bbf19..950d333e2e 100644 --- a/src/conf/device_conf.h +++ b/src/conf/device_conf.h @@ -202,7 +202,6 @@ int virDomainDeviceCCWAddressParseXML(xmlNodePtr node, virCCWDeviceAddress *addr); bool virDomainDeviceCCWAddressEqual(virCCWDeviceAddress *addr1, virCCWDeviceAddress *addr2); -#define VIR_CCW_DEVICE_ADDRESS_FMT "%x.%x.%04x" =20 int virDomainDeviceDriveAddressParseXML(xmlNodePtr node, virDomainDeviceDriveAddress *addr); diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 3746f02ff0..a1aa5e7cd2 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -600,7 +600,7 @@ qemuBuildDeviceAddressProps(virJSONValue *props, return 0; =20 case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW: { - g_autofree char *devno =3D g_strdup_printf("%x.%x.%04x", + g_autofree char *devno =3D g_strdup_printf(VIR_CCW_DEVICE_ADDRESS_= FMT, info->addr.ccw.cssid, info->addr.ccw.ssid, info->addr.ccw.devno); diff --git a/src/util/virccw.c b/src/util/virccw.c index 409287b380..5a19d3a112 100644 --- a/src/util/virccw.c +++ b/src/util/virccw.c @@ -25,5 +25,5 @@ char* virCCWDeviceAddressAsString(virCCWDeviceAddress *addr) { - return g_strdup_printf("%x.%x.%04x", addr->cssid, addr->ssid, addr->de= vno); + return g_strdup_printf(VIR_CCW_DEVICE_ADDRESS_FMT, addr->cssid, addr->= ssid, addr->devno); } diff --git a/src/util/virccw.h b/src/util/virccw.h index 21a03406fa..127359c299 100644 --- a/src/util/virccw.h +++ b/src/util/virccw.h @@ -22,6 +22,8 @@ =20 #include "internal.h" =20 +#define VIR_CCW_DEVICE_ADDRESS_FMT "%x.%x.%04x" + typedef struct _virCCWDeviceAddress virCCWDeviceAddress; struct _virCCWDeviceAddress { unsigned int cssid; --=20 2.33.1