From nobody Wed Nov 5 07:53:11 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.ibm.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1533910527314249.0635540410384; Fri, 10 Aug 2018 07:15:27 -0700 (PDT) Received: from localhost ([::1]:56480 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fo8CM-0002Ii-4q for importer@patchew.org; Fri, 10 Aug 2018 10:15:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fo88v-0007iJ-0x for qemu-devel@nongnu.org; Fri, 10 Aug 2018 10:11:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fo88r-00072P-Rh for qemu-devel@nongnu.org; Fri, 10 Aug 2018 10:11:52 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:48540 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fo88r-00070G-Lf for qemu-devel@nongnu.org; Fri, 10 Aug 2018 10:11:49 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7AE9IIp113988 for ; Fri, 10 Aug 2018 10:11:47 -0400 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ksbyvrs0f-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 10 Aug 2018 10:11:47 -0400 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 10 Aug 2018 08:11:46 -0600 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 10 Aug 2018 08:11:44 -0600 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w7AEBhba19464564 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 10 Aug 2018 07:11:43 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D802C7805F; Fri, 10 Aug 2018 08:11:43 -0600 (MDT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E8E537805E; Fri, 10 Aug 2018 08:11:41 -0600 (MDT) Received: from kermit-br-ibm-com.ibmmodules.com (unknown [9.80.83.42]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 10 Aug 2018 08:11:41 -0600 (MDT) From: Murilo Opsfelder Araujo To: qemu-devel@nongnu.org Date: Fri, 10 Aug 2018 11:11:16 -0300 X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 18081014-8235-0000-0000-00000DE5C738 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009518; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01071666; UDB=6.00551927; IPR=6.00851450; MB=3.00022634; MTD=3.00000008; XFM=3.00000015; UTC=2018-08-10 14:11:46 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18081014-8236-0000-0000-00004238E73F Message-Id: <20180810141116.24016-1-muriloo@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-08-10_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808100155 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATH] Fix build on CentOS 7 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Fam Zheng , qemu-block@nongnu.org, Murilo Opsfelder Araujo Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 After commit b3f1c8c413bc83e4a2cc7a63e4eddf9fe6449052 "qemu-pr-helper: use = new libmultipath API", QEMU started using new libmultipath API, which is not available on CentOS 7.x. This fixes that by probing the new libmultipath API in configure. If it fa= ils, then try probing the old API. If it fails, then consider libmultipath not available. With this, configure script defines CONFIG_MPATH_NEW_API that is used in scsi/qemu-pr-helper.c to use the new libmultipath API. Fixes: b3f1c8c413bc83e4a2cc7a63e4eddf9fe6449052 BugLink: https://bugs.launchpad.net/qemu/+bug/1786343 Signed-off-by: Murilo Opsfelder Araujo --- configure | 24 +++++++++++++++++++++++- scsi/qemu-pr-helper.c | 4 ++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 2a7796ea80..bc6000c24a 100755 --- a/configure +++ b/configure @@ -3558,6 +3558,7 @@ fi # libmpathpersist probe =20 if test "$mpath" !=3D "no" ; then + # probe for the new API cat > $TMPC < #include @@ -3579,8 +3580,26 @@ int main(void) { EOF if compile_prog "" "-ludev -lmultipath -lmpathpersist" ; then mpathpersist=3Dyes + mpathpersist_new_api=3Dyes else - mpathpersist=3Dno + # probe for the old API + cat > $TMPC < +#include +unsigned mpath_mx_alloc_len =3D 1024; +int logsink; +int main(void) { + struct udev *udev =3D udev_new(); + mpath_lib_init(udev); + return 0; +} +EOF + if compile_prog "" "-ludev -lmultipath -lmpathpersist" ; then + mpathpersist=3Dyes + mpathpersist_new_api=3Dno + else + mpathpersist=3Dno + fi fi else mpathpersist=3Dno @@ -6421,6 +6440,9 @@ if test "$virtfs" =3D "yes" ; then fi if test "$mpath" =3D "yes" ; then echo "CONFIG_MPATH=3Dy" >> $config_host_mak + if test "$mpathpersist_new_api" =3D "yes"; then + echo "CONFIG_MPATH_NEW_API=3Dy" >> $config_host_mak + fi fi if test "$vhost_scsi" =3D "yes" ; then echo "CONFIG_VHOST_SCSI=3Dy" >> $config_host_mak diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c index 1528a712a0..ed037aabee 100644 --- a/scsi/qemu-pr-helper.c +++ b/scsi/qemu-pr-helper.c @@ -301,7 +301,11 @@ void put_multipath_config(struct config *conf) static void multipath_pr_init(void) { udev =3D udev_new(); +#ifdef CONFIG_MPATH_NEW_API multipath_conf =3D mpath_lib_init(); +#else + mpath_lib_init(udev); +#endif } =20 static int is_mpath(int fd) --=20 2.17.1