From nobody Wed Nov 5 14:25:40 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; dkim=fail; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534871692014276.3889788889617; Tue, 21 Aug 2018 10:14:52 -0700 (PDT) Received: from localhost ([::1]:54993 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsAF0-0003Rc-K5 for importer@patchew.org; Tue, 21 Aug 2018 13:14:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsA3x-0001As-9u for qemu-devel@nongnu.org; Tue, 21 Aug 2018 13:03:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsA3m-0005cB-Rf for qemu-devel@nongnu.org; Tue, 21 Aug 2018 13:03:20 -0400 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]:40652) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fsA3l-0005Sv-SO for qemu-devel@nongnu.org; Tue, 21 Aug 2018 13:03:14 -0400 Received: by mail-wm0-x22f.google.com with SMTP id y9-v6so3496323wma.5 for ; Tue, 21 Aug 2018 10:03:11 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-184-244.clienti.tiscali.it. [78.12.184.244]) by smtp.gmail.com with ESMTPSA id v6-v6sm2608955wmc.43.2018.08.21.10.03.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Aug 2018 10:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=iTs5bCxYBseQspACxznOAg1wMxxU4roclteF5IHwou4=; b=NrY/A2KJKpJuEtPDpitE5iH/VxAyqE3aPwRGia2bV+PCtHz7riWdcjrj/8PlGmrBmA /JBHIP7LZ247fgHi665vcKsY9opCEJldHzgXq1iBNFb+v71h/fMnTo8SquvFKLXiY/HK u5Jpj2lGYZAvGfFCstCWf3/EhisFXBRNMFbuZ+tQGnir52xCIJlQ7iL0O8dCfhxirtbw X4A90WIRb4d0buVYGBOZSJmi8Yn4kk86iTpVxH9fF8F3FkiB94/PH815L8X8IpLvwOrB tdmfVZEJzGThvWMrcnQrTMCQEZiNAfHlqL63LYxtbn1T1yzS12b5EMvOm8E7vruhwRNA 8v2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=iTs5bCxYBseQspACxznOAg1wMxxU4roclteF5IHwou4=; b=OXsQH2WB8aCzvAA54elXstJ7bGZ6EOdgDhBqNrKWAKXItgfZHyzDX/TOhW8Omn0ctx gOxZEqY0RFE8c8En3SzFj8LiWPk0zqZZ0raCUX1SSukbXL3Io3RxNzgMd6JHJx3Ken+c M0OmCvifN8YWJ2vxSfFA688Du62gmbfvf1Qcwd90ne4b27s0zov8OqitgzjIprmbjALO yvWuIpu1g/TG9Vbe77SJTlR0JTL2jaUo+9O5KGoucW8LWgXqsOVdOaoBOg/vxKzLyZXF Cz18yYLO+evdVymKhFEN5ajxyKlzNAQpfo/CFnxO+XVQ3EC/bEBGOngjACrbsnhnTkNe KyVQ== X-Gm-Message-State: APzg51CMbXu+7L2/MGNo/3XXgUX9eKjeq0oAZ+UbE3UdF8/2MHXU0Wef rMmVIeojzsLFd47wms7WH2sitzjh X-Google-Smtp-Source: ANB0VdYSzpxjb6/QUjB8ZIUjYp9GV3NQiWvi1LylTHp/c9a872/4sfomt+uRHCYJycwSDJ3T7xecXg== X-Received: by 2002:a1c:385:: with SMTP id 127-v6mr154154wmd.92.1534870989911; Tue, 21 Aug 2018 10:03:09 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 21 Aug 2018 19:01:38 +0200 Message-Id: <1534870966-9287-7-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1534870966-9287-1-git-send-email-pbonzini@redhat.com> References: <1534870966-9287-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22f Subject: [Qemu-devel] [PULL 06/74] qemu-pr-helper: 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: Murilo Opsfelder Araujo Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Murilo Opsfelder Araujo 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 Message-Id: <20180810141116.24016-1-muriloo@linux.ibm.com> Signed-off-by: Paolo Bonzini --- configure | 24 +++++++++++++++++++++++- scsi/qemu-pr-helper.c | 4 ++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/configure b/configure index e7bddc0..af0c149 100755 --- a/configure +++ b/configure @@ -3612,6 +3612,7 @@ fi # libmpathpersist probe =20 if test "$mpath" !=3D "no" ; then + # probe for the new API cat > $TMPC < #include @@ -3633,8 +3634,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 @@ -6495,6 +6514,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 1528a71..ed037aa 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 1.8.3.1