From nobody Wed May 15 19:15:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1713435112; cv=none; d=zohomail.com; s=zohoarc; b=F+6Sy4YGIvnrpTjmS0bumoAxkC1VTvy8m3WY5XxBL/t65HKqcT9H8dd/Vuu8L41IvWfKvIXUQhbihYgOI8uNMZq90bDOe9mtsThrbHN0TNM2Q2GgKClh/nf94PSCLjhOMDUnMkuvGT79VXtW18Xi8HP9CrT+bAcW1b0cDf2fyQI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713435112; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gtnFarnwo5zb+o632vTXAwSiWspak2JMrBeGC1XvQW4=; b=Kmp6peC+z7+Wkk0J+xjW3clS4/brhLoHc3RdW0Ju6nVQy9kIwGqMtm7u5ZHRvEQW17/kb5+/1oy0NK85BoE0pGeFHcafHPDsXxgzj1Y4TLIUvjasgydN9nfle/vmWZQmDLsyzmBaIqKY2NnVRIwaCjxNooT4gYHi+XTBIVd5UUA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1713435112933818.4649875767653; Thu, 18 Apr 2024 03:11:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxOjc-0001KN-0P; Thu, 18 Apr 2024 06:11:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOjX-0001HX-LA for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOjV-0004o0-Li for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:11 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-500-LRuV9ls5MQerGkDaOu-wyg-1; Thu, 18 Apr 2024 06:11:04 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 52EF218A2BE1; Thu, 18 Apr 2024 10:11:04 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id D5A2DC1A225; Thu, 18 Apr 2024 10:11:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713435068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gtnFarnwo5zb+o632vTXAwSiWspak2JMrBeGC1XvQW4=; b=clrBwFJdz9K5P3Eftwvxli+HvujDVy9HAacyUAvQr51pBvmfY2StCMGL6oU16mHjPXXN0X XlF5CbNGIu3LnEYKUUrmNcPJfRf4U6rk1dbzDJuYaTE9IJKS2riP306NPpLXiGwxb/jo2I 3IUYijtbAC+ybkYgI1L6I1IYkrId5wE= X-MC-Unique: LRuV9ls5MQerGkDaOu-wyg-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , Vladimir Sementsov-Ogievskiy , Peter Lieven , "Richard W.M. Jones" , Paolo Bonzini , qemu-devel@nongnu.org Cc: Kevin Wolf , Hanna Reitz , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Konstantin Kostiuk , qemu-block@nongnu.org Subject: [PATCH v3 01/13] tests: Remove Ubuntu 20.04 container Date: Thu, 18 Apr 2024 12:10:44 +0200 Message-ID: <20240418101056.302103-2-thuth@redhat.com> In-Reply-To: <20240418101056.302103-1-thuth@redhat.com> References: <20240418101056.302103-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.719, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1713435113675100001 Since Ubuntu 22.04 is now available since two years, we can stop actively supporting the previous LTS version of Ubuntu now. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- tests/docker/dockerfiles/ubuntu2004.docker | 157 --------------------- tests/lcitool/refresh | 1 - 2 files changed, 158 deletions(-) delete mode 100644 tests/docker/dockerfiles/ubuntu2004.docker diff --git a/tests/docker/dockerfiles/ubuntu2004.docker b/tests/docker/dock= erfiles/ubuntu2004.docker deleted file mode 100644 index d3e212060c..0000000000 --- a/tests/docker/dockerfiles/ubuntu2004.docker +++ /dev/null @@ -1,157 +0,0 @@ -# THIS FILE WAS AUTO-GENERATED -# -# $ lcitool dockerfile --layers all ubuntu-2004 qemu -# -# https://gitlab.com/libvirt/libvirt-ci - -FROM docker.io/library/ubuntu:20.04 - -RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ - apt-get update && \ - apt-get install -y eatmydata && \ - eatmydata apt-get dist-upgrade -y && \ - eatmydata apt-get install --no-install-recommends -y \ - bash \ - bc \ - bison \ - bsdmainutils \ - bzip2 \ - ca-certificates \ - ccache \ - clang \ - dbus \ - debianutils \ - diffutils \ - exuberant-ctags \ - findutils \ - flex \ - g++ \ - gcc \ - gcovr \ - gettext \ - git \ - hostname \ - libaio-dev \ - libasan6 \ - libasound2-dev \ - libattr1-dev \ - libbrlapi-dev \ - libbz2-dev \ - libc6-dev \ - libcacard-dev \ - libcap-ng-dev \ - libcapstone-dev \ - libcmocka-dev \ - libcurl4-gnutls-dev \ - libdaxctl-dev \ - libdrm-dev \ - libepoxy-dev \ - libfdt-dev \ - libffi-dev \ - libfuse3-dev \ - libgbm-dev \ - libgcrypt20-dev \ - libglib2.0-dev \ - libglusterfs-dev \ - libgnutls28-dev \ - libgtk-3-dev \ - libibumad-dev \ - libibverbs-dev \ - libiscsi-dev \ - libjemalloc-dev \ - libjpeg-turbo8-dev \ - libjson-c-dev \ - liblttng-ust-dev \ - liblzo2-dev \ - libncursesw5-dev \ - libnfs-dev \ - libnuma-dev \ - libpam0g-dev \ - libpcre2-dev \ - libpixman-1-dev \ - libpmem-dev \ - libpng-dev \ - libpulse-dev \ - librbd-dev \ - librdmacm-dev \ - libsasl2-dev \ - libsdl2-dev \ - libsdl2-image-dev \ - libseccomp-dev \ - libselinux1-dev \ - libslirp-dev \ - libsnappy-dev \ - libsndio-dev \ - libspice-protocol-dev \ - libspice-server-dev \ - libssh-dev \ - libsystemd-dev \ - libtasn1-6-dev \ - libubsan1 \ - libudev-dev \ - libusb-1.0-0-dev \ - libusbredirhost-dev \ - libvdeplug-dev \ - libvirglrenderer-dev \ - libvte-2.91-dev \ - libxen-dev \ - libzstd-dev \ - llvm \ - locales \ - make \ - mtools \ - multipath-tools \ - ncat \ - nettle-dev \ - ninja-build \ - openssh-client \ - pkgconf \ - python3 \ - python3-numpy \ - python3-opencv \ - python3-pillow \ - python3-pip \ - python3-setuptools \ - python3-sphinx \ - python3-sphinx-rtd-theme \ - python3-venv \ - python3-wheel \ - python3-yaml \ - rpm2cpio \ - sed \ - socat \ - sparse \ - systemtap-sdt-dev \ - tar \ - tesseract-ocr \ - tesseract-ocr-eng \ - xfslibs-dev \ - xorriso \ - zlib1g-dev \ - zstd && \ - eatmydata apt-get autoremove -y && \ - eatmydata apt-get autoclean -y && \ - sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \ - dpkg-reconfigure locales && \ - dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --sh= ow > /packages.txt && \ - mkdir -p /usr/libexec/ccache-wrappers && \ - ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/c++ && \ - ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \ - ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/clang && \ - ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \ - ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc - -RUN /usr/bin/pip3 install \ - meson=3D=3D0.63.2 \ - tomli - -ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" -ENV LANG "en_US.UTF-8" -ENV MAKE "/usr/bin/make" -ENV NINJA "/usr/bin/ninja" -ENV PYTHON "/usr/bin/python3" -# As a final step configure the user (if env is defined) -ARG USER -ARG UID -RUN if [ "${USER}" ]; then \ - id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh index fe7692c500..692752a3df 100755 --- a/tests/lcitool/refresh +++ b/tests/lcitool/refresh @@ -130,7 +130,6 @@ try: trailer=3D"".join(debian12_extras)) generate_dockerfile("fedora", "fedora-38") generate_dockerfile("opensuse-leap", "opensuse-leap-15") - generate_dockerfile("ubuntu2004", "ubuntu-2004") generate_dockerfile("ubuntu2204", "ubuntu-2204") =20 # --=20 2.44.0 From nobody Wed May 15 19:15:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1713435187; cv=none; d=zohomail.com; s=zohoarc; b=X5qeIzlkFoVgNbo3l/QlOzqwsrhs4OxZY5Sk4bxDFWNWHZtqJjndBHF5QhAzDTdXFmGoLLFrqyxqzEH6fh2Jsbv+6Qha/ielmYTPIwtozUJi9ESsOjYJmZ2c0V0+qJURzrtJ33olGOg4T4lt+Pj/kgDNhws+emjMmkffhFymobg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713435187; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=n8NiQA5gqxy53R5bIkLlYfLBp2kXYYOCKqusx2Vc3F8=; b=XldSVSr78Uro6ct80Aqbl/7zuYOA/aVyaSXoj8VqzYYOdyZtHCrepsGpfplTY4uPgUckQY1sBfTuhoWWP1bDG9BEX6hcdmuj+xgCfxiMkTOsnBmWkuDpR3PFcSH9t39n4z9WWXkQUdB+iFcELE1waTmrUF41hznjaIBejPAViE8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1713435187265829.1349296529437; Thu, 18 Apr 2024 03:13:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxOjg-0001Ma-CM; Thu, 18 Apr 2024 06:11:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOja-0001KM-1E for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOjY-0004oX-0C for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:13 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-2-J7zqFYGDMwuNM9OuxLm9kg-1; Thu, 18 Apr 2024 06:11:08 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C15F13C1015E; Thu, 18 Apr 2024 10:11:07 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 97B9EC271A4; Thu, 18 Apr 2024 10:11:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713435071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n8NiQA5gqxy53R5bIkLlYfLBp2kXYYOCKqusx2Vc3F8=; b=KoUSJNFiAWSufxYk0VCXeASne7104ZgohCnH/y6+7Uk4SoVEQYUwg8QtXPfbSoySjSlhk+ jFpGjGXlT6DDGbTBCdjKuRL7Yc9jiheEuff1JzWXja8J1Lv2lhW4FFtAElqktJH9OgSgL+ nLwsNabVFHSBK0fufgeYVfyy8jzCVeI= X-MC-Unique: J7zqFYGDMwuNM9OuxLm9kg-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , Vladimir Sementsov-Ogievskiy , Peter Lieven , "Richard W.M. Jones" , Paolo Bonzini , qemu-devel@nongnu.org Cc: Kevin Wolf , Hanna Reitz , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Konstantin Kostiuk , qemu-block@nongnu.org Subject: [PATCH v3 02/13] tests/lcitool/libvirt-ci: Update to the latest master branch Date: Thu, 18 Apr 2024 12:10:45 +0200 Message-ID: <20240418101056.302103-3-thuth@redhat.com> In-Reply-To: <20240418101056.302103-1-thuth@redhat.com> References: <20240418101056.302103-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.719, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1713435187932100001 We need the latest fixes for the lcitool to be able to properly update our CentOS docker file to CentOS Stream 9. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Thomas Huth --- tests/lcitool/libvirt-ci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lcitool/libvirt-ci b/tests/lcitool/libvirt-ci index 77c800186f..cec6703971 160000 --- a/tests/lcitool/libvirt-ci +++ b/tests/lcitool/libvirt-ci @@ -1 +1 @@ -Subproject commit 77c800186f34b21be7660750577cc5582a914deb +Subproject commit cec67039719becbfbab866f9c23574f389cf9559 --=20 2.44.0 From nobody Wed May 15 19:15:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1713435113; cv=none; d=zohomail.com; s=zohoarc; b=Xs9C5ujmssyGyH20zEQAAu35r/pHd5x+FifRpo50pnP4NxO39/Rl/iFEexCOqvGTbn9o7xMUYASsp7tbLXoYGOga91/mSSS371C49Vr66DZNMKrXt+ZRPuv/vBw7eBJ4SsSftNRFQepe+jmDo46lV7Hj7vUzQSoeag6fPqbAMaA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713435113; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=C+mMh8sJGjdssWu/ZSz9ZKsky0Nm3yIRjCLcFsKJ27w=; b=ZVihMO6XAbaZoZvPL7+z/tKWxm7XWGcSrmJG/xM3shp8zrflWjW38MSvVSnG2/8oWXcLZhujAU6UAccI4cj3T+AsxgjxXayZNZc/7jcAVSQfPLu5bFYKEuWFYWNdDNXtOH6Vczg1QzYYxfdJzdqrEL6/8F0yBsuXTCXlDC1RFj4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1713435113061246.10794860508622; Thu, 18 Apr 2024 03:11:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxOjh-0001Mg-Bq; Thu, 18 Apr 2024 06:11:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOje-0001La-88 for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOjb-0004pA-Jf for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:17 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-515-39srSbzZMG-7HJ87QeCh2Q-1; Thu, 18 Apr 2024 06:11:11 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D578E2815E26; Thu, 18 Apr 2024 10:11:10 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1126CC1A225; Thu, 18 Apr 2024 10:11:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713435074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C+mMh8sJGjdssWu/ZSz9ZKsky0Nm3yIRjCLcFsKJ27w=; b=CO6AizP8ILMNAuvTRVSODnJL6loL2DauoosCpPusBoOrFyimyeT2QLs0KnBb++V229t9zm O5f0/XiPKevHd0QGNmfy9t1UEaK4PxG9G0KU7L8gSqD/p9uGG38b1u5PLAJR+kDGQWz2to Rnu58AwENUyuPcSLIW/FVSTTnY8u8l0= X-MC-Unique: 39srSbzZMG-7HJ87QeCh2Q-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , Vladimir Sementsov-Ogievskiy , Peter Lieven , "Richard W.M. Jones" , Paolo Bonzini , qemu-devel@nongnu.org Cc: Kevin Wolf , Hanna Reitz , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Konstantin Kostiuk , qemu-block@nongnu.org Subject: [PATCH v3 03/13] tests/docker/dockerfiles: Run lcitool-refresh after the lcitool update Date: Thu, 18 Apr 2024 12:10:46 +0200 Message-ID: <20240418101056.302103-4-thuth@redhat.com> In-Reply-To: <20240418101056.302103-1-thuth@redhat.com> References: <20240418101056.302103-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.719, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1713435113726100005 This update adds the removing of the EXTERNALLY-MANAGED marker files that has been added to the lcitool recently. Quoting Daniel: "For those who don't know, python now commonly blocks the ability to run 'pip install' outside of a venv. This generally makes sense for a precious installation environment. Our containers are disposable though, so a venv has no benefit. Removing the 'EXTERNALLY-MANAGED' allows the historical arbitrary use of 'pip' outside a venv. lcitool just does this unconditionally given the containers are not precious." Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Thomas Huth --- tests/docker/dockerfiles/alpine.docker | 3 ++- tests/docker/dockerfiles/centos8.docker | 1 + tests/docker/dockerfiles/debian-amd64-cross.docker | 3 ++- tests/docker/dockerfiles/debian-arm64-cross.docker | 3 ++- tests/docker/dockerfiles/debian-armel-cross.docker | 3 ++- tests/docker/dockerfiles/debian-armhf-cross.docker | 3 ++- tests/docker/dockerfiles/debian-i686-cross.docker | 3 ++- tests/docker/dockerfiles/debian-mips64el-cross.docker | 3 ++- tests/docker/dockerfiles/debian-mipsel-cross.docker | 3 ++- tests/docker/dockerfiles/debian-ppc64el-cross.docker | 3 ++- tests/docker/dockerfiles/debian-riscv64-cross.docker | 3 ++- tests/docker/dockerfiles/debian-s390x-cross.docker | 3 ++- tests/docker/dockerfiles/debian.docker | 1 + tests/docker/dockerfiles/fedora-win64-cross.docker | 3 ++- tests/docker/dockerfiles/fedora.docker | 1 + tests/docker/dockerfiles/opensuse-leap.docker | 1 + tests/docker/dockerfiles/ubuntu2204.docker | 1 + 17 files changed, 29 insertions(+), 12 deletions(-) diff --git a/tests/docker/dockerfiles/alpine.docker b/tests/docker/dockerfi= les/alpine.docker index 42f6928627..cd9d7af1ce 100644 --- a/tests/docker/dockerfiles/alpine.docker +++ b/tests/docker/dockerfiles/alpine.docker @@ -116,7 +116,8 @@ RUN apk update && \ zlib-static \ zstd \ zstd-dev && \ - apk list | sort > /packages.txt && \ + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \ + apk list --installed | sort > /packages.txt && \ mkdir -p /usr/libexec/ccache-wrappers && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/c++ && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \ diff --git a/tests/docker/dockerfiles/centos8.docker b/tests/docker/dockerf= iles/centos8.docker index d97c30e96a..ea618bf352 100644 --- a/tests/docker/dockerfiles/centos8.docker +++ b/tests/docker/dockerfiles/centos8.docker @@ -123,6 +123,7 @@ RUN dnf distro-sync -y && \ zstd && \ dnf autoremove -y && \ dnf clean all -y && \ + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \ rpm -qa | sort > /packages.txt && \ mkdir -p /usr/libexec/ccache-wrappers && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/c++ && \ diff --git a/tests/docker/dockerfiles/debian-amd64-cross.docker b/tests/doc= ker/dockerfiles/debian-amd64-cross.docker index 00bdc06021..d0b0e9778e 100644 --- a/tests/docker/dockerfiles/debian-amd64-cross.docker +++ b/tests/docker/dockerfiles/debian-amd64-cross.docker @@ -64,7 +64,8 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \ - dpkg-reconfigure locales + dpkg-reconfigure locales && \ + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED =20 ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV LANG "en_US.UTF-8" diff --git a/tests/docker/dockerfiles/debian-arm64-cross.docker b/tests/doc= ker/dockerfiles/debian-arm64-cross.docker index 2dae3777f7..8cb225740e 100644 --- a/tests/docker/dockerfiles/debian-arm64-cross.docker +++ b/tests/docker/dockerfiles/debian-arm64-cross.docker @@ -64,7 +64,8 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \ - dpkg-reconfigure locales + dpkg-reconfigure locales && \ + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED =20 ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV LANG "en_US.UTF-8" diff --git a/tests/docker/dockerfiles/debian-armel-cross.docker b/tests/doc= ker/dockerfiles/debian-armel-cross.docker index 75342c09b0..e6f37418ed 100644 --- a/tests/docker/dockerfiles/debian-armel-cross.docker +++ b/tests/docker/dockerfiles/debian-armel-cross.docker @@ -65,7 +65,8 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \ - dpkg-reconfigure locales + dpkg-reconfigure locales && \ + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED =20 RUN /usr/bin/pip3 install tomli =20 diff --git a/tests/docker/dockerfiles/debian-armhf-cross.docker b/tests/doc= ker/dockerfiles/debian-armhf-cross.docker index 180ed836e6..407a014f57 100644 --- a/tests/docker/dockerfiles/debian-armhf-cross.docker +++ b/tests/docker/dockerfiles/debian-armhf-cross.docker @@ -64,7 +64,8 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \ - dpkg-reconfigure locales + dpkg-reconfigure locales && \ + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED =20 ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV LANG "en_US.UTF-8" diff --git a/tests/docker/dockerfiles/debian-i686-cross.docker b/tests/dock= er/dockerfiles/debian-i686-cross.docker index 3fc4e15acd..bdc9566b67 100644 --- a/tests/docker/dockerfiles/debian-i686-cross.docker +++ b/tests/docker/dockerfiles/debian-i686-cross.docker @@ -65,7 +65,8 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \ - dpkg-reconfigure locales + dpkg-reconfigure locales && \ + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED =20 RUN /usr/bin/pip3 install tomli =20 diff --git a/tests/docker/dockerfiles/debian-mips64el-cross.docker b/tests/= docker/dockerfiles/debian-mips64el-cross.docker index 17d3e01ecc..4d995d0b12 100644 --- a/tests/docker/dockerfiles/debian-mips64el-cross.docker +++ b/tests/docker/dockerfiles/debian-mips64el-cross.docker @@ -65,7 +65,8 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \ - dpkg-reconfigure locales + dpkg-reconfigure locales && \ + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED =20 RUN /usr/bin/pip3 install tomli =20 diff --git a/tests/docker/dockerfiles/debian-mipsel-cross.docker b/tests/do= cker/dockerfiles/debian-mipsel-cross.docker index 5fcd641f15..0cf803bda5 100644 --- a/tests/docker/dockerfiles/debian-mipsel-cross.docker +++ b/tests/docker/dockerfiles/debian-mipsel-cross.docker @@ -65,7 +65,8 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \ - dpkg-reconfigure locales + dpkg-reconfigure locales && \ + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED =20 RUN /usr/bin/pip3 install tomli =20 diff --git a/tests/docker/dockerfiles/debian-ppc64el-cross.docker b/tests/d= ocker/dockerfiles/debian-ppc64el-cross.docker index d6be2f0cc5..6180ec08c3 100644 --- a/tests/docker/dockerfiles/debian-ppc64el-cross.docker +++ b/tests/docker/dockerfiles/debian-ppc64el-cross.docker @@ -64,7 +64,8 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \ - dpkg-reconfigure locales + dpkg-reconfigure locales && \ + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED =20 ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV LANG "en_US.UTF-8" diff --git a/tests/docker/dockerfiles/debian-riscv64-cross.docker b/tests/d= ocker/dockerfiles/debian-riscv64-cross.docker index a26637ec4f..591572ae94 100644 --- a/tests/docker/dockerfiles/debian-riscv64-cross.docker +++ b/tests/docker/dockerfiles/debian-riscv64-cross.docker @@ -33,7 +33,8 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \ - dpkg-reconfigure locales + dpkg-reconfigure locales && \ + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED =20 ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV LANG "en_US.UTF-8" diff --git a/tests/docker/dockerfiles/debian-s390x-cross.docker b/tests/doc= ker/dockerfiles/debian-s390x-cross.docker index ec0041d6aa..90c8d3c7b8 100644 --- a/tests/docker/dockerfiles/debian-s390x-cross.docker +++ b/tests/docker/dockerfiles/debian-s390x-cross.docker @@ -64,7 +64,8 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \ - dpkg-reconfigure locales + dpkg-reconfigure locales && \ + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED =20 ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV LANG "en_US.UTF-8" diff --git a/tests/docker/dockerfiles/debian.docker b/tests/docker/dockerfi= les/debian.docker index b5e642d5b6..5722482e4c 100644 --- a/tests/docker/dockerfiles/debian.docker +++ b/tests/docker/dockerfiles/debian.docker @@ -137,6 +137,7 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ eatmydata apt-get autoclean -y && \ sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \ dpkg-reconfigure locales && \ + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \ dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --sh= ow > /packages.txt && \ mkdir -p /usr/libexec/ccache-wrappers && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/c++ && \ diff --git a/tests/docker/dockerfiles/fedora-win64-cross.docker b/tests/doc= ker/dockerfiles/fedora-win64-cross.docker index f8e4cb70d3..d1a480fa71 100644 --- a/tests/docker/dockerfiles/fedora-win64-cross.docker +++ b/tests/docker/dockerfiles/fedora-win64-cross.docker @@ -64,7 +64,8 @@ exec "$@"\n' > /usr/bin/nosync && \ xorriso \ zstd && \ nosync dnf autoremove -y && \ - nosync dnf clean all -y + nosync dnf clean all -y && \ + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED =20 ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV LANG "en_US.UTF-8" diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfi= les/fedora.docker index 9e9c71fa94..7e6ab0308a 100644 --- a/tests/docker/dockerfiles/fedora.docker +++ b/tests/docker/dockerfiles/fedora.docker @@ -137,6 +137,7 @@ exec "$@"\n' > /usr/bin/nosync && \ zstd && \ nosync dnf autoremove -y && \ nosync dnf clean all -y && \ + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \ rpm -qa | sort > /packages.txt && \ mkdir -p /usr/libexec/ccache-wrappers && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/c++ && \ diff --git a/tests/docker/dockerfiles/opensuse-leap.docker b/tests/docker/d= ockerfiles/opensuse-leap.docker index cf753383a4..c4055bdd10 100644 --- a/tests/docker/dockerfiles/opensuse-leap.docker +++ b/tests/docker/dockerfiles/opensuse-leap.docker @@ -119,6 +119,7 @@ RUN zypper update -y && \ zlib-devel-static \ zstd && \ zypper clean --all && \ + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \ rpm -qa | sort > /packages.txt && \ mkdir -p /usr/libexec/ccache-wrappers && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/c++ && \ diff --git a/tests/docker/dockerfiles/ubuntu2204.docker b/tests/docker/dock= erfiles/ubuntu2204.docker index 2ca9cff79c..b8e78331db 100644 --- a/tests/docker/dockerfiles/ubuntu2204.docker +++ b/tests/docker/dockerfiles/ubuntu2204.docker @@ -137,6 +137,7 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ eatmydata apt-get autoclean -y && \ sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \ dpkg-reconfigure locales && \ + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \ dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --sh= ow > /packages.txt && \ mkdir -p /usr/libexec/ccache-wrappers && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/c++ && \ --=20 2.44.0 From nobody Wed May 15 19:15:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1713435175; cv=none; d=zohomail.com; s=zohoarc; b=RV99qr+JXw4MIxGJxJjoaRho9MOaqMT3dSr7RVeGe0/EGsAKw9wZZVEL81pNGCX+ZNT0tF0I2ePX0NojCXzqZtK4Ga0oGOI1ajHc9GXa+r1JLQBExV6SAVulQXcbCTzu3i5XGNWWh7+jLPgFl10t9CT/7snUzcrKllw7PiG2Brg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713435175; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=e3eepoYPtjBwP7SfAzDw9VQBe1SWH7zMQj1eu7pkiwU=; b=h1WOFSzWttDlHk5kT51wLlwMCQHVs2SMwi44PutCqlho9V6Rvw21dad/trDYR1E5CPElz8ci0fMi7yiHVuIqoV94uYhmj+I4Xe6vKj7ukaH1Rc0CSioE7mn05qJqL6B2kXE9CyTmiwNfPMxZbHEGB7LpBzl0O01bTljit78D1b4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1713435174994438.71880802635053; Thu, 18 Apr 2024 03:12:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxOjm-0001Ot-NF; Thu, 18 Apr 2024 06:11:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOji-0001Mq-AT for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOjf-0004pw-GO for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:21 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-655-tfXQcPvSNZ-dpLAaQ3GPUQ-1; Thu, 18 Apr 2024 06:11:15 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B8EF53C1014C; Thu, 18 Apr 2024 10:11:14 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4AF67C1A225; Thu, 18 Apr 2024 10:11:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713435077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e3eepoYPtjBwP7SfAzDw9VQBe1SWH7zMQj1eu7pkiwU=; b=XsVab9sXnMQ9rhgCYeVNa/25pINXq/doYX+uFzUOs/VsNC399eLQc5oPpD7vGCXmzckIoC AdC9ywFNgG0xoX4TQpWEErKfTt/3Et+Wem8apoVmKr348/SEUDyUCjYmDYrJWvqjEbZjd6 S7CBS39DdsTTk3CTRG1kWruTcqr1Q+4= X-MC-Unique: tfXQcPvSNZ-dpLAaQ3GPUQ-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , Vladimir Sementsov-Ogievskiy , Peter Lieven , "Richard W.M. Jones" , Paolo Bonzini , qemu-devel@nongnu.org Cc: Kevin Wolf , Hanna Reitz , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Konstantin Kostiuk , qemu-block@nongnu.org Subject: [PATCH v3 04/13] tests: Update our CI to use CentOS Stream 9 instead of 8 Date: Thu, 18 Apr 2024 12:10:47 +0200 Message-ID: <20240418101056.302103-5-thuth@redhat.com> In-Reply-To: <20240418101056.302103-1-thuth@redhat.com> References: <20240418101056.302103-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.719, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1713435176038100005 RHEL 9 (and thus also the derivatives) are available since two years now, so according to QEMU's support policy, we can drop the active support for the previous major version 8 now. Another reason for doing this is that Centos Stream 8 will go EOL soon: https://blog.centos.org/2023/04/end-dates-are-coming-for-centos-stream-8-an= d-centos-linux-7/ "After May 31, 2024, CentOS Stream 8 will be archived and no further updates will be provided." Thus upgrade our CentOS Stream container to major version 9 now. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Thomas Huth --- .gitlab-ci.d/buildtest.yml | 16 ++++----- .gitlab-ci.d/container-core.yml | 4 +-- .../{centos8.docker =3D> centos9.docker} | 34 +++++++------------ tests/lcitool/mappings.yml | 20 ----------- tests/lcitool/refresh | 2 +- tests/vm/centos | 4 +-- 6 files changed, 26 insertions(+), 54 deletions(-) rename tests/docker/dockerfiles/{centos8.docker =3D> centos9.docker} (82%) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index cfdff175c3..9f34c650d6 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -158,9 +158,9 @@ build-system-centos: - .native_build_job_template - .native_build_artifact_template needs: - job: amd64-centos8-container + job: amd64-centos9-container variables: - IMAGE: centos8 + IMAGE: centos9 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-vfio-user-se= rver --enable-modules --enable-trace-backends=3Ddtrace --enable-docs TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu @@ -242,7 +242,7 @@ check-system-centos: - job: build-system-centos artifacts: true variables: - IMAGE: centos8 + IMAGE: centos9 MAKE_CHECK_ARGS: check =20 avocado-system-centos: @@ -251,7 +251,7 @@ avocado-system-centos: - job: build-system-centos artifacts: true variables: - IMAGE: centos8 + IMAGE: centos9 MAKE_CHECK_ARGS: check-avocado AVOCADO_TAGS: arch:ppc64 arch:or1k arch:s390x arch:x86_64 arch:rx arch:sh4 arch:nios2 @@ -327,9 +327,9 @@ avocado-system-flaky: build-tcg-disabled: extends: .native_build_job_template needs: - job: amd64-centos8-container + job: amd64-centos9-container variables: - IMAGE: centos8 + IMAGE: centos9 script: - mkdir build - cd build @@ -651,9 +651,9 @@ build-tci: build-without-defaults: extends: .native_build_job_template needs: - job: amd64-centos8-container + job: amd64-centos9-container variables: - IMAGE: centos8 + IMAGE: centos9 CONFIGURE_ARGS: --without-default-devices --without-default-features diff --git a/.gitlab-ci.d/container-core.yml b/.gitlab-ci.d/container-core.= yml index 08f8450fa1..5459447676 100644 --- a/.gitlab-ci.d/container-core.yml +++ b/.gitlab-ci.d/container-core.yml @@ -1,10 +1,10 @@ include: - local: '/.gitlab-ci.d/container-template.yml' =20 -amd64-centos8-container: +amd64-centos9-container: extends: .container_job_template variables: - NAME: centos8 + NAME: centos9 =20 amd64-fedora-container: extends: .container_job_template diff --git a/tests/docker/dockerfiles/centos8.docker b/tests/docker/dockerf= iles/centos9.docker similarity index 82% rename from tests/docker/dockerfiles/centos8.docker rename to tests/docker/dockerfiles/centos9.docker index ea618bf352..6cf47ce786 100644 --- a/tests/docker/dockerfiles/centos8.docker +++ b/tests/docker/dockerfiles/centos9.docker @@ -1,15 +1,14 @@ # THIS FILE WAS AUTO-GENERATED # -# $ lcitool dockerfile --layers all centos-stream-8 qemu +# $ lcitool dockerfile --layers all centos-stream-9 qemu # # https://gitlab.com/libvirt/libvirt-ci =20 -FROM quay.io/centos/centos:stream8 +FROM quay.io/centos/centos:stream9 =20 RUN dnf distro-sync -y && \ dnf install 'dnf-command(config-manager)' -y && \ - dnf config-manager --set-enabled -y powertools && \ - dnf install -y centos-release-advanced-virtualization && \ + dnf config-manager --set-enabled -y crb && \ dnf install -y epel-release && \ dnf install -y epel-next-release && \ dnf install -y \ @@ -42,7 +41,6 @@ RUN dnf distro-sync -y && \ glib2-static \ glibc-langpack-en \ glibc-static \ - glusterfs-api-devel \ gnutls-devel \ gtk3-devel \ hostname \ @@ -82,6 +80,7 @@ RUN dnf distro-sync -y && \ lzo-devel \ make \ mesa-libgbm-devel \ + meson \ mtools \ ncurses-devel \ nettle-devel \ @@ -95,25 +94,25 @@ RUN dnf distro-sync -y && \ pixman-devel \ pkgconfig \ pulseaudio-libs-devel \ - python38 \ - python38-PyYAML \ - python38-numpy \ - python38-pip \ - python38-setuptools \ - python38-wheel \ + python3 \ + python3-PyYAML \ + python3-numpy \ + python3-pillow \ + python3-pip \ + python3-sphinx \ + python3-sphinx_rtd_theme \ + python3-tomli \ rdma-core-devel \ sed \ snappy-devel \ socat \ spice-protocol \ - spice-server-devel \ swtpm \ systemd-devel \ systemtap-sdt-devel \ tar \ usbredir-devel \ util-linux \ - virglrenderer-devel \ vte291-devel \ which \ xfsprogs-devel \ @@ -132,18 +131,11 @@ RUN dnf distro-sync -y && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc =20 -RUN /usr/bin/pip3.8 install \ - meson=3D=3D0.63.2 \ - pillow \ - sphinx \ - sphinx-rtd-theme \ - tomli - ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" ENV NINJA "/usr/bin/ninja" -ENV PYTHON "/usr/bin/python3.8" +ENV PYTHON "/usr/bin/python3" # As a final step configure the user (if env is defined) ARG USER ARG UID diff --git a/tests/lcitool/mappings.yml b/tests/lcitool/mappings.yml index 407c03301b..03b974ad02 100644 --- a/tests/lcitool/mappings.yml +++ b/tests/lcitool/mappings.yml @@ -1,66 +1,50 @@ mappings: flake8: - CentOSStream8: OpenSUSELeap15: =20 meson: - CentOSStream8: OpenSUSELeap15: =20 python3: - CentOSStream8: python38 OpenSUSELeap15: python311-base =20 python3-PyYAML: - CentOSStream8: python38-PyYAML OpenSUSELeap15: =20 python3-devel: - CentOSStream8: python38-devel OpenSUSELeap15: python311-devel =20 python3-docutils: - CentOSStream8: OpenSUSELeap15: =20 python3-numpy: - CentOSStream8: python38-numpy OpenSUSELeap15: =20 python3-opencv: - CentOSStream8: OpenSUSELeap15: =20 python3-pillow: - CentOSStream8: OpenSUSELeap15: =20 python3-pip: - CentOSStream8: python38-pip OpenSUSELeap15: python311-pip =20 python3-pillow: - CentOSStream8: OpenSUSELeap15: =20 python3-selinux: - CentOSStream8: OpenSUSELeap15: =20 python3-setuptools: - CentOSStream8: python38-setuptools OpenSUSELeap15: python311-setuptools =20 python3-sphinx: - CentOSStream8: OpenSUSELeap15: =20 python3-sphinx-rtd-theme: - CentOSStream8: OpenSUSELeap15: =20 python3-sqlite3: - CentOSStream8: python38 OpenSUSELeap15: python311 =20 python3-tomli: @@ -69,15 +53,11 @@ mappings: Fedora: Debian12: OpenSUSELeap15: - # Not available for Python 3.8 - CentOSStream8: =20 python3-venv: - CentOSStream8: python38 OpenSUSELeap15: python311-base =20 python3-wheel: - CentOSStream8: python38-wheel OpenSUSELeap15: python311-pip =20 pypi_mappings: diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh index 692752a3df..24a735a3f2 100755 --- a/tests/lcitool/refresh +++ b/tests/lcitool/refresh @@ -125,7 +125,7 @@ try: # Standard native builds # generate_dockerfile("alpine", "alpine-318") - generate_dockerfile("centos8", "centos-stream-8") + generate_dockerfile("centos9", "centos-stream-9") generate_dockerfile("debian", "debian-12", trailer=3D"".join(debian12_extras)) generate_dockerfile("fedora", "fedora-38") diff --git a/tests/vm/centos b/tests/vm/centos index 097a9ca14d..d25c8f8b5b 100755 --- a/tests/vm/centos +++ b/tests/vm/centos @@ -26,8 +26,8 @@ class CentosVM(basevm.BaseVM): export SRC_ARCHIVE=3D/dev/vdb; sudo chmod a+r $SRC_ARCHIVE; tar -xf $SRC_ARCHIVE; - make docker-test-block@centos8 {verbose} J=3D{jobs} NETWORK=3D1; - make docker-test-quick@centos8 {verbose} J=3D{jobs} NETWORK=3D1; + make docker-test-block@centos9 {verbose} J=3D{jobs} NETWORK=3D1; + make docker-test-quick@centos9 {verbose} J=3D{jobs} NETWORK=3D1; """ =20 def build_image(self, img): --=20 2.44.0 From nobody Wed May 15 19:15:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1713435129; cv=none; d=zohomail.com; s=zohoarc; b=VGV+c/sOluBEVx9GUv7auZ/SzsTpcNWN9Qzodt09dpcGvjDmFsLUJQb5/GDU4RkmhNE2sLBDHbh97YNdTKG6yTQ46ZN/W4MOJE66wQIPByPc38ZXMh/aocnYuHx5dGEeN30xBxIkCCj+KXGSfhe0T1sV5TPXVz+/mES1zcAb7G0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713435129; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=v9r89ohkoXF9DDwUHGdT4Vb5jaDUA+Tx0fVSXQhVyfc=; b=H24yO4SK0PzwIbvRkCeVoMqnEysOLwaRKiGSLPTuYw9sccw9w4vu7aEOvIGreKHK7uVTuh8X7OobcZR50eYvg0SallA4PbSprMYpam7xW/D7l7CJnd+KutlKuMWVABO/1wjodwjSdRm+tNImChq+Mv/4QU4d3gTEKyP+qtKXXJw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1713435128936763.5437832402415; Thu, 18 Apr 2024 03:12:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxOjp-0001Rb-Sk; Thu, 18 Apr 2024 06:11:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOjm-0001Ow-Cf for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOjk-0004r0-A8 for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:25 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-558-o_z8MgvPM9WNbIlLEtiN4g-1; Thu, 18 Apr 2024 06:11:18 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 43C221C3F0E3; Thu, 18 Apr 2024 10:11:18 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 31106C1A225; Thu, 18 Apr 2024 10:11:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713435082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v9r89ohkoXF9DDwUHGdT4Vb5jaDUA+Tx0fVSXQhVyfc=; b=J2lL0ezgkXI0r2HfAb9TAyzaQi03Dvi8PxMbU/BnFaiSEQX3uWiefb7KrO7lK4CNkIsf+G +nmK2M887qcp73ur0HlibiHqF+pRpXrD2N4Ha7aoi964+YPaE0iOMNszYqyCFdhxaVjuFr kZQTxww6zI+Lj+ZhddK68gO0SVEL8KQ= X-MC-Unique: o_z8MgvPM9WNbIlLEtiN4g-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , Vladimir Sementsov-Ogievskiy , Peter Lieven , "Richard W.M. Jones" , Paolo Bonzini , qemu-devel@nongnu.org Cc: Kevin Wolf , Hanna Reitz , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Konstantin Kostiuk , qemu-block@nongnu.org Subject: [PATCH v3 05/13] .travis.yml: Update the jobs to Ubuntu 22.04 Date: Thu, 18 Apr 2024 12:10:48 +0200 Message-ID: <20240418101056.302103-6-thuth@redhat.com> In-Reply-To: <20240418101056.302103-1-thuth@redhat.com> References: <20240418101056.302103-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.719, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1713435129608100002 According to our support policy, we'll soon drop our official support for Ubuntu 20.04 ("Focal Fossa") in QEMU. Thus we should update the Travis jobs now to a newer release (Ubuntu 22.04 - "Jammy Jellyfish") for future testing. Since all jobs are using this release now, we can drop the entries from the individual jobs and use the global setting again. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Thomas Huth --- .travis.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8a3ae76a7c..56a2a01e14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ os: linux -dist: focal +dist: jammy language: c compiler: - gcc @@ -7,7 +7,7 @@ cache: # There is one cache per branch and compiler version. # characteristics of each job are used to identify the cache: # - OS name (currently only linux) - # - OS distribution (for Linux, bionic or focal) + # - OS distribution (e.g. "jammy" for Linux) # - Names and values of visible environment variables set in .travis.yml= or Settings panel timeout: 1200 ccache: true @@ -83,7 +83,6 @@ jobs: =20 - name: "[aarch64] GCC check-tcg" arch: arm64 - dist: focal addons: apt_packages: - libaio-dev @@ -119,7 +118,6 @@ jobs: =20 - name: "[ppc64] GCC check-tcg" arch: ppc64le - dist: focal addons: apt_packages: - libaio-dev @@ -154,7 +152,6 @@ jobs: =20 - name: "[s390x] GCC check-tcg" arch: s390x - dist: focal addons: apt_packages: - libaio-dev @@ -199,7 +196,6 @@ jobs: =20 - name: "[s390x] GCC (other-system)" arch: s390x - dist: focal addons: apt_packages: - libaio-dev @@ -229,7 +225,6 @@ jobs: =20 - name: "[s390x] GCC (user)" arch: s390x - dist: focal addons: apt_packages: - libgcrypt20-dev @@ -244,8 +239,7 @@ jobs: =20 - name: "[s390x] Clang (disable-tcg)" arch: s390x - dist: focal - compiler: clang-10 + compiler: clang addons: apt_packages: - libaio-dev @@ -271,7 +265,6 @@ jobs: - libvdeplug-dev - libvte-2.91-dev - ninja-build - - clang-10 env: - TEST_CMD=3D"make check-unit" - CONFIG=3D"--disable-containers --disable-tcg --enable-kvm --disa= ble-tools --=20 2.44.0 From nobody Wed May 15 19:15:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1713435208; cv=none; d=zohomail.com; s=zohoarc; b=CRY7TNnOAlW5B6Kfwb36j89qEFpWHMwYXUefFmp3p768EX1Qy2kbF6+Wsv4GvmbzYqKug6yC1L6H8yK20XI/LsF2AD9Drbvl+0beQy9u3NaZ9R6MMUqozRYSNSxbEOC5v1vP+i32wjxBRXs0ZKearuTCgk2lymPIaQlU8eNXxQI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713435208; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RjMb3Pg6/OUNtybxhe3hrJ32jglibhNx5G1TDCLq18w=; b=EXKZwGPP22CZJh2211YaFytiFA5RDw2OEjYfapdqNE224qln8VRs8ZsoDHV2HQBiXm/BzKGDd1rtGDbTMrnd1Ita8GoZ5vEuiZ8RHMsg4RCUmlUowoNe8KvqPPIBPuVrUVdIzDRRDsDFPWV2cB4OYftG3S/kYCNt41hwYSJ2my8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1713435208360189.24098728510353; Thu, 18 Apr 2024 03:13:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxOk5-0001eW-KE; Thu, 18 Apr 2024 06:11:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOk3-0001df-TP for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOk0-0004tO-F3 for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:43 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-670--D6wjPEqO8irBQzwtj3Rjw-1; Thu, 18 Apr 2024 06:11:36 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F07561049C9B; Thu, 18 Apr 2024 10:11:34 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id A5A57C1A225; Thu, 18 Apr 2024 10:11:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713435099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RjMb3Pg6/OUNtybxhe3hrJ32jglibhNx5G1TDCLq18w=; b=gU9j9VMdNS7CzeeHoAjF+wIvP4TBtNxT6lVdnxfdq9tHlWYbF841dJ3gOjsCxzR+5+TLJb BquzLSG3sRLoshpZiVIY3Bq4JZrAxCjCuTUu3RzONTsYjTSUQZCg4pz/t7q9KQcsClo5eW 4jHWvD3eY403tsw0bns8z7xr50X8Ijk= X-MC-Unique: -D6wjPEqO8irBQzwtj3Rjw-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , Vladimir Sementsov-Ogievskiy , Peter Lieven , "Richard W.M. Jones" , Paolo Bonzini , qemu-devel@nongnu.org Cc: Kevin Wolf , Hanna Reitz , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Konstantin Kostiuk , qemu-block@nongnu.org Subject: [PATCH v3 06/13] ci: move external build environment setups to CentOS Stream 9 Date: Thu, 18 Apr 2024 12:10:49 +0200 Message-ID: <20240418101056.302103-7-thuth@redhat.com> In-Reply-To: <20240418101056.302103-1-thuth@redhat.com> References: <20240418101056.302103-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.719, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1713435210005100001 From: Paolo Bonzini RHEL 9 (and thus also the derivatives) are available since two years now, so according to QEMU's support policy, we can drop the active support for the previous major version 8 now. Thus upgrade our CentOS Stream build environment playbooks to major version 9 now. Signed-off-by: Paolo Bonzini Reviewed-by: Thomas Huth Message-ID: <20240412103708.27650-1-pbonzini@redhat.com> Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Thomas Huth --- .../stream/{8 =3D> 9}/build-environment.yml | 31 ++++++------- .../stream/{8 =3D> 9}/x86_64/configure | 4 +- .../stream/{8 =3D> 9}/x86_64/test-avocado | 0 scripts/ci/setup/build-environment.yml | 44 +++++++------------ 4 files changed, 34 insertions(+), 45 deletions(-) rename scripts/ci/org.centos/stream/{8 =3D> 9}/build-environment.yml (75%) rename scripts/ci/org.centos/stream/{8 =3D> 9}/x86_64/configure (98%) rename scripts/ci/org.centos/stream/{8 =3D> 9}/x86_64/test-avocado (100%) diff --git a/scripts/ci/org.centos/stream/8/build-environment.yml b/scripts= /ci/org.centos/stream/9/build-environment.yml similarity index 75% rename from scripts/ci/org.centos/stream/8/build-environment.yml rename to scripts/ci/org.centos/stream/9/build-environment.yml index 1ead77e2cb..cd29fe6f27 100644 --- a/scripts/ci/org.centos/stream/8/build-environment.yml +++ b/scripts/ci/org.centos/stream/9/build-environment.yml @@ -2,32 +2,32 @@ - name: Installation of extra packages to build QEMU hosts: all tasks: - - name: Extra check for CentOS Stream 8 + - name: Extra check for CentOS Stream 9 lineinfile: path: /etc/redhat-release - line: CentOS Stream release 8 + line: CentOS Stream release 9 state: present check_mode: yes - register: centos_stream_8 + register: centos_stream_9 =20 - - name: Enable EPEL repo on CentOS Stream 8 + - name: Enable EPEL repo on CentOS Stream 9 dnf: name: - epel-release state: present when: - - centos_stream_8 + - centos_stream_9 =20 - - name: Enable PowerTools repo on CentOS Stream 8 + - name: Enable CRB repo on CentOS Stream 9 ini_file: - path: /etc/yum.repos.d/CentOS-Stream-PowerTools.repo - section: powertools + path: /etc/yum.repos.d/centos.repo + section: crb option: enabled value: "1" when: - - centos_stream_8 + - centos_stream_9 =20 - - name: Install basic packages to build QEMU on CentOS Stream 8 + - name: Install basic packages to build QEMU on CentOS Stream 9 dnf: name: - bzip2 @@ -42,7 +42,6 @@ - gettext - git - glib2-devel - - glusterfs-api-devel - gnutls-devel - libaio-devel - libcap-ng-devel @@ -61,22 +60,24 @@ - lzo-devel - make - mesa-libEGL-devel + - meson - nettle-devel - ninja-build - nmap-ncat - numactl-devel - pixman-devel - - python38 + - python3 + - python3-pip - python3-sphinx + - python3-sphinx_rtd_theme + - python3-tomli - rdma-core-devel - redhat-rpm-config - snappy-devel - - spice-glib-devel - - spice-server-devel - systemd-devel - systemtap-sdt-devel - tar - zlib-devel state: present when: - - centos_stream_8 + - centos_stream_9 diff --git a/scripts/ci/org.centos/stream/8/x86_64/configure b/scripts/ci/o= rg.centos/stream/9/x86_64/configure similarity index 98% rename from scripts/ci/org.centos/stream/8/x86_64/configure rename to scripts/ci/org.centos/stream/9/x86_64/configure index 76781f17f4..1b6f40fd78 100755 --- a/scripts/ci/org.centos/stream/8/x86_64/configure +++ b/scripts/ci/org.centos/stream/9/x86_64/configure @@ -16,7 +16,7 @@ # that patches adding downstream specific devices are not available. # ../configure \ ---python=3D/usr/bin/python3.8 \ +--python=3D/usr/bin/python3.9 \ --prefix=3D"/usr" \ --libdir=3D"/usr/lib64" \ --datadir=3D"/usr/share" \ @@ -157,7 +157,6 @@ --enable-docs \ --enable-fdt \ --enable-gcrypt \ ---enable-glusterfs \ --enable-gnutls \ --enable-guest-agent \ --enable-iconv \ @@ -180,7 +179,6 @@ --enable-seccomp \ --enable-snappy \ --enable-smartcard \ ---enable-spice \ --enable-system \ --enable-tcg \ --enable-tools \ diff --git a/scripts/ci/org.centos/stream/8/x86_64/test-avocado b/scripts/c= i/org.centos/stream/9/x86_64/test-avocado similarity index 100% rename from scripts/ci/org.centos/stream/8/x86_64/test-avocado rename to scripts/ci/org.centos/stream/9/x86_64/test-avocado diff --git a/scripts/ci/setup/build-environment.yml b/scripts/ci/setup/buil= d-environment.yml index f344d1a850..9b7d96c01b 100644 --- a/scripts/ci/setup/build-environment.yml +++ b/scripts/ci/setup/build-environment.yml @@ -174,26 +174,26 @@ - ansible_facts['distribution_version'] =3D=3D '22.04' - ansible_facts['architecture'] =3D=3D 'aarch64' =20 - - name: Enable EPEL repo on EL8 + - name: Enable EPEL repo on EL9 dnf: name: - epel-release state: present when: - ansible_facts['distribution_file_variety'] in ['RedHat', 'CentOS= '] - - ansible_facts['distribution_major_version'] =3D=3D '8' + - ansible_facts['distribution_major_version'] =3D=3D '9' =20 - - name: Enable PowerTools repo on CentOS 8 + - name: Enable CRB repo on CentOS 9 ini_file: - path: /etc/yum.repos.d/CentOS-Stream-PowerTools.repo - section: powertools + path: /etc/yum.repos.d/centos.repo + section: crb option: enabled value: "1" when: - ansible_facts['distribution_file_variety'] =3D=3D 'CentOS' - - ansible_facts['distribution_major_version'] =3D=3D '8' + - ansible_facts['distribution_major_version'] =3D=3D '9' =20 - - name: Install basic packages to build QEMU on EL8 + - name: Install basic packages to build QEMU on EL9 dnf: # This list of packages start with tests/docker/dockerfiles/centos= 8.docker # but only include files that are common to all distro variants an= d present @@ -211,7 +211,6 @@ - gettext - git - glib2-devel - - glusterfs-api-devel - gnutls-devel - libaio-devel - libcap-ng-devel @@ -229,17 +228,20 @@ - lzo-devel - make - mesa-libEGL-devel + - meson - nettle-devel - ninja-build - nmap-ncat - numactl-devel - pixman-devel - - python38 + - python3 + - python3-pip - python3-sphinx + - python3-sphinx_rtd_theme + - python3-tomli - rdma-core-devel - redhat-rpm-config - snappy-devel - - spice-glib-devel - systemd-devel - systemtap-sdt-devel - tar @@ -247,28 +249,16 @@ state: present when: - ansible_facts['distribution_file_variety'] in ['RedHat', 'CentOS= '] - - ansible_facts['distribution_version'] =3D=3D '8' - - - name: Install packages only available on x86 and aarch64 - dnf: - # Spice server not available in ppc64le - name: - - spice-server - - spice-server-devel - state: present - when: - - ansible_facts['distribution_file_variety'] in ['RedHat', 'CentOS= '] - - ansible_facts['distribution_version'] =3D=3D '8' - - ansible_facts['architecture'] =3D=3D 'aarch64' or ansible_facts[= 'architecture'] =3D=3D 'x86_64' + - ansible_facts['distribution_version'] =3D=3D '9' =20 - name: Check whether the Python runtime version is managed by alterna= tives stat: path: /etc/alternatives/python3 register: python3 =20 - - name: Set default Python runtime to 3.8 on EL8 - command: alternatives --set python3 /usr/bin/python3.8 + - name: Set default Python runtime to 3.9 on EL9 + command: alternatives --set python3 /usr/bin/python3.9 when: - ansible_facts['distribution_file_variety'] in ['RedHat', 'CentOS= '] - - ansible_facts['distribution_version'] =3D=3D '8' - - python3.stat.islnk and python3.stat.lnk_target !=3D '/usr/bin/py= thon3.8' + - ansible_facts['distribution_version'] =3D=3D '9' + - python3.stat.exists and python3.stat.islnk and python3.stat.lnk_= target !=3D '/usr/bin/python3.9' --=20 2.44.0 From nobody Wed May 15 19:15:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1713435232; cv=none; d=zohomail.com; s=zohoarc; b=jHaUzTe4WPzHtFqoJrogDsAaEkommEVgGBt0W/h3nW6+3d5EC+S7KA3aXKw0uH5Z+F5S9fFrrBPoHRd9c6uUoOSPJF2mjTFDRmKpQlfO6hDzQRxmuNuXbZKiwGPesIplWETmNI+Y8Dl1uZj9M3DxwYVQ4JcCFoa1xYAURIqTtps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713435232; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MhtouUqqye7q6PlBmUe1x2ANsRy3/FjDuF8x6a48zZQ=; b=J/a93H1L7rqO8fIyrQKUrin5CzJ1xlyCz47aXITbNztUh64lqZHM3H0Z01RnGvhdygU5W1DRtpzpzSsSyXXoWFjmrtIVP1BRFcoDy0SWts2SHU7+1T1zz1mcpYVmy/Ug5IENPuN9mfs1lGbVPF76B3yCcgP2Ke4lty/rTdkYp8s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1713435232579394.3659451995452; Thu, 18 Apr 2024 03:13:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxOk4-0001dh-12; Thu, 18 Apr 2024 06:11:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOk2-0001cf-3A for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOk0-0004tH-EJ for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:41 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-346-V0E_OjYjNFO5Nbm02hDYXw-1; Thu, 18 Apr 2024 06:11:36 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AA40F81384D; Thu, 18 Apr 2024 10:11:35 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A9FDC271B7; Thu, 18 Apr 2024 10:11:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713435099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MhtouUqqye7q6PlBmUe1x2ANsRy3/FjDuF8x6a48zZQ=; b=e2us3JLL4SUGxEQxlltSvtmtvk6TMfMJEWwN62Wyu7wezAaWHRhsTtFjTt6HRlcCPwMsKe VNXEOaThaO6sA3Jwl5JQ0tQWb5cR+wdzAxYhrS5eOGTIlNfmrNOGS3ya3whYWTWZc0Aurz YK7lTIlaDbyPrzv6oyZ+A9u8jzfl7GA= X-MC-Unique: V0E_OjYjNFO5Nbm02hDYXw-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , Vladimir Sementsov-Ogievskiy , Peter Lieven , "Richard W.M. Jones" , Paolo Bonzini , qemu-devel@nongnu.org Cc: Kevin Wolf , Hanna Reitz , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Konstantin Kostiuk , qemu-block@nongnu.org Subject: [PATCH v3 07/13] Bump minimum glib version to v2.66 Date: Thu, 18 Apr 2024 12:10:50 +0200 Message-ID: <20240418101056.302103-8-thuth@redhat.com> In-Reply-To: <20240418101056.302103-1-thuth@redhat.com> References: <20240418101056.302103-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.719, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1713435234066100001 Now that we dropped support for CentOS 8 and Ubuntu 20.04, we can look into bumping the glib version to a new minimum for further clean-ups. According to repology.org, available versions are: CentOS Stream 9: 2.66.7 Debian 11: 2.66.8 Fedora 38: 2.74.1 Freebsd: 2.78.4 Homebrew: 2.80.0 Openbsd: 2.78.4 OpenSuse leap 15.5: 2.70.5 pkgsrc_current: 2.78.4 Ubuntu 22.04: 2.72.1 Thus it should be safe to bump the minimum glib version to 2.66 now. Version 2.66 comes with new functions for URI parsing which will allow further clean-ups in the following patches. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Thomas Huth --- meson.build | 16 +--------------- include/glib-compat.h | 27 ++------------------------- qga/commands-posix-ssh.c | 4 ++-- 3 files changed, 5 insertions(+), 42 deletions(-) diff --git a/meson.build b/meson.build index 91a0aa64c6..142bafab61 100644 --- a/meson.build +++ b/meson.build @@ -869,7 +869,7 @@ have_xen_pci_passthrough =3D get_option('xen_pci_passth= rough') \ =20 # When bumping glib minimum version, please check also whether to increase # the _WIN32_WINNT setting in osdep.h according to the value from glib -glib_req_ver =3D '>=3D2.56.0' +glib_req_ver =3D '>=3D2.66.0' glib_pc =3D dependency('glib-2.0', version: glib_req_ver, required: true, method: 'pkg-config') glib_cflags =3D [] @@ -910,20 +910,6 @@ if not cc.compiles(''' to the right pkg-config files for your build target.''') endif =20 -# Silence clang warnings triggered by glib < 2.57.2 -if not cc.compiles(''' - #include - typedef struct Foo { - int i; - } Foo; - static void foo_free(Foo *f) - { - g_free(f); - } - G_DEFINE_AUTOPTR_CLEANUP_FUNC(Foo, foo_free) - int main(void) { return 0; }''', dependencies: glib_pc, args: ['-Wunused= -function', '-Werror']) - glib_cflags +=3D cc.get_supported_arguments('-Wno-unused-function') -endif glib =3D declare_dependency(dependencies: [glib_pc, gmodule], compile_args: glib_cflags, version: glib_pc.version()) diff --git a/include/glib-compat.h b/include/glib-compat.h index 43a562974d..86be439ba0 100644 --- a/include/glib-compat.h +++ b/include/glib-compat.h @@ -19,12 +19,12 @@ /* Ask for warnings for anything that was marked deprecated in * the defined version, or before. It is a candidate for rewrite. */ -#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_56 +#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_66 =20 /* Ask for warnings if code tries to use function that did not * exist in the defined version. These risk breaking builds */ -#define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_2_56 +#define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_2_66 =20 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" @@ -105,29 +105,6 @@ static inline gpointer g_memdup2_qemu(gconstpointer me= m, gsize byte_size) } #define g_memdup2(m, s) g_memdup2_qemu(m, s) =20 -#if defined(G_OS_UNIX) -/* - * Note: The fallback implementation is not MT-safe, and it returns a copy= of - * the libc passwd (must be g_free() after use) but not the content. Becau= se of - * these important differences the caller must be aware of, it's not #defi= ne for - * GLib API substitution. - */ -static inline struct passwd * -g_unix_get_passwd_entry_qemu(const gchar *user_name, GError **error) -{ -#if GLIB_CHECK_VERSION(2, 64, 0) - return g_unix_get_passwd_entry(user_name, error); -#else - struct passwd *p =3D getpwnam(user_name); - if (!p) { - g_set_error_literal(error, G_UNIX_ERROR, 0, g_strerror(errno)); - return NULL; - } - return (struct passwd *)g_memdup(p, sizeof(*p)); -#endif -} -#endif /* G_OS_UNIX */ - static inline bool qemu_g_test_slow(void) { diff --git a/qga/commands-posix-ssh.c b/qga/commands-posix-ssh.c index 236f80de44..b0e0b1d674 100644 --- a/qga/commands-posix-ssh.c +++ b/qga/commands-posix-ssh.c @@ -35,7 +35,7 @@ test_get_passwd_entry(const gchar *user_name, GError **er= ror) return p; } =20 -#define g_unix_get_passwd_entry_qemu(username, err) \ +#define g_unix_get_passwd_entry(username, err) \ test_get_passwd_entry(username, err) #endif =20 @@ -45,7 +45,7 @@ get_passwd_entry(const char *username, Error **errp) g_autoptr(GError) err =3D NULL; struct passwd *p; =20 - p =3D g_unix_get_passwd_entry_qemu(username, &err); + p =3D g_unix_get_passwd_entry(username, &err); if (p =3D=3D NULL) { error_setg(errp, "failed to lookup user '%s': %s", username, err->message); --=20 2.44.0 From nobody Wed May 15 19:15:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1713435175; cv=none; d=zohomail.com; s=zohoarc; b=PYjqA5/RuR3WbSAPQ4D5Q2PIYfG83TWY7hX8oV06lTUERGDmVjiIBVmUKSy+QxYxLYsTNejSD7LoJbcQaIDu4k+MXAeFy7lB0aR+aNgRp20RqFCjQZ+yOKsoq/+x69RFlC5/iwZTt/cwqm5NKvRpy1e8EjuWl+2PitEhNvFfors= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713435175; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=n74ZHL7EK3XF7NDi4XnwnYA/67ic+xr/yA0vlDR0ey8=; b=Vl3UEaZC0aJeeMpUs9sIqQ1rEBzWeWfTMmTJYLA5JWU6NoOkCRuGfUgsVD2iUtUELWHU138qPxmXbzdG8PKDXUEPJAwLsgoJqiyQI72XsjGMF7rSA/T4wc9pmXK/oBFxgBd7tjeqhQn6+dxeLjxVXhKQPuFX39mZosrhY1jkM78= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17134351750921006.4697470161676; Thu, 18 Apr 2024 03:12:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxOk7-0001g1-Pk; Thu, 18 Apr 2024 06:11:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOk5-0001eP-F1 for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOk3-0004ty-Tp for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:45 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-381-riL_0EbzMeevlUNoXj2L6w-1; Thu, 18 Apr 2024 06:11:39 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 83418830E85; Thu, 18 Apr 2024 10:11:39 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2D4C8C1A225; Thu, 18 Apr 2024 10:11:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713435103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n74ZHL7EK3XF7NDi4XnwnYA/67ic+xr/yA0vlDR0ey8=; b=dDHDWEEKNCe+fhQ5JibGLr5YL4HxtELuiSmtobLHnilKVSdNOc+LDhr0c74TjewoZprhNN FclFzAB4RzJ/yj+/sNYXCdrliznPKKw1W4cSlzEFMjCZEWdBTiXCLD0VG0fDF3FM7bSvgn 7xvk/zOs3faudV32N1ocLijcTEim260= X-MC-Unique: riL_0EbzMeevlUNoXj2L6w-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , Vladimir Sementsov-Ogievskiy , Peter Lieven , "Richard W.M. Jones" , Paolo Bonzini , qemu-devel@nongnu.org Cc: Kevin Wolf , Hanna Reitz , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Konstantin Kostiuk , qemu-block@nongnu.org Subject: [PATCH v3 08/13] Remove glib compatibility code that is not required anymore Date: Thu, 18 Apr 2024 12:10:51 +0200 Message-ID: <20240418101056.302103-9-thuth@redhat.com> In-Reply-To: <20240418101056.302103-1-thuth@redhat.com> References: <20240418101056.302103-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.719, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1713435175995100004 Now that we bumped the minumum glib version to 2.66, we can drop the old code. Suggested-by: Paolo Bonzini Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Thomas Huth --- qga/commands-posix-ssh.c | 8 -------- util/error-report.c | 10 ---------- 2 files changed, 18 deletions(-) diff --git a/qga/commands-posix-ssh.c b/qga/commands-posix-ssh.c index b0e0b1d674..cc1f5a708e 100644 --- a/qga/commands-posix-ssh.c +++ b/qga/commands-posix-ssh.c @@ -288,7 +288,6 @@ qmp_guest_ssh_get_authorized_keys(const char *username,= Error **errp) } =20 #ifdef QGA_BUILD_UNIT_TEST -#if GLIB_CHECK_VERSION(2, 60, 0) static const strList test_key2 =3D { .value =3D (char *)"algo key2 comments" }; @@ -484,11 +483,4 @@ int main(int argc, char *argv[]) =20 return g_test_run(); } -#else -int main(int argc, char *argv[]) -{ - g_test_message("test skipped, needs glib >=3D 2.60"); - return 0; -} -#endif /* GLIB_2_60 */ #endif /* BUILD_UNIT_TEST */ diff --git a/util/error-report.c b/util/error-report.c index 6e44a55732..1b17c11de1 100644 --- a/util/error-report.c +++ b/util/error-report.c @@ -172,18 +172,8 @@ static void print_loc(void) static char * real_time_iso8601(void) { -#if GLIB_CHECK_VERSION(2,62,0) g_autoptr(GDateTime) dt =3D g_date_time_new_now_utc(); - /* ignore deprecation warning, since GLIB_VERSION_MAX_ALLOWED is 2.56 = */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" return g_date_time_format_iso8601(dt); -#pragma GCC diagnostic pop -#else - GTimeVal tv; - g_get_current_time(&tv); - return g_time_val_to_iso8601(&tv); -#endif } =20 /* --=20 2.44.0 From nobody Wed May 15 19:15:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1713435187; cv=none; d=zohomail.com; s=zohoarc; b=iLO1xeWgNYsfGmc8gNu4zSqcPZ6nEeMRwk5ECKh2LlJYEFs8iG7X4QSGGMzkuAVwydetwHy+lPQPdz8/UkeIWvKx6c06fjlzGUjMApGuhLXvW0iONtncS2DAOS6541jZNLTcUUL+SKYmTa4KcHRfYiWvbXHnMsmrDYQwBB8tnwg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713435187; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lMSlSFcYeK8hInpdrU6Bwba7std9sqSqnsjh+sWoVLw=; b=Pu8KwgDaVhC3TRcEJYZmBqO7OTryb8cGMlH/IZDkv1r/rG2tms57JMEfYLD88StU8mPMVjxNTrGKGg3dlD7g6BrRd+m6LMh6kcRdUjDRk/xX2yZwqxxISOPusyKuBHCRG25PqhIKzhW6mCGo0JKu/tLiu/DGIg39YOIbVTtgzLs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1713435187366711.1826109489116; Thu, 18 Apr 2024 03:13:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxOkC-0001sb-MM; Thu, 18 Apr 2024 06:11:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOk8-0001gP-SG for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOk6-0004ug-SM for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:48 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-325-DAc8JY3dNBG_HYdfUQ1Stg-1; Thu, 18 Apr 2024 06:11:42 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 570C6104B502; Thu, 18 Apr 2024 10:11:42 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id C5C7BC1A225; Thu, 18 Apr 2024 10:11:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713435106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lMSlSFcYeK8hInpdrU6Bwba7std9sqSqnsjh+sWoVLw=; b=i/VYaB5juJ4NSuUNrQzgyr9RasZ3qJd5vtz06h6Tl/LwNVnBT3ZVWCmUyeFh9qfWd4o+y2 aherhXP1WQyx/XQJv8QQ4+LoO00eiGqHgwjcX45nNGSsfFJxMn+nflQk7xRp8ZDzUYeM6r atmpXAAXNJqRCH+tmos4CdOJdiZqOdE= X-MC-Unique: DAc8JY3dNBG_HYdfUQ1Stg-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , Vladimir Sementsov-Ogievskiy , Peter Lieven , "Richard W.M. Jones" , Paolo Bonzini , qemu-devel@nongnu.org Cc: Kevin Wolf , Hanna Reitz , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Konstantin Kostiuk , qemu-block@nongnu.org Subject: [PATCH v3 09/13] block/gluster: Use URI parsing code from glib Date: Thu, 18 Apr 2024 12:10:52 +0200 Message-ID: <20240418101056.302103-10-thuth@redhat.com> In-Reply-To: <20240418101056.302103-1-thuth@redhat.com> References: <20240418101056.302103-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.719, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1713435187935100002 Since version 2.66, glib has useful URI parsing functions, too. Use those instead of the QEMU-internal ones to be finally able to get rid of the latter. Since g_uri_get_path() returns a const pointer, we also need to tweak the parameter of parse_volume_options() (where we use the result of g_uri_get_path() as input). Reviewed-by: Eric Blake Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Thomas Huth --- block/gluster.c | 71 ++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/block/gluster.c b/block/gluster.c index cc74af06dc..1c9505f8bb 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -17,7 +17,6 @@ #include "qapi/error.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qerror.h" -#include "qemu/uri.h" #include "qemu/error-report.h" #include "qemu/module.h" #include "qemu/option.h" @@ -289,9 +288,9 @@ static void glfs_clear_preopened(glfs_t *fs) } } =20 -static int parse_volume_options(BlockdevOptionsGluster *gconf, char *path) +static int parse_volume_options(BlockdevOptionsGluster *gconf, const char = *path) { - char *p, *q; + const char *p, *q; =20 if (!path) { return -EINVAL; @@ -349,13 +348,13 @@ static int parse_volume_options(BlockdevOptionsGluste= r *gconf, char *path) static int qemu_gluster_parse_uri(BlockdevOptionsGluster *gconf, const char *filename) { + g_autoptr(GUri) uri =3D g_uri_parse(filename, G_URI_FLAGS_NONE, NULL); + g_autoptr(GHashTable) qp =3D NULL; SocketAddress *gsconf; - URI *uri; - QueryParams *qp =3D NULL; bool is_unix =3D false; - int ret =3D 0; + const char *uri_scheme, *uri_query, *uri_server; + int uri_port, ret; =20 - uri =3D uri_parse(filename); if (!uri) { return -EINVAL; } @@ -364,57 +363,57 @@ static int qemu_gluster_parse_uri(BlockdevOptionsGlus= ter *gconf, QAPI_LIST_PREPEND(gconf->server, gsconf); =20 /* transport */ - if (!uri->scheme || !strcmp(uri->scheme, "gluster")) { + uri_scheme =3D g_uri_get_scheme(uri); + if (!uri_scheme || !strcmp(uri_scheme, "gluster")) { gsconf->type =3D SOCKET_ADDRESS_TYPE_INET; - } else if (!strcmp(uri->scheme, "gluster+tcp")) { + } else if (!strcmp(uri_scheme, "gluster+tcp")) { gsconf->type =3D SOCKET_ADDRESS_TYPE_INET; - } else if (!strcmp(uri->scheme, "gluster+unix")) { + } else if (!strcmp(uri_scheme, "gluster+unix")) { gsconf->type =3D SOCKET_ADDRESS_TYPE_UNIX; is_unix =3D true; - } else if (!strcmp(uri->scheme, "gluster+rdma")) { + } else if (!strcmp(uri_scheme, "gluster+rdma")) { gsconf->type =3D SOCKET_ADDRESS_TYPE_INET; warn_report("rdma feature is not supported, falling back to tcp"); } else { - ret =3D -EINVAL; - goto out; + return -EINVAL; } =20 - ret =3D parse_volume_options(gconf, uri->path); + ret =3D parse_volume_options(gconf, g_uri_get_path(uri)); if (ret < 0) { - goto out; + return ret; } =20 - qp =3D query_params_parse(uri->query); - if (qp->n > 1 || (is_unix && !qp->n) || (!is_unix && qp->n)) { - ret =3D -EINVAL; - goto out; + uri_query =3D g_uri_get_query(uri); + if (uri_query) { + qp =3D g_uri_parse_params(uri_query, -1, "&", G_URI_PARAMS_NONE, N= ULL); + if (!qp) { + return -EINVAL; + } + ret =3D g_hash_table_size(qp); + if (ret > 1 || (is_unix && !ret) || (!is_unix && ret)) { + return -EINVAL; + } } =20 + uri_server =3D g_uri_get_host(uri); + uri_port =3D g_uri_get_port(uri); + if (is_unix) { - if (uri->server || uri->port) { - ret =3D -EINVAL; - goto out; - } - if (strcmp(qp->p[0].name, "socket")) { - ret =3D -EINVAL; - goto out; + char *uri_socket =3D g_hash_table_lookup(qp, "socket"); + if (uri_server || uri_port !=3D -1 || !uri_socket) { + return -EINVAL; } - gsconf->u.q_unix.path =3D g_strdup(qp->p[0].value); + gsconf->u.q_unix.path =3D g_strdup(uri_socket); } else { - gsconf->u.inet.host =3D g_strdup(uri->server ? uri->server : "loca= lhost"); - if (uri->port) { - gsconf->u.inet.port =3D g_strdup_printf("%d", uri->port); + gsconf->u.inet.host =3D g_strdup(uri_server ? uri_server : "localh= ost"); + if (uri_port > 0) { + gsconf->u.inet.port =3D g_strdup_printf("%d", uri_port); } else { gsconf->u.inet.port =3D g_strdup_printf("%d", GLUSTER_DEFAULT_= PORT); } } =20 -out: - if (qp) { - query_params_free(qp); - } - uri_free(uri); - return ret; + return 0; } =20 static struct glfs *qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf, --=20 2.44.0 From nobody Wed May 15 19:15:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1713435129; cv=none; d=zohomail.com; s=zohoarc; b=LeSU2fiHsWOnWJ9szqeir7hYXIN/U3AZXm2jRxBS3WOlH3ETJKUijnC3IVaf9bh/lD5ApTjops/ydx6J8ytUxoPek4xhnFXHdOS//1dxTHFg1X3NQXdpJqcqar3W2OYtDecUheX+1x4GfeKX5LZGxVey1rKUxHUlb6l2XKu3Yu4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713435129; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/QmaLNO+vWcQUA3/Xd3140OA+g8DYfYtPvpMzRzcvdo=; b=WXEk4x/XA/WiG+HSBWGjpjEN9ArrsD6B6gsXi2thMujYguQaUEBJsJruNru0aTardwL9VwVXo5whcgZLclWkmKD4HSdm3l8uLxxLQKmjPq7sgcC2kbVgjl5PY7aPDvrU8EYPhyKQoIKEauxy6ATik+c/aRUGIRt5NwgQmbR/Byc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1713435129009795.5496632739574; Thu, 18 Apr 2024 03:12:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxOkF-00029T-Nm; Thu, 18 Apr 2024 06:11:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOkE-00025V-23 for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOkC-0004vM-8z for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:53 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-582-RpaFvfnvMLSVkBeQhup6YQ-1; Thu, 18 Apr 2024 06:11:46 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1EF961800222; Thu, 18 Apr 2024 10:11:46 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE942C271AB; Thu, 18 Apr 2024 10:11:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713435111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/QmaLNO+vWcQUA3/Xd3140OA+g8DYfYtPvpMzRzcvdo=; b=MJhRb8zIjYIoom9myVG74wQvjnf14bMS5agkcuuLmV1h9vtc5nq4zpztrLpShZalmyYLSH ghhAtMApTqipW+j5lFxCO9ZEoyx//YNbvJbBIpRS048TFgC4I94zUH7nWKvFAfGkMDIaa7 FHsu6r2gw8nm/3lxKrRXs0DxazO/69k= X-MC-Unique: RpaFvfnvMLSVkBeQhup6YQ-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , Vladimir Sementsov-Ogievskiy , Peter Lieven , "Richard W.M. Jones" , Paolo Bonzini , qemu-devel@nongnu.org Cc: Kevin Wolf , Hanna Reitz , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Konstantin Kostiuk , qemu-block@nongnu.org Subject: [PATCH v3 10/13] block/nbd: Use URI parsing code from glib Date: Thu, 18 Apr 2024 12:10:53 +0200 Message-ID: <20240418101056.302103-11-thuth@redhat.com> In-Reply-To: <20240418101056.302103-1-thuth@redhat.com> References: <20240418101056.302103-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.719, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1713435129600100001 Content-Type: text/plain; charset="utf-8" Since version 2.66, glib has useful URI parsing functions, too. Use those instead of the QEMU-internal ones to be finally able to get rid of the latter. The g_uri_get_host() also takes care of removing the square brackets from IPv6 addresses, so we can drop that part of the QEMU code now, too. Reviewed-by: Richard W.M. Jones Reviewed-by: Eric Blake Signed-off-by: Thomas Huth --- block/nbd.c | 76 ++++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/block/nbd.c b/block/nbd.c index ef05f7cdfd..589d28af83 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -31,7 +31,6 @@ #include "qemu/osdep.h" =20 #include "trace.h" -#include "qemu/uri.h" #include "qemu/option.h" #include "qemu/cutils.h" #include "qemu/main-loop.h" @@ -1514,30 +1513,31 @@ static void nbd_client_close(BlockDriverState *bs) =20 static int nbd_parse_uri(const char *filename, QDict *options) { - URI *uri; + g_autoptr(GUri) uri =3D g_uri_parse(filename, G_URI_FLAGS_NONE, NULL); + g_autoptr(GHashTable) qp =3D NULL; const char *p; - QueryParams *qp =3D NULL; - int ret =3D 0; + int qp_n; bool is_unix; + const char *uri_scheme, *uri_query, *uri_server; + int uri_port; =20 - uri =3D uri_parse(filename); if (!uri) { return -EINVAL; } =20 /* transport */ - if (!g_strcmp0(uri->scheme, "nbd")) { + uri_scheme =3D g_uri_get_scheme(uri); + if (!g_strcmp0(uri_scheme, "nbd")) { is_unix =3D false; - } else if (!g_strcmp0(uri->scheme, "nbd+tcp")) { + } else if (!g_strcmp0(uri_scheme, "nbd+tcp")) { is_unix =3D false; - } else if (!g_strcmp0(uri->scheme, "nbd+unix")) { + } else if (!g_strcmp0(uri_scheme, "nbd+unix")) { is_unix =3D true; } else { - ret =3D -EINVAL; - goto out; + return -EINVAL; } =20 - p =3D uri->path ? uri->path : ""; + p =3D g_uri_get_path(uri) ?: ""; if (p[0] =3D=3D '/') { p++; } @@ -1545,52 +1545,50 @@ static int nbd_parse_uri(const char *filename, QDic= t *options) qdict_put_str(options, "export", p); } =20 - qp =3D query_params_parse(uri->query); - if (qp->n > 1 || (is_unix && !qp->n) || (!is_unix && qp->n)) { - ret =3D -EINVAL; - goto out; + uri_query =3D g_uri_get_query(uri); + if (uri_query) { + qp =3D g_uri_parse_params(uri_query, -1, "&", G_URI_PARAMS_NONE, N= ULL); + if (!qp) { + return -EINVAL; + } + qp_n =3D g_hash_table_size(qp); + if (qp_n > 1 || (is_unix && !qp_n) || (!is_unix && qp_n)) { + return -EINVAL; + } + } + + uri_server =3D g_uri_get_host(uri); + if (uri_server && !uri_server[0]) { + uri_server =3D NULL; } + uri_port =3D g_uri_get_port(uri); =20 if (is_unix) { /* nbd+unix:///export?socket=3Dpath */ - if (uri->server || uri->port || strcmp(qp->p[0].name, "socket")) { - ret =3D -EINVAL; - goto out; + const char *uri_socket =3D g_hash_table_lookup(qp, "socket"); + if (uri_server || uri_port !=3D -1 || !uri_socket) { + return -EINVAL; } qdict_put_str(options, "server.type", "unix"); - qdict_put_str(options, "server.path", qp->p[0].value); + qdict_put_str(options, "server.path", uri_socket); } else { - QString *host; char *port_str; =20 /* nbd[+tcp]://host[:port]/export */ - if (!uri->server) { - ret =3D -EINVAL; - goto out; - } - - /* strip braces from literal IPv6 address */ - if (uri->server[0] =3D=3D '[') { - host =3D qstring_from_substr(uri->server, 1, - strlen(uri->server) - 1); - } else { - host =3D qstring_from_str(uri->server); + if (!uri_server) { + return -EINVAL; } =20 qdict_put_str(options, "server.type", "inet"); - qdict_put(options, "server.host", host); + qdict_put_str(options, "server.host", uri_server); =20 - port_str =3D g_strdup_printf("%d", uri->port ?: NBD_DEFAULT_PORT); + port_str =3D g_strdup_printf("%d", uri_port > 0 ? uri_port + : NBD_DEFAULT_PORT); qdict_put_str(options, "server.port", port_str); g_free(port_str); } =20 -out: - if (qp) { - query_params_free(qp); - } - uri_free(uri); - return ret; + return 0; } =20 static bool nbd_has_filename_options_conflict(QDict *options, Error **errp) --=20 2.44.0 From nobody Wed May 15 19:15:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1713435173; cv=none; d=zohomail.com; s=zohoarc; b=nYDaK3vu1UdSRNmTAwF7INfkqwho+RFP9Ts3F2Ldn0sEk0Yz2dCYXb3BnfDssBtY34drwEyRiNMvJOYxZL+lEz8YeOhQaoIJX6h+jmGCU2blw167Jm+B/PG1jMDsavrBMQQVbHtn9iBSI8/rNVX2MI/2yh+P39hn6NWoqLg8JSU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713435173; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Szoiy8Kym+G/LS+YSzTQY28E2bsp1lQV5YZQ5R5EiOk=; b=dVr8L8M2RE9N0EoAqWp4gpuM9EDYoyA+9Bj2i6PtDWCXakCKCq+6COKh8tDslvg8bz3qY6KNPlxVED+ZRTHcMNUKtmhBjZLvFrMXelaYAo3fs+JTHjCaA0HciH+D9a/Fuaj9qwDRTdvwfUx0p0/H5QqHBykhF5QVH4PdODXsJF8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1713435173844872.4728385593112; Thu, 18 Apr 2024 03:12:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxOkN-0002CU-Au; Thu, 18 Apr 2024 06:12:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOkF-00029R-I9 for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOkD-0004vV-7u for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:55 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-412-ZG4mK7ctPYumCKmZYGOW9g-1; Thu, 18 Apr 2024 06:11:49 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0602A80253A; Thu, 18 Apr 2024 10:11:49 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 616C8C1A225; Thu, 18 Apr 2024 10:11:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713435112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Szoiy8Kym+G/LS+YSzTQY28E2bsp1lQV5YZQ5R5EiOk=; b=VIip+9nQpfJ6BA1Bduu7v7pppmnkDTLFcIhKrSkZZx2OHiaThUfgJXIpcpxA58zZBj1Bhb y8nPahiRJrQ+g25q16O/3ec3G25Xe1kf308k7c4JC47IdMslVjIafqmUlTNjV181aZrnN6 6E1RaLh7uOQ+ZgTKPzJTwMGIi7UW+Jw= X-MC-Unique: ZG4mK7ctPYumCKmZYGOW9g-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , Vladimir Sementsov-Ogievskiy , Peter Lieven , "Richard W.M. Jones" , Paolo Bonzini , qemu-devel@nongnu.org Cc: Kevin Wolf , Hanna Reitz , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Konstantin Kostiuk , qemu-block@nongnu.org Subject: [PATCH v3 11/13] block/nfs: Use URI parsing code from glib Date: Thu, 18 Apr 2024 12:10:54 +0200 Message-ID: <20240418101056.302103-12-thuth@redhat.com> In-Reply-To: <20240418101056.302103-1-thuth@redhat.com> References: <20240418101056.302103-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.719, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1713435175989100003 Content-Type: text/plain; charset="utf-8" Since version 2.66, glib has useful URI parsing functions, too. Use those instead of the QEMU-internal ones to be finally able to get rid of the latter. While we're at it, slightly rephrase one of the error messages: Use "Invalid value..." instead of "Illegal value..." since the latter rather sounds like the users were breaking a law here. Reviewed-by: Eric Blake Signed-off-by: Thomas Huth --- block/nfs.c | 110 ++++++++++++++++++++++++++-------------------------- 1 file changed, 54 insertions(+), 56 deletions(-) diff --git a/block/nfs.c b/block/nfs.c index f737e19cd3..60240a8733 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -38,7 +38,6 @@ #include "qemu/main-loop.h" #include "qemu/module.h" #include "qemu/option.h" -#include "qemu/uri.h" #include "qemu/cutils.h" #include "sysemu/replay.h" #include "qapi/qapi-visit-block-core.h" @@ -79,77 +78,76 @@ typedef struct NFSRPC { =20 static int nfs_parse_uri(const char *filename, QDict *options, Error **err= p) { - URI *uri =3D NULL; - QueryParams *qp =3D NULL; - int ret =3D -EINVAL, i; + g_autoptr(GUri) uri =3D g_uri_parse(filename, G_URI_FLAGS_NONE, NULL); + GUriParamsIter qp; + const char *uri_server, *uri_path, *uri_query; + char *qp_name, *qp_value; + GError *gerror =3D NULL; =20 - uri =3D uri_parse(filename); if (!uri) { error_setg(errp, "Invalid URI specified"); - goto out; + return -EINVAL; } - if (g_strcmp0(uri->scheme, "nfs") !=3D 0) { + if (!g_str_equal(g_uri_get_scheme(uri), "nfs")) { error_setg(errp, "URI scheme must be 'nfs'"); - goto out; + return -EINVAL; } =20 - if (!uri->server) { + uri_server =3D g_uri_get_host(uri); + if (!uri_server || !uri_server[0]) { error_setg(errp, "missing hostname in URI"); - goto out; + return -EINVAL; } =20 - if (!uri->path) { + uri_path =3D g_uri_get_path(uri); + if (!uri_path || !uri_path[0]) { error_setg(errp, "missing file path in URI"); - goto out; - } - - qp =3D query_params_parse(uri->query); - if (!qp) { - error_setg(errp, "could not parse query parameters"); - goto out; + return -EINVAL; } =20 - qdict_put_str(options, "server.host", uri->server); + qdict_put_str(options, "server.host", uri_server); qdict_put_str(options, "server.type", "inet"); - qdict_put_str(options, "path", uri->path); - - for (i =3D 0; i < qp->n; i++) { - uint64_t val; - if (!qp->p[i].value) { - error_setg(errp, "Value for NFS parameter expected: %s", - qp->p[i].name); - goto out; - } - if (parse_uint_full(qp->p[i].value, 0, &val)) { - error_setg(errp, "Illegal value for NFS parameter: %s", - qp->p[i].name); - goto out; - } - if (!strcmp(qp->p[i].name, "uid")) { - qdict_put_str(options, "user", qp->p[i].value); - } else if (!strcmp(qp->p[i].name, "gid")) { - qdict_put_str(options, "group", qp->p[i].value); - } else if (!strcmp(qp->p[i].name, "tcp-syncnt")) { - qdict_put_str(options, "tcp-syn-count", qp->p[i].value); - } else if (!strcmp(qp->p[i].name, "readahead")) { - qdict_put_str(options, "readahead-size", qp->p[i].value); - } else if (!strcmp(qp->p[i].name, "pagecache")) { - qdict_put_str(options, "page-cache-size", qp->p[i].value); - } else if (!strcmp(qp->p[i].name, "debug")) { - qdict_put_str(options, "debug", qp->p[i].value); - } else { - error_setg(errp, "Unknown NFS parameter name: %s", - qp->p[i].name); - goto out; + qdict_put_str(options, "path", uri_path); + + uri_query =3D g_uri_get_query(uri); + if (uri_query) { + g_uri_params_iter_init(&qp, uri_query, -1, "&", G_URI_PARAMS_NONE); + while (g_uri_params_iter_next(&qp, &qp_name, &qp_value, &gerror)) { + uint64_t val; + if (!qp_name || gerror) { + error_setg(errp, "Failed to parse NFS parameter"); + return -EINVAL; + } + if (!qp_value) { + error_setg(errp, "Value for NFS parameter expected: %s", + qp_name); + return -EINVAL; + } + if (parse_uint_full(qp_value, 0, &val)) { + error_setg(errp, "Invalid value for NFS parameter: %s", + qp_name); + return -EINVAL; + } + if (g_str_equal(qp_name, "uid")) { + qdict_put_str(options, "user", qp_value); + } else if (g_str_equal(qp_name, "gid")) { + qdict_put_str(options, "group", qp_value); + } else if (g_str_equal(qp_name, "tcp-syncnt")) { + qdict_put_str(options, "tcp-syn-count", qp_value); + } else if (g_str_equal(qp_name, "readahead")) { + qdict_put_str(options, "readahead-size", qp_value); + } else if (g_str_equal(qp_name, "pagecache")) { + qdict_put_str(options, "page-cache-size", qp_value); + } else if (g_str_equal(qp_name, "debug")) { + qdict_put_str(options, "debug", qp_value); + } else { + error_setg(errp, "Unknown NFS parameter name: %s", qp_name= ); + return -EINVAL; + } } } - ret =3D 0; -out: - if (qp) { - query_params_free(qp); - } - uri_free(uri); - return ret; + + return 0; } =20 static bool nfs_has_filename_options_conflict(QDict *options, Error **errp) --=20 2.44.0 From nobody Wed May 15 19:15:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1713435215; cv=none; d=zohomail.com; s=zohoarc; b=n73JzVyKc4vUseiRhgWJDBBOyYexujlp+mVn/sQIl6bZ26FyJ+k5KEiwQfduiQ6+HYgYafOR1EmvQIkDOM2/PRoTjcRvzKCGIJJcBTukj2Q7DAVB1ii7a6UAQABVVIe8HyolxoJbmvHsGLe1RsernBAxQw/916L/MoVlO2eCpME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713435215; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=rX7+cvgh6mTv2GGjvcuMBspd3CHW2j02F6bNL0p6I3s=; b=d2wvgel7VHpY+G0Zp1ygGDqgngbO+vWo41V254hRkc/0H6m7Oi3Kk1Gsg3bUuEPjQ0UW7HN8mnPuGmiSAOXJft7d9m/efECTAhGvQMPTj2DTOEmGI4RQV6SUwzLGkUYoxQLonBwr8YiVQ3KwW1YI8//Y0XQEzNjNLqGwETKSjUM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1713435215595910.9065766215322; Thu, 18 Apr 2024 03:13:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxOkP-0002K5-Nt; Thu, 18 Apr 2024 06:12:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOkJ-0002CD-LS for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOkH-0004wZ-VW for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:11:59 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-655-bXYQvhGVPBWnNNtKfUdiZQ-1; Thu, 18 Apr 2024 06:11:53 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 93B3180021A; Thu, 18 Apr 2024 10:11:52 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C9A4C271A4; Thu, 18 Apr 2024 10:11:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713435117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rX7+cvgh6mTv2GGjvcuMBspd3CHW2j02F6bNL0p6I3s=; b=B04ztudY4VUGefgXIIhT9JW1559gIiLS+zDlJShQn5YMDZglnHKNQ40QVnU6rGI6S9beaU Q22XsiMsG1fQOaaOYfZXnwoV6n7vgvi73E22mbctH/8/psVVstoSdMa3s+AVn3Bflxjixr MOUV/T+mLs230V2bQdmd1WnfBBYCWUg= X-MC-Unique: bXYQvhGVPBWnNNtKfUdiZQ-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , Vladimir Sementsov-Ogievskiy , Peter Lieven , "Richard W.M. Jones" , Paolo Bonzini , qemu-devel@nongnu.org Cc: Kevin Wolf , Hanna Reitz , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Konstantin Kostiuk , qemu-block@nongnu.org Subject: [PATCH v3 12/13] block/ssh: Use URI parsing code from glib Date: Thu, 18 Apr 2024 12:10:55 +0200 Message-ID: <20240418101056.302103-13-thuth@redhat.com> In-Reply-To: <20240418101056.302103-1-thuth@redhat.com> References: <20240418101056.302103-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.719, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1713435216012100001 Content-Type: text/plain; charset="utf-8" Since version 2.66, glib has useful URI parsing functions, too. Use those instead of the QEMU-internal ones to be finally able to get rid of the latter. While we're at it, also emit a warning when encountering unknown parameters in the URI, so that the users have a chance to detect their typos or other mistakes. Reviewed-by: Richard W.M. Jones Signed-off-by: Thomas Huth --- block/ssh.c | 75 ++++++++++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/block/ssh.c b/block/ssh.c index 2748253d4a..a88171d4b5 100644 --- a/block/ssh.c +++ b/block/ssh.c @@ -37,7 +37,6 @@ #include "qemu/ctype.h" #include "qemu/cutils.h" #include "qemu/sockets.h" -#include "qemu/uri.h" #include "qapi/qapi-visit-sockets.h" #include "qapi/qapi-visit-block-core.h" #include "qapi/qmp/qdict.h" @@ -181,65 +180,71 @@ static void sftp_error_trace(BDRVSSHState *s, const c= har *op) =20 static int parse_uri(const char *filename, QDict *options, Error **errp) { - URI *uri =3D NULL; - QueryParams *qp; + g_autoptr(GUri) uri =3D g_uri_parse(filename, G_URI_FLAGS_NONE, NULL); + const char *uri_host, *uri_path, *uri_user, *uri_query; char *port_str; - int i; + int port; + g_autoptr(GError) gerror =3D NULL; + char *qp_name, *qp_value; + GUriParamsIter qp; =20 - uri =3D uri_parse(filename); if (!uri) { return -EINVAL; } =20 - if (g_strcmp0(uri->scheme, "ssh") !=3D 0) { + if (g_strcmp0(g_uri_get_scheme(uri), "ssh") !=3D 0) { error_setg(errp, "URI scheme must be 'ssh'"); - goto err; + return -EINVAL; } =20 - if (!uri->server || strcmp(uri->server, "") =3D=3D 0) { + uri_host =3D g_uri_get_host(uri); + if (!uri_host || g_str_equal(uri_host, "")) { error_setg(errp, "missing hostname in URI"); - goto err; + return -EINVAL; } =20 - if (!uri->path || strcmp(uri->path, "") =3D=3D 0) { + uri_path =3D g_uri_get_path(uri); + if (!uri_path || g_str_equal(uri_path, "")) { error_setg(errp, "missing remote path in URI"); - goto err; - } - - qp =3D query_params_parse(uri->query); - if (!qp) { - error_setg(errp, "could not parse query parameters"); - goto err; + return -EINVAL; } =20 - if(uri->user && strcmp(uri->user, "") !=3D 0) { - qdict_put_str(options, "user", uri->user); + uri_user =3D g_uri_get_user(uri); + if (uri_user && !g_str_equal(uri_user, "")) { + qdict_put_str(options, "user", uri_user); } =20 - qdict_put_str(options, "server.host", uri->server); + qdict_put_str(options, "server.host", uri_host); =20 - port_str =3D g_strdup_printf("%d", uri->port ?: 22); + port =3D g_uri_get_port(uri); + port_str =3D g_strdup_printf("%d", port > 0 ? port : 22); qdict_put_str(options, "server.port", port_str); g_free(port_str); =20 - qdict_put_str(options, "path", uri->path); - - /* Pick out any query parameters that we understand, and ignore - * the rest. - */ - for (i =3D 0; i < qp->n; ++i) { - if (strcmp(qp->p[i].name, "host_key_check") =3D=3D 0) { - qdict_put_str(options, "host_key_check", qp->p[i].value); + qdict_put_str(options, "path", uri_path); + + uri_query =3D g_uri_get_query(uri); + if (uri_query) { + g_uri_params_iter_init(&qp, uri_query, -1, "&", G_URI_PARAMS_NONE); + while (g_uri_params_iter_next(&qp, &qp_name, &qp_value, &gerror)) { + if (!qp_name || !qp_value || gerror) { + warn_report("Failed to parse SSH URI parameters '%s'", + uri_query); + break; + } + /* + * Pick out the query parameters that we understand, and ignore + * (or rather warn about) the rest. + */ + if (g_str_equal(qp_name, "host_key_check")) { + qdict_put_str(options, "host_key_check", qp_value); + } else { + warn_report("Unsupported parameter '%s' in URI", qp_name); + } } } =20 - query_params_free(qp); - uri_free(uri); return 0; - - err: - uri_free(uri); - return -EINVAL; } =20 static bool ssh_has_filename_options_conflict(QDict *options, Error **errp) --=20 2.44.0 From nobody Wed May 15 19:15:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1713435191; cv=none; d=zohomail.com; s=zohoarc; b=miV2LqJDJeFVl+m/fGV8SD0W6zK1pZ0SFSDFYRpaMNq6pnDcdssNejGXH42yqAlGkGG9eSlm+jXhhlAmGa/hVYK2bxTQuw0h3IEjSOzTQMrgNIGG298d3qm2DVE1bCnIj37pG944jleROiH7zNAct0LbbAR622KRnkJTYp38PXY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713435191; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PKlBW9PvX1xzn3YMS7ItEOlKYHaYe9KWBcYzEF9aGbc=; b=Tel4HrK6oc7N5UXASCxhIpzJO0zRJwfihYcSi06BZ1u+7+wlfC6+5TpXoBUVqewtKW60NsWjLnV2Laj1KjWTshREnCXkshT35LNrVgdbktxbtuwnJkyS8Z8/vp+5b1O47wvIcEbBnNmksGcAH9eHlMkLgLOLvOt97WhC+IR8Vc8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1713435191176987.545179028802; Thu, 18 Apr 2024 03:13:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxOkT-0002X0-Ar; Thu, 18 Apr 2024 06:12:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOkN-0002Em-Fj for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:12:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOkI-0004wn-Sz for qemu-devel@nongnu.org; Thu, 18 Apr 2024 06:12:03 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-665-BLrHemK8NnG0VVQWPd4c7Q-1; Thu, 18 Apr 2024 06:11:56 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2B87E3C1015F; Thu, 18 Apr 2024 10:11:56 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC061C271A4; Thu, 18 Apr 2024 10:11:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713435118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PKlBW9PvX1xzn3YMS7ItEOlKYHaYe9KWBcYzEF9aGbc=; b=LoJ2wONvujSfMwhNTQ4Lduj3Snr9Zo8Lww9MGMGPx0/QxQmD8hEfgfH+R01PMQ3d0ydHDb VbSGm7fJSDOnsPc1xNc5YA75itOtzqZ466/9fxJPMtE/whs0C74P4BAVGMPfWKHDmwAsjy aadDe3zgXAJzm6OJ6vJc2Tg8RU4kJsQ= X-MC-Unique: BLrHemK8NnG0VVQWPd4c7Q-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , Vladimir Sementsov-Ogievskiy , Peter Lieven , "Richard W.M. Jones" , Paolo Bonzini , qemu-devel@nongnu.org Cc: Kevin Wolf , Hanna Reitz , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Konstantin Kostiuk , qemu-block@nongnu.org Subject: [PATCH v3 13/13] util/uri: Remove the old URI parsing code Date: Thu, 18 Apr 2024 12:10:56 +0200 Message-ID: <20240418101056.302103-14-thuth@redhat.com> In-Reply-To: <20240418101056.302103-1-thuth@redhat.com> References: <20240418101056.302103-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.719, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1713435191984100001 Content-Type: text/plain; charset="utf-8" Now that we switched all consumers of the URI code to use the URI parsing functions from glib instead, we can remove our internal URI parsing code since it is not used anymore. Reviewed-by: Eric Blake Signed-off-by: Thomas Huth --- include/qemu/uri.h | 99 --- util/uri.c | 1466 -------------------------------------------- util/meson.build | 2 +- 3 files changed, 1 insertion(+), 1566 deletions(-) delete mode 100644 include/qemu/uri.h delete mode 100644 util/uri.c diff --git a/include/qemu/uri.h b/include/qemu/uri.h deleted file mode 100644 index 255e61f452..0000000000 --- a/include/qemu/uri.h +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Summary: library of generic URI related routines - * Description: library of generic URI related routines - * Implements RFC 2396 - * - * Copyright (C) 1998-2003 Daniel Veillard. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a= copy - * of this software and associated documentation files (the "Software"), t= o deal - * in the Software without restriction, including without limitation the r= ights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included= in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHAL= L THE - * DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WH= ETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA= RE. - * - * Except as contained in this notice, the name of Daniel Veillard shall n= ot - * be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from him. - * - * Author: Daniel Veillard - ** - * Copyright (C) 2007 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Authors: - * Richard W.M. Jones - * - * Utility functions to help parse and assemble query strings. - */ - -#ifndef QEMU_URI_H -#define QEMU_URI_H - -/** - * URI: - * - * A parsed URI reference. This is a struct containing the various fields - * as described in RFC 2396 but separated for further processing. - */ -typedef struct URI { - char *scheme; /* the URI scheme */ - char *opaque; /* opaque part */ - char *authority; /* the authority part */ - char *server; /* the server part */ - char *user; /* the user part */ - int port; /* the port number */ - char *path; /* the path string */ - char *fragment; /* the fragment identifier */ - int cleanup; /* parsing potentially unclean URI */ - char *query; /* the query string (as it appears in the URI) */ -} URI; - -URI *uri_new(void); -URI *uri_parse(const char *str); -URI *uri_parse_raw(const char *str, int raw); -int uri_parse_into(URI *uri, const char *str); -char *uri_to_string(URI *uri); -void uri_free(URI *uri); - -/* Single web service query parameter 'name=3Dvalue'. */ -typedef struct QueryParam { - char *name; /* Name (unescaped). */ - char *value; /* Value (unescaped). */ - int ignore; /* Ignore this field in qparam_get_query */ -} QueryParam; - -/* Set of parameters. */ -typedef struct QueryParams { - int n; /* number of parameters used */ - int alloc; /* allocated space */ - QueryParam *p; /* array of parameters */ -} QueryParams; - -QueryParams *query_params_new(int init_alloc); -QueryParams *query_params_parse(const char *query); -void query_params_free(QueryParams *ps); - -#endif /* QEMU_URI_H */ diff --git a/util/uri.c b/util/uri.c deleted file mode 100644 index 573174bf47..0000000000 --- a/util/uri.c +++ /dev/null @@ -1,1466 +0,0 @@ -/** - * uri.c: set of generic URI related routines - * - * Reference: RFCs 3986, 2732 and 2373 - * - * Copyright (C) 1998-2003 Daniel Veillard. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a= copy - * of this software and associated documentation files (the "Software"), t= o deal - * in the Software without restriction, including without limitation the r= ights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included= in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHAL= L THE - * DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WH= ETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA= RE. - * - * Except as contained in this notice, the name of Daniel Veillard shall n= ot - * be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from him. - * - * daniel@veillard.com - * - ** - * - * Copyright (C) 2007, 2009-2010 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Authors: - * Richard W.M. Jones - * - */ - -#include "qemu/osdep.h" -#include "qemu/cutils.h" - -#include "qemu/uri.h" - -static void uri_clean(URI *uri); - -/* - * Old rule from 2396 used in legacy handling code - * alpha =3D lowalpha | upalpha - */ -#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x)) - -/* - * lowalpha =3D "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | - * "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | - * "u" | "v" | "w" | "x" | "y" | "z" - */ - -#define IS_LOWALPHA(x) (((x) >=3D 'a') && ((x) <=3D 'z')) - -/* - * upalpha =3D "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | - * "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | - * "U" | "V" | "W" | "X" | "Y" | "Z" - */ -#define IS_UPALPHA(x) (((x) >=3D 'A') && ((x) <=3D 'Z')) - -#ifdef IS_DIGIT -#undef IS_DIGIT -#endif -/* - * digit =3D "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" - */ -#define IS_DIGIT(x) (((x) >=3D '0') && ((x) <=3D '9')) - -/* - * alphanum =3D alpha | digit - */ - -#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x)) - -/* - * mark =3D "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" - */ - -#define IS_MARK(x) (((x) =3D=3D '-') || ((x) =3D=3D '_') || ((x) =3D=3D '.= ') || \ - ((x) =3D=3D '!') || ((x) =3D=3D '~') || ((x) =3D=3D '*') || ((x) =3D= =3D '\'') || \ - ((x) =3D=3D '(') || ((x) =3D=3D ')')) - -/* - * unwise =3D "{" | "}" | "|" | "\" | "^" | "`" - */ - -#define IS_UNWISE(p) = \ - (((*(p) =3D=3D '{')) || ((*(p) =3D=3D '}')) || ((*(p) =3D=3D '|')) || = \ - ((*(p) =3D=3D '\\')) || ((*(p) =3D=3D '^')) || ((*(p) =3D=3D '[')) ||= \ - ((*(p) =3D=3D ']')) || ((*(p) =3D=3D '`'))) -/* - * reserved =3D ";" | "/" | "?" | ":" | "@" | "&" | "=3D" | "+" | "$" | ",= " | - * "[" | "]" - */ - -#define IS_RESERVED(x) (((x) =3D=3D ';') || ((x) =3D=3D '/') || ((x) =3D= =3D '?') || \ - ((x) =3D=3D ':') || ((x) =3D=3D '@') || ((x) =3D=3D '&') || ((x) =3D= =3D '=3D') || \ - ((x) =3D=3D '+') || ((x) =3D=3D '$') || ((x) =3D=3D ',') || ((x) =3D= =3D '[') || \ - ((x) =3D=3D ']')) - -/* - * unreserved =3D alphanum | mark - */ - -#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x)) - -/* - * Skip to next pointer char, handle escaped sequences - */ - -#define NEXT(p) ((*p =3D=3D '%') ? p +=3D 3 : p++) - -/* - * Productions from the spec. - * - * authority =3D server | reg_name - * reg_name =3D 1*( unreserved | escaped | "$" | "," | - * ";" | ":" | "@" | "&" | "=3D" | "+" ) - * - * path =3D [ abs_path | opaque_part ] - */ - -/************************************************************************ - * * - * RFC 3986 parser * - * * - ************************************************************************/ - -#define ISA_DIGIT(p) ((*(p) >=3D '0') && (*(p) <=3D '9')) -#define ISA_ALPHA(p) (((*(p) >=3D 'a') && (*(p) <=3D 'z')) || = \ - ((*(p) >=3D 'A') && (*(p) <=3D 'Z'))) -#define ISA_HEXDIG(p) = \ - (ISA_DIGIT(p) || ((*(p) >=3D 'a') && (*(p) <=3D 'f')) || = \ - ((*(p) >=3D 'A') && (*(p) <=3D 'F'))) - -/* - * sub-delims =3D "!" / "$" / "&" / "'" / "(" / ")" - * / "*" / "+" / "," / ";" / "=3D" - */ -#define ISA_SUB_DELIM(p) = \ - (((*(p) =3D=3D '!')) || ((*(p) =3D=3D '$')) || ((*(p) =3D=3D '&')) || = \ - ((*(p) =3D=3D '(')) || ((*(p) =3D=3D ')')) || ((*(p) =3D=3D '*')) || = \ - ((*(p) =3D=3D '+')) || ((*(p) =3D=3D ',')) || ((*(p) =3D=3D ';')) || = \ - ((*(p) =3D=3D '=3D')) || ((*(p) =3D=3D '\''))) - -/* - * unreserved =3D ALPHA / DIGIT / "-" / "." / "_" / "~" - */ -#define ISA_UNRESERVED(p) = \ - ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) =3D=3D '-')) || = \ - ((*(p) =3D=3D '.')) || ((*(p) =3D=3D '_')) || ((*(p) =3D=3D '~'))) - -/* - * pct-encoded =3D "%" HEXDIG HEXDIG - */ -#define ISA_PCT_ENCODED(p) = \ - ((*(p) =3D=3D '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2))) - -/* - * pchar =3D unreserved / pct-encoded / sub-delims / ":" / "@" - */ -#define ISA_PCHAR(p) = \ - (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) || = \ - ((*(p) =3D=3D ':')) || ((*(p) =3D=3D '@'))) - -/** - * rfc3986_parse_scheme: - * @uri: pointer to an URI structure - * @str: pointer to the string to analyze - * - * Parse an URI scheme - * - * ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - * - * Returns 0 or the error code - */ -static int rfc3986_parse_scheme(URI *uri, const char **str) -{ - const char *cur; - - if (str =3D=3D NULL) { - return -1; - } - - cur =3D *str; - if (!ISA_ALPHA(cur)) { - return 2; - } - cur++; - while (ISA_ALPHA(cur) || ISA_DIGIT(cur) || (*cur =3D=3D '+') || (*cur = =3D=3D '-') || - (*cur =3D=3D '.')) { - cur++; - } - if (uri !=3D NULL) { - g_free(uri->scheme); - uri->scheme =3D g_strndup(*str, cur - *str); - } - *str =3D cur; - return 0; -} - -/** - * rfc3986_parse_fragment: - * @uri: pointer to an URI structure - * @str: pointer to the string to analyze - * - * Parse the query part of an URI - * - * fragment =3D *( pchar / "/" / "?" ) - * NOTE: the strict syntax as defined by 3986 does not allow '[' and ']' - * in the fragment identifier but this is used very broadly for - * xpointer scheme selection, so we are allowing it here to not break - * for example all the DocBook processing chains. - * - * Returns 0 or the error code - */ -static int rfc3986_parse_fragment(URI *uri, const char **str) -{ - const char *cur; - - if (str =3D=3D NULL) { - return -1; - } - - cur =3D *str; - - while ((ISA_PCHAR(cur)) || (*cur =3D=3D '/') || (*cur =3D=3D '?') || - (*cur =3D=3D '[') || (*cur =3D=3D ']') || - ((uri !=3D NULL) && (uri->cleanup & 1) && (IS_UNWISE(cur)))) { - NEXT(cur); - } - if (uri !=3D NULL) { - g_free(uri->fragment); - if (uri->cleanup & 2) { - uri->fragment =3D g_strndup(*str, cur - *str); - } else { - uri->fragment =3D g_uri_unescape_segment(*str, cur, NULL); - } - } - *str =3D cur; - return 0; -} - -/** - * rfc3986_parse_query: - * @uri: pointer to an URI structure - * @str: pointer to the string to analyze - * - * Parse the query part of an URI - * - * query =3D *uric - * - * Returns 0 or the error code - */ -static int rfc3986_parse_query(URI *uri, const char **str) -{ - const char *cur; - - if (str =3D=3D NULL) { - return -1; - } - - cur =3D *str; - - while ((ISA_PCHAR(cur)) || (*cur =3D=3D '/') || (*cur =3D=3D '?') || - ((uri !=3D NULL) && (uri->cleanup & 1) && (IS_UNWISE(cur)))) { - NEXT(cur); - } - if (uri !=3D NULL) { - g_free(uri->query); - uri->query =3D g_strndup(*str, cur - *str); - } - *str =3D cur; - return 0; -} - -/** - * rfc3986_parse_port: - * @uri: pointer to an URI structure - * @str: the string to analyze - * - * Parse a port part and fills in the appropriate fields - * of the @uri structure - * - * port =3D *DIGIT - * - * Returns 0 or the error code - */ -static int rfc3986_parse_port(URI *uri, const char **str) -{ - const char *cur =3D *str; - int port =3D 0; - - if (ISA_DIGIT(cur)) { - while (ISA_DIGIT(cur)) { - port =3D port * 10 + (*cur - '0'); - if (port > 65535) { - return 1; - } - cur++; - } - if (uri) { - uri->port =3D port; - } - *str =3D cur; - return 0; - } - return 1; -} - -/** - * rfc3986_parse_user_info: - * @uri: pointer to an URI structure - * @str: the string to analyze - * - * Parse a user information part and fill in the appropriate fields - * of the @uri structure - * - * userinfo =3D *( unreserved / pct-encoded / sub-delims / ":" ) - * - * Returns 0 or the error code - */ -static int rfc3986_parse_user_info(URI *uri, const char **str) -{ - const char *cur; - - cur =3D *str; - while (ISA_UNRESERVED(cur) || ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cu= r) || - (*cur =3D=3D ':')) { - NEXT(cur); - } - if (*cur =3D=3D '@') { - if (uri !=3D NULL) { - g_free(uri->user); - if (uri->cleanup & 2) { - uri->user =3D g_strndup(*str, cur - *str); - } else { - uri->user =3D g_uri_unescape_segment(*str, cur, NULL); - } - } - *str =3D cur; - return 0; - } - return 1; -} - -/** - * rfc3986_parse_dec_octet: - * @str: the string to analyze - * - * dec-octet =3D DIGIT ; 0-9 - * / %x31-39 DIGIT ; 10-99 - * / "1" 2DIGIT ; 100-199 - * / "2" %x30-34 DIGIT ; 200-249 - * / "25" %x30-35 ; 250-255 - * - * Skip a dec-octet. - * - * Returns 0 if found and skipped, 1 otherwise - */ -static int rfc3986_parse_dec_octet(const char **str) -{ - const char *cur =3D *str; - - if (!(ISA_DIGIT(cur))) { - return 1; - } - if (!ISA_DIGIT(cur + 1)) { - cur++; - } else if ((*cur !=3D '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur = + 2))) { - cur +=3D 2; - } else if ((*cur =3D=3D '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur= + 2))) { - cur +=3D 3; - } else if ((*cur =3D=3D '2') && (*(cur + 1) >=3D '0') && (*(cur + 1) <= =3D '4') && - (ISA_DIGIT(cur + 2))) { - cur +=3D 3; - } else if ((*cur =3D=3D '2') && (*(cur + 1) =3D=3D '5') && (*(cur + 2)= >=3D '0') && - (*(cur + 1) <=3D '5')) { - cur +=3D 3; - } else { - return 1; - } - *str =3D cur; - return 0; -} -/** - * rfc3986_parse_host: - * @uri: pointer to an URI structure - * @str: the string to analyze - * - * Parse an host part and fills in the appropriate fields - * of the @uri structure - * - * host =3D IP-literal / IPv4address / reg-name - * IP-literal =3D "[" ( IPv6address / IPvFuture ) "]" - * IPv4address =3D dec-octet "." dec-octet "." dec-octet "." dec-octet - * reg-name =3D *( unreserved / pct-encoded / sub-delims ) - * - * Returns 0 or the error code - */ -static int rfc3986_parse_host(URI *uri, const char **str) -{ - const char *cur =3D *str; - const char *host; - - host =3D cur; - /* - * IPv6 and future addressing scheme are enclosed between brackets - */ - if (*cur =3D=3D '[') { - cur++; - while ((*cur !=3D ']') && (*cur !=3D 0)) { - cur++; - } - if (*cur !=3D ']') { - return 1; - } - cur++; - goto found; - } - /* - * try to parse an IPv4 - */ - if (ISA_DIGIT(cur)) { - if (rfc3986_parse_dec_octet(&cur) !=3D 0) { - goto not_ipv4; - } - if (*cur !=3D '.') { - goto not_ipv4; - } - cur++; - if (rfc3986_parse_dec_octet(&cur) !=3D 0) { - goto not_ipv4; - } - if (*cur !=3D '.') { - goto not_ipv4; - } - if (rfc3986_parse_dec_octet(&cur) !=3D 0) { - goto not_ipv4; - } - if (*cur !=3D '.') { - goto not_ipv4; - } - if (rfc3986_parse_dec_octet(&cur) !=3D 0) { - goto not_ipv4; - } - goto found; - not_ipv4: - cur =3D *str; - } - /* - * then this should be a hostname which can be empty - */ - while (ISA_UNRESERVED(cur) || ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cu= r)) { - NEXT(cur); - } -found: - if (uri !=3D NULL) { - g_free(uri->authority); - uri->authority =3D NULL; - g_free(uri->server); - if (cur !=3D host) { - if (uri->cleanup & 2) { - uri->server =3D g_strndup(host, cur - host); - } else { - uri->server =3D g_uri_unescape_segment(host, cur, NULL); - } - } else { - uri->server =3D NULL; - } - } - *str =3D cur; - return 0; -} - -/** - * rfc3986_parse_authority: - * @uri: pointer to an URI structure - * @str: the string to analyze - * - * Parse an authority part and fills in the appropriate fields - * of the @uri structure - * - * authority =3D [ userinfo "@" ] host [ ":" port ] - * - * Returns 0 or the error code - */ -static int rfc3986_parse_authority(URI *uri, const char **str) -{ - const char *cur; - int ret; - - cur =3D *str; - /* - * try to parse a userinfo and check for the trailing @ - */ - ret =3D rfc3986_parse_user_info(uri, &cur); - if ((ret !=3D 0) || (*cur !=3D '@')) { - cur =3D *str; - } else { - cur++; - } - ret =3D rfc3986_parse_host(uri, &cur); - if (ret !=3D 0) { - return ret; - } - if (*cur =3D=3D ':') { - cur++; - ret =3D rfc3986_parse_port(uri, &cur); - if (ret !=3D 0) { - return ret; - } - } - *str =3D cur; - return 0; -} - -/** - * rfc3986_parse_segment: - * @str: the string to analyze - * @forbid: an optional forbidden character - * @empty: allow an empty segment - * - * Parse a segment and fills in the appropriate fields - * of the @uri structure - * - * segment =3D *pchar - * segment-nz =3D 1*pchar - * segment-nz-nc =3D 1*( unreserved / pct-encoded / sub-delims / "@" ) - * ; non-zero-length segment without any colon ":" - * - * Returns 0 or the error code - */ -static int rfc3986_parse_segment(const char **str, char forbid, int empty) -{ - const char *cur; - - cur =3D *str; - if (!ISA_PCHAR(cur)) { - if (empty) { - return 0; - } - return 1; - } - while (ISA_PCHAR(cur) && (*cur !=3D forbid)) { - NEXT(cur); - } - *str =3D cur; - return 0; -} - -/** - * rfc3986_parse_path_ab_empty: - * @uri: pointer to an URI structure - * @str: the string to analyze - * - * Parse an path absolute or empty and fills in the appropriate fields - * of the @uri structure - * - * path-abempty =3D *( "/" segment ) - * - * Returns 0 or the error code - */ -static int rfc3986_parse_path_ab_empty(URI *uri, const char **str) -{ - const char *cur; - int ret; - - cur =3D *str; - - while (*cur =3D=3D '/') { - cur++; - ret =3D rfc3986_parse_segment(&cur, 0, 1); - if (ret !=3D 0) { - return ret; - } - } - if (uri !=3D NULL) { - g_free(uri->path); - if (*str !=3D cur) { - if (uri->cleanup & 2) { - uri->path =3D g_strndup(*str, cur - *str); - } else { - uri->path =3D g_uri_unescape_segment(*str, cur, NULL); - } - } else { - uri->path =3D NULL; - } - } - *str =3D cur; - return 0; -} - -/** - * rfc3986_parse_path_absolute: - * @uri: pointer to an URI structure - * @str: the string to analyze - * - * Parse an path absolute and fills in the appropriate fields - * of the @uri structure - * - * path-absolute =3D "/" [ segment-nz *( "/" segment ) ] - * - * Returns 0 or the error code - */ -static int rfc3986_parse_path_absolute(URI *uri, const char **str) -{ - const char *cur; - int ret; - - cur =3D *str; - - if (*cur !=3D '/') { - return 1; - } - cur++; - ret =3D rfc3986_parse_segment(&cur, 0, 0); - if (ret =3D=3D 0) { - while (*cur =3D=3D '/') { - cur++; - ret =3D rfc3986_parse_segment(&cur, 0, 1); - if (ret !=3D 0) { - return ret; - } - } - } - if (uri !=3D NULL) { - g_free(uri->path); - if (cur !=3D *str) { - if (uri->cleanup & 2) { - uri->path =3D g_strndup(*str, cur - *str); - } else { - uri->path =3D g_uri_unescape_segment(*str, cur, NULL); - } - } else { - uri->path =3D NULL; - } - } - *str =3D cur; - return 0; -} - -/** - * rfc3986_parse_path_rootless: - * @uri: pointer to an URI structure - * @str: the string to analyze - * - * Parse an path without root and fills in the appropriate fields - * of the @uri structure - * - * path-rootless =3D segment-nz *( "/" segment ) - * - * Returns 0 or the error code - */ -static int rfc3986_parse_path_rootless(URI *uri, const char **str) -{ - const char *cur; - int ret; - - cur =3D *str; - - ret =3D rfc3986_parse_segment(&cur, 0, 0); - if (ret !=3D 0) { - return ret; - } - while (*cur =3D=3D '/') { - cur++; - ret =3D rfc3986_parse_segment(&cur, 0, 1); - if (ret !=3D 0) { - return ret; - } - } - if (uri !=3D NULL) { - g_free(uri->path); - if (cur !=3D *str) { - if (uri->cleanup & 2) { - uri->path =3D g_strndup(*str, cur - *str); - } else { - uri->path =3D g_uri_unescape_segment(*str, cur, NULL); - } - } else { - uri->path =3D NULL; - } - } - *str =3D cur; - return 0; -} - -/** - * rfc3986_parse_path_no_scheme: - * @uri: pointer to an URI structure - * @str: the string to analyze - * - * Parse an path which is not a scheme and fills in the appropriate fields - * of the @uri structure - * - * path-noscheme =3D segment-nz-nc *( "/" segment ) - * - * Returns 0 or the error code - */ -static int rfc3986_parse_path_no_scheme(URI *uri, const char **str) -{ - const char *cur; - int ret; - - cur =3D *str; - - ret =3D rfc3986_parse_segment(&cur, ':', 0); - if (ret !=3D 0) { - return ret; - } - while (*cur =3D=3D '/') { - cur++; - ret =3D rfc3986_parse_segment(&cur, 0, 1); - if (ret !=3D 0) { - return ret; - } - } - if (uri !=3D NULL) { - g_free(uri->path); - if (cur !=3D *str) { - if (uri->cleanup & 2) { - uri->path =3D g_strndup(*str, cur - *str); - } else { - uri->path =3D g_uri_unescape_segment(*str, cur, NULL); - } - } else { - uri->path =3D NULL; - } - } - *str =3D cur; - return 0; -} - -/** - * rfc3986_parse_hier_part: - * @uri: pointer to an URI structure - * @str: the string to analyze - * - * Parse an hierarchical part and fills in the appropriate fields - * of the @uri structure - * - * hier-part =3D "//" authority path-abempty - * / path-absolute - * / path-rootless - * / path-empty - * - * Returns 0 or the error code - */ -static int rfc3986_parse_hier_part(URI *uri, const char **str) -{ - const char *cur; - int ret; - - cur =3D *str; - - if ((*cur =3D=3D '/') && (*(cur + 1) =3D=3D '/')) { - cur +=3D 2; - ret =3D rfc3986_parse_authority(uri, &cur); - if (ret !=3D 0) { - return ret; - } - ret =3D rfc3986_parse_path_ab_empty(uri, &cur); - if (ret !=3D 0) { - return ret; - } - *str =3D cur; - return 0; - } else if (*cur =3D=3D '/') { - ret =3D rfc3986_parse_path_absolute(uri, &cur); - if (ret !=3D 0) { - return ret; - } - } else if (ISA_PCHAR(cur)) { - ret =3D rfc3986_parse_path_rootless(uri, &cur); - if (ret !=3D 0) { - return ret; - } - } else { - /* path-empty is effectively empty */ - if (uri !=3D NULL) { - g_free(uri->path); - uri->path =3D NULL; - } - } - *str =3D cur; - return 0; -} - -/** - * rfc3986_parse_relative_ref: - * @uri: pointer to an URI structure - * @str: the string to analyze - * - * Parse an URI string and fills in the appropriate fields - * of the @uri structure - * - * relative-ref =3D relative-part [ "?" query ] [ "#" fragment ] - * relative-part =3D "//" authority path-abempty - * / path-absolute - * / path-noscheme - * / path-empty - * - * Returns 0 or the error code - */ -static int rfc3986_parse_relative_ref(URI *uri, const char *str) -{ - int ret; - - if ((*str =3D=3D '/') && (*(str + 1) =3D=3D '/')) { - str +=3D 2; - ret =3D rfc3986_parse_authority(uri, &str); - if (ret !=3D 0) { - return ret; - } - ret =3D rfc3986_parse_path_ab_empty(uri, &str); - if (ret !=3D 0) { - return ret; - } - } else if (*str =3D=3D '/') { - ret =3D rfc3986_parse_path_absolute(uri, &str); - if (ret !=3D 0) { - return ret; - } - } else if (ISA_PCHAR(str)) { - ret =3D rfc3986_parse_path_no_scheme(uri, &str); - if (ret !=3D 0) { - return ret; - } - } else { - /* path-empty is effectively empty */ - if (uri !=3D NULL) { - g_free(uri->path); - uri->path =3D NULL; - } - } - - if (*str =3D=3D '?') { - str++; - ret =3D rfc3986_parse_query(uri, &str); - if (ret !=3D 0) { - return ret; - } - } - if (*str =3D=3D '#') { - str++; - ret =3D rfc3986_parse_fragment(uri, &str); - if (ret !=3D 0) { - return ret; - } - } - if (*str !=3D 0) { - uri_clean(uri); - return 1; - } - return 0; -} - -/** - * rfc3986_parse: - * @uri: pointer to an URI structure - * @str: the string to analyze - * - * Parse an URI string and fills in the appropriate fields - * of the @uri structure - * - * scheme ":" hier-part [ "?" query ] [ "#" fragment ] - * - * Returns 0 or the error code - */ -static int rfc3986_parse(URI *uri, const char *str) -{ - int ret; - - ret =3D rfc3986_parse_scheme(uri, &str); - if (ret !=3D 0) { - return ret; - } - if (*str !=3D ':') { - return 1; - } - str++; - ret =3D rfc3986_parse_hier_part(uri, &str); - if (ret !=3D 0) { - return ret; - } - if (*str =3D=3D '?') { - str++; - ret =3D rfc3986_parse_query(uri, &str); - if (ret !=3D 0) { - return ret; - } - } - if (*str =3D=3D '#') { - str++; - ret =3D rfc3986_parse_fragment(uri, &str); - if (ret !=3D 0) { - return ret; - } - } - if (*str !=3D 0) { - uri_clean(uri); - return 1; - } - return 0; -} - -/** - * rfc3986_parse_uri_reference: - * @uri: pointer to an URI structure - * @str: the string to analyze - * - * Parse an URI reference string and fills in the appropriate fields - * of the @uri structure - * - * URI-reference =3D URI / relative-ref - * - * Returns 0 or the error code - */ -static int rfc3986_parse_uri_reference(URI *uri, const char *str) -{ - int ret; - - if (str =3D=3D NULL) { - return -1; - } - uri_clean(uri); - - /* - * Try first to parse absolute refs, then fallback to relative if - * it fails. - */ - ret =3D rfc3986_parse(uri, str); - if (ret !=3D 0) { - uri_clean(uri); - ret =3D rfc3986_parse_relative_ref(uri, str); - if (ret !=3D 0) { - uri_clean(uri); - return ret; - } - } - return 0; -} - -/** - * uri_parse: - * @str: the URI string to analyze - * - * Parse an URI based on RFC 3986 - * - * URI-reference =3D [ absoluteURI | relativeURI ] [ "#" fragment ] - * - * Returns a newly built URI or NULL in case of error - */ -URI *uri_parse(const char *str) -{ - URI *uri; - int ret; - - if (str =3D=3D NULL) { - return NULL; - } - uri =3D uri_new(); - ret =3D rfc3986_parse_uri_reference(uri, str); - if (ret) { - uri_free(uri); - return NULL; - } - return uri; -} - -/** - * uri_parse_into: - * @uri: pointer to an URI structure - * @str: the string to analyze - * - * Parse an URI reference string based on RFC 3986 and fills in the - * appropriate fields of the @uri structure - * - * URI-reference =3D URI / relative-ref - * - * Returns 0 or the error code - */ -int uri_parse_into(URI *uri, const char *str) -{ - return rfc3986_parse_uri_reference(uri, str); -} - -/** - * uri_parse_raw: - * @str: the URI string to analyze - * @raw: if 1 unescaping of URI pieces are disabled - * - * Parse an URI but allows to keep intact the original fragments. - * - * URI-reference =3D URI / relative-ref - * - * Returns a newly built URI or NULL in case of error - */ -URI *uri_parse_raw(const char *str, int raw) -{ - URI *uri; - int ret; - - if (str =3D=3D NULL) { - return NULL; - } - uri =3D uri_new(); - if (raw) { - uri->cleanup |=3D 2; - } - ret =3D uri_parse_into(uri, str); - if (ret) { - uri_free(uri); - return NULL; - } - return uri; -} - -/************************************************************************ - * * - * Generic URI structure functions * - * * - ************************************************************************/ - -/** - * uri_new: - * - * Simply creates an empty URI - * - * Returns the new structure or NULL in case of error - */ -URI *uri_new(void) -{ - return g_new0(URI, 1); -} - -/** - * realloc2n: - * - * Function to handle properly a reallocation when saving an URI - * Also imposes some limit on the length of an URI string output - */ -static char *realloc2n(char *ret, int *max) -{ - char *temp; - int tmp; - - tmp =3D *max * 2; - temp =3D g_realloc(ret, (tmp + 1)); - *max =3D tmp; - return temp; -} - -/** - * uri_to_string: - * @uri: pointer to an URI - * - * Save the URI as an escaped string - * - * Returns a new string (to be deallocated by caller) - */ -char *uri_to_string(URI *uri) -{ - char *ret =3D NULL; - char *temp; - const char *p; - int len; - int max; - - if (uri =3D=3D NULL) { - return NULL; - } - - max =3D 80; - ret =3D g_malloc(max + 1); - len =3D 0; - - if (uri->scheme !=3D NULL) { - p =3D uri->scheme; - while (*p !=3D 0) { - if (len >=3D max) { - temp =3D realloc2n(ret, &max); - ret =3D temp; - } - ret[len++] =3D *p++; - } - if (len >=3D max) { - temp =3D realloc2n(ret, &max); - ret =3D temp; - } - ret[len++] =3D ':'; - } - if (uri->opaque !=3D NULL) { - p =3D uri->opaque; - while (*p !=3D 0) { - if (len + 3 >=3D max) { - temp =3D realloc2n(ret, &max); - ret =3D temp; - } - if (IS_RESERVED(*(p)) || IS_UNRESERVED(*(p))) { - ret[len++] =3D *p++; - } else { - int val =3D *(unsigned char *)p++; - int hi =3D val / 0x10, lo =3D val % 0x10; - ret[len++] =3D '%'; - ret[len++] =3D hi + (hi > 9 ? 'A' - 10 : '0'); - ret[len++] =3D lo + (lo > 9 ? 'A' - 10 : '0'); - } - } - } else { - if (uri->server !=3D NULL) { - if (len + 3 >=3D max) { - temp =3D realloc2n(ret, &max); - ret =3D temp; - } - ret[len++] =3D '/'; - ret[len++] =3D '/'; - if (uri->user !=3D NULL) { - p =3D uri->user; - while (*p !=3D 0) { - if (len + 3 >=3D max) { - temp =3D realloc2n(ret, &max); - ret =3D temp; - } - if ((IS_UNRESERVED(*(p))) || ((*(p) =3D=3D ';')) || - ((*(p) =3D=3D ':')) || ((*(p) =3D=3D '&')) || ((*(= p) =3D=3D '=3D')) || - ((*(p) =3D=3D '+')) || ((*(p) =3D=3D '$')) || ((*(= p) =3D=3D ','))) { - ret[len++] =3D *p++; - } else { - int val =3D *(unsigned char *)p++; - int hi =3D val / 0x10, lo =3D val % 0x10; - ret[len++] =3D '%'; - ret[len++] =3D hi + (hi > 9 ? 'A' - 10 : '0'); - ret[len++] =3D lo + (lo > 9 ? 'A' - 10 : '0'); - } - } - if (len + 3 >=3D max) { - temp =3D realloc2n(ret, &max); - ret =3D temp; - } - ret[len++] =3D '@'; - } - p =3D uri->server; - while (*p !=3D 0) { - if (len >=3D max) { - temp =3D realloc2n(ret, &max); - ret =3D temp; - } - ret[len++] =3D *p++; - } - if (uri->port > 0) { - if (len + 10 >=3D max) { - temp =3D realloc2n(ret, &max); - ret =3D temp; - } - len +=3D snprintf(&ret[len], max - len, ":%d", uri->port); - } - } else if (uri->authority !=3D NULL) { - if (len + 3 >=3D max) { - temp =3D realloc2n(ret, &max); - ret =3D temp; - } - ret[len++] =3D '/'; - ret[len++] =3D '/'; - p =3D uri->authority; - while (*p !=3D 0) { - if (len + 3 >=3D max) { - temp =3D realloc2n(ret, &max); - ret =3D temp; - } - if ((IS_UNRESERVED(*(p))) || ((*(p) =3D=3D '$')) || - ((*(p) =3D=3D ',')) || ((*(p) =3D=3D ';')) || ((*(p) = =3D=3D ':')) || - ((*(p) =3D=3D '@')) || ((*(p) =3D=3D '&')) || ((*(p) = =3D=3D '=3D')) || - ((*(p) =3D=3D '+'))) { - ret[len++] =3D *p++; - } else { - int val =3D *(unsigned char *)p++; - int hi =3D val / 0x10, lo =3D val % 0x10; - ret[len++] =3D '%'; - ret[len++] =3D hi + (hi > 9 ? 'A' - 10 : '0'); - ret[len++] =3D lo + (lo > 9 ? 'A' - 10 : '0'); - } - } - } else if (uri->scheme !=3D NULL) { - if (len + 3 >=3D max) { - temp =3D realloc2n(ret, &max); - ret =3D temp; - } - ret[len++] =3D '/'; - ret[len++] =3D '/'; - } - if (uri->path !=3D NULL) { - p =3D uri->path; - /* - * the colon in file:///d: should not be escaped or - * Windows accesses fail later. - */ - if ((uri->scheme !=3D NULL) && (p[0] =3D=3D '/') && - (((p[1] >=3D 'a') && (p[1] <=3D 'z')) || - ((p[1] >=3D 'A') && (p[1] <=3D 'Z'))) && - (p[2] =3D=3D ':') && (!strcmp(uri->scheme, "file"))) { - if (len + 3 >=3D max) { - temp =3D realloc2n(ret, &max); - ret =3D temp; - } - ret[len++] =3D *p++; - ret[len++] =3D *p++; - ret[len++] =3D *p++; - } - while (*p !=3D 0) { - if (len + 3 >=3D max) { - temp =3D realloc2n(ret, &max); - ret =3D temp; - } - if ((IS_UNRESERVED(*(p))) || ((*(p) =3D=3D '/')) || - ((*(p) =3D=3D ';')) || ((*(p) =3D=3D '@')) || ((*(p) = =3D=3D '&')) || - ((*(p) =3D=3D '=3D')) || ((*(p) =3D=3D '+')) || ((*(p)= =3D=3D '$')) || - ((*(p) =3D=3D ','))) { - ret[len++] =3D *p++; - } else { - int val =3D *(unsigned char *)p++; - int hi =3D val / 0x10, lo =3D val % 0x10; - ret[len++] =3D '%'; - ret[len++] =3D hi + (hi > 9 ? 'A' - 10 : '0'); - ret[len++] =3D lo + (lo > 9 ? 'A' - 10 : '0'); - } - } - } - if (uri->query !=3D NULL) { - if (len + 1 >=3D max) { - temp =3D realloc2n(ret, &max); - ret =3D temp; - } - ret[len++] =3D '?'; - p =3D uri->query; - while (*p !=3D 0) { - if (len + 1 >=3D max) { - temp =3D realloc2n(ret, &max); - ret =3D temp; - } - ret[len++] =3D *p++; - } - } - } - if (uri->fragment !=3D NULL) { - if (len + 3 >=3D max) { - temp =3D realloc2n(ret, &max); - ret =3D temp; - } - ret[len++] =3D '#'; - p =3D uri->fragment; - while (*p !=3D 0) { - if (len + 3 >=3D max) { - temp =3D realloc2n(ret, &max); - ret =3D temp; - } - if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p)))) { - ret[len++] =3D *p++; - } else { - int val =3D *(unsigned char *)p++; - int hi =3D val / 0x10, lo =3D val % 0x10; - ret[len++] =3D '%'; - ret[len++] =3D hi + (hi > 9 ? 'A' - 10 : '0'); - ret[len++] =3D lo + (lo > 9 ? 'A' - 10 : '0'); - } - } - } - if (len >=3D max) { - temp =3D realloc2n(ret, &max); - ret =3D temp; - } - ret[len] =3D 0; - return ret; -} - -/** - * uri_clean: - * @uri: pointer to an URI - * - * Make sure the URI struct is free of content - */ -static void uri_clean(URI *uri) -{ - if (uri =3D=3D NULL) { - return; - } - - g_free(uri->scheme); - uri->scheme =3D NULL; - g_free(uri->server); - uri->server =3D NULL; - g_free(uri->user); - uri->user =3D NULL; - g_free(uri->path); - uri->path =3D NULL; - g_free(uri->fragment); - uri->fragment =3D NULL; - g_free(uri->opaque); - uri->opaque =3D NULL; - g_free(uri->authority); - uri->authority =3D NULL; - g_free(uri->query); - uri->query =3D NULL; -} - -/** - * uri_free: - * @uri: pointer to an URI, NULL is ignored - * - * Free up the URI struct - */ -void uri_free(URI *uri) -{ - uri_clean(uri); - g_free(uri); -} - -/************************************************************************ - * * - * Public functions * - * * - ************************************************************************/ - -/* - * Utility functions to help parse and assemble query strings. - */ - -struct QueryParams *query_params_new(int init_alloc) -{ - struct QueryParams *ps; - - if (init_alloc <=3D 0) { - init_alloc =3D 1; - } - - ps =3D g_new(QueryParams, 1); - ps->n =3D 0; - ps->alloc =3D init_alloc; - ps->p =3D g_new(QueryParam, ps->alloc); - - return ps; -} - -/* Ensure there is space to store at least one more parameter - * at the end of the set. - */ -static int query_params_append(struct QueryParams *ps, const char *name, - const char *value) -{ - if (ps->n >=3D ps->alloc) { - ps->p =3D g_renew(QueryParam, ps->p, ps->alloc * 2); - ps->alloc *=3D 2; - } - - ps->p[ps->n].name =3D g_strdup(name); - ps->p[ps->n].value =3D g_strdup(value); - ps->p[ps->n].ignore =3D 0; - ps->n++; - - return 0; -} - -void query_params_free(struct QueryParams *ps) -{ - int i; - - for (i =3D 0; i < ps->n; ++i) { - g_free(ps->p[i].name); - g_free(ps->p[i].value); - } - g_free(ps->p); - g_free(ps); -} - -struct QueryParams *query_params_parse(const char *query) -{ - struct QueryParams *ps; - const char *end, *eq; - - ps =3D query_params_new(0); - if (!query || query[0] =3D=3D '\0') { - return ps; - } - - while (*query) { - char *name =3D NULL, *value =3D NULL; - - /* Find the next separator, or end of the string. */ - end =3D strchr(query, '&'); - if (!end) { - end =3D qemu_strchrnul(query, ';'); - } - - /* Find the first '=3D' character between here and end. */ - eq =3D strchr(query, '=3D'); - if (eq && eq >=3D end) { - eq =3D NULL; - } - - /* Empty section (eg. "&&"). */ - if (end =3D=3D query) { - goto next; - } - - /* If there is no '=3D' character, then we have just "name" - * and consistent with CGI.pm we assume value is "". - */ - else if (!eq) { - name =3D g_uri_unescape_segment(query, end, NULL); - value =3D NULL; - } - /* Or if we have "name=3D" here (works around annoying - * problem when calling uri_string_unescape with len =3D 0). - */ - else if (eq + 1 =3D=3D end) { - name =3D g_uri_unescape_segment(query, eq, NULL); - value =3D g_new0(char, 1); - } - /* If the '=3D' character is at the beginning then we have - * "=3Dvalue" and consistent with CGI.pm we _ignore_ this. - */ - else if (query =3D=3D eq) { - goto next; - } - - /* Otherwise it's "name=3Dvalue". */ - else { - name =3D g_uri_unescape_segment(query, eq, NULL); - value =3D g_uri_unescape_segment(eq + 1, end, NULL); - } - - /* Append to the parameter set. */ - query_params_append(ps, name, value); - g_free(name); - g_free(value); - - next: - query =3D end; - if (*query) { - query++; /* skip '&' separator */ - } - } - - return ps; -} diff --git a/util/meson.build b/util/meson.build index 0ef9886be0..e6a2c9acc8 100644 --- a/util/meson.build +++ b/util/meson.build @@ -94,7 +94,7 @@ if have_block util_ss.add(files('hbitmap.c')) util_ss.add(files('hexdump.c')) util_ss.add(files('iova-tree.c')) - util_ss.add(files('iov.c', 'uri.c')) + util_ss.add(files('iov.c')) util_ss.add(files('nvdimm-utils.c')) util_ss.add(files('block-helpers.c')) util_ss.add(files('qemu-coroutine-sleep.c')) --=20 2.44.0