From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779822; cv=none; d=zohomail.com; s=zohoarc; b=DF65BKXp5jJvmGV+wRIqOJm2JdEoaPp+FDVXkwIY9oHlDv6nhhEu1buu6X1Xz9h1lDnD16pbxTWCQ4tPEDbeURmrlpD7dtS+Iw2su2Uy8HYhQkgZ5bF2ISHZVNyOO6b9sIbj7Icb1KGNpQf4gWPp82STJMpZ/CvYO073FknBXO0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779822; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TMUrIp1cJe1GLNBxcj5XzvddidMx+jBxcxPmrIavciM=; b=Nj6DClQB1SiMVebR2PQAZRgYz5Gos6+SQUv6OlUH1yzVfJqGPKakas38L+/ZF/vk55ttbyGNNdv0JBsxt2NesMVisHi37yLHo+rjYWuJ5B4azFmMZmEjriI0THyzJsDWbmTBzU1plSNjCUDQjgMHRxM+qlBas/zWDb52fMQe3ac= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 157977982264092.68479583527369; Thu, 23 Jan 2020 03:43:42 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-159-3DDdUmlrMK6p4-8dEpvQKw-1; Thu, 23 Jan 2020 06:43:39 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C1725800D41; Thu, 23 Jan 2020 11:43:33 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 98BA15DA8C; Thu, 23 Jan 2020 11:43:33 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 50C5F85903; Thu, 23 Jan 2020 11:43:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBhUV5025264 for ; Thu, 23 Jan 2020 06:43:31 -0500 Received: by smtp.corp.redhat.com (Postfix) id EDC1D8575E; Thu, 23 Jan 2020 11:43:30 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 55EC485754; Thu, 23 Jan 2020 11:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779821; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=TMUrIp1cJe1GLNBxcj5XzvddidMx+jBxcxPmrIavciM=; b=SpMjH04t0O6f4M94S1A6GMhRWQPJ7xeAOVIBMQloQs6kSIhrZf9cJjMpNI3JlI0jfGFHBo oqrSwSX1UWCiDbinVb7jP2CKDqYyCq3KB8CPnoK9gxzZFBzdN6qSvwqf8il9D0VVX9CVUm Wu0uyMCvdaBP+U/NGq4RIRr6I+9wZrY= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 01/32] tests: stop setting $SHELL env variable Date: Thu, 23 Jan 2020 11:42:54 +0000 Message-Id: <20200123114325.3860881-2-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: 3DDdUmlrMK6p4-8dEpvQKw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" None of the tests appear to reference a SHELL env variable explicitly and they all succeeed when it is not set. This eliminates the only use of the gnulib posix-shell module. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pavel Hrdina --- tests/Makefile.am | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index f957c7d1ba..19705c6b76 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,8 +16,6 @@ ## License along with this library. If not, see ## . =20 -SHELL =3D $(PREFERABLY_POSIX_SHELL) - AM_CPPFLAGS =3D \ -I$(top_builddir) -I$(top_srcdir) \ -I$(top_builddir)/gnulib/lib -I$(top_srcdir)/gnulib/lib \ @@ -484,7 +482,6 @@ TESTS_ENVIRONMENT =3D \ abs_top_srcdir=3D"$(abs_top_srcdir)" \ abs_builddir=3D"$(abs_builddir)" \ abs_srcdir=3D"$(abs_srcdir)" \ - SHELL=3D"$(SHELL)" \ LIBVIRT_AUTOSTART=3D0 \ LC_ALL=3DC \ VIR_TEST_EXPENSIVE=3D$(VIR_TEST_EXPENSIVE) \ --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779821; cv=none; d=zohomail.com; s=zohoarc; b=Jv4Pi3WkGs8LiXC/Jn4yOdj6liJUrhr5Y2So0ro/Wbqz3hxdkrOLFo3qPCe2zFwMuXihfAxulG3GB7H4tPbR1V6PdfaKML0B/Eeiz59VrlBfgMVqAnta+Yojo4s1N60Ogne2+N/4li9KTIziJp6q0RUEEz/nTmICU09mxkc988o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779821; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AsV9PC4cYeIK2QMLdzkjsO7l1YSnUcX4h1PyU6bjm6I=; b=KK07XUJ8hcH6AXEg6DZT1NnMwKotYMzettoc4hK/HqSmSrlh9/uu6P8o1J1B5dMbLNIsAj3smvWNof8h6RmrO8S/aPW7ssHYASgghI9nW+hj8bogUF/6dWY0WnG2wgs8sJiA7d/sAdNWZ7KyCEFT0ICZyL/E0e+kEYXbjNGp1ik= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 15797798217711015.0131247300828; Thu, 23 Jan 2020 03:43:41 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-299-PDozORHtNfS5wqQTcRm7BA-1; Thu, 23 Jan 2020 06:43:38 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 28C3D1005510; Thu, 23 Jan 2020 11:43:33 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F071A60BE1; Thu, 23 Jan 2020 11:43:32 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B0FED85900; Thu, 23 Jan 2020 11:43:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBhVAj025276 for ; Thu, 23 Jan 2020 06:43:31 -0500 Received: by smtp.corp.redhat.com (Postfix) id D35511CB; Thu, 23 Jan 2020 11:43:31 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3FD5885754; Thu, 23 Jan 2020 11:43:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779820; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=AsV9PC4cYeIK2QMLdzkjsO7l1YSnUcX4h1PyU6bjm6I=; b=QVwlN1EIRJ2zKbtwexOeT7GNnDRlO1+Jkq4iuQz4LFn1yiu+EGGlMdcQMMaD5m1wud431l 3ryMDubjub2hDhvUmJOkIZoAvv2rKw3NiL2mra+PymR8w86QVoWbtD16SHj9LLIfdHbcp7 Du2aGxd5GwcVmnqproWBdI4PHyIf7fo= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 02/32] util: add a virArchFromHost() impl for Windows Date: Thu, 23 Jan 2020 11:42:55 +0000 Message-Id: <20200123114325.3860881-3-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: PDozORHtNfS5wqQTcRm7BA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Instead of relying on GNULIb's uname() impl, directly use the Windows API for determining CPU architecture. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pavel Hrdina --- src/util/virarch.c | 52 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/src/util/virarch.c b/src/util/virarch.c index b132e178c3..553d21c97c 100644 --- a/src/util/virarch.c +++ b/src/util/virarch.c @@ -21,7 +21,12 @@ =20 #include =20 -#include +#ifdef WIN32 +# define WIN32_LEAN_AND_MEAN +# include +#else +# include +#endif =20 #include "virlog.h" #include "virarch.h" @@ -154,6 +159,50 @@ virArch virArchFromString(const char *archstr) * uname 'machine' field, since this will canonicalize * architecture names like 'amd64' into 'x86_64'. */ +#ifdef WIN32 + +/* + * Missing in ming64 headers 6.0.0, but defined as '12' in: + * + * https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinf= oapi-system_info + */ +# ifndef PROCESSOR_ARCHITECTURE_ARM64 +# define PROCESSOR_ARCHITECTURE_ARM64 12 +# endif + +virArch virArchFromHost(void) +{ + SYSTEM_INFO info; + + GetSystemInfo(&info); + + switch (info.wProcessorArchitecture) { + case PROCESSOR_ARCHITECTURE_AMD64: + return VIR_ARCH_X86_64; + case PROCESSOR_ARCHITECTURE_IA64: + return VIR_ARCH_ITANIUM; + case PROCESSOR_ARCHITECTURE_INTEL: + case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64: + return VIR_ARCH_I686; + case PROCESSOR_ARCHITECTURE_MIPS: + return VIR_ARCH_MIPS; + case PROCESSOR_ARCHITECTURE_ALPHA: + return VIR_ARCH_ALPHA; + case PROCESSOR_ARCHITECTURE_PPC: + return VIR_ARCH_PPC; + case PROCESSOR_ARCHITECTURE_SHX: + return VIR_ARCH_SH4; + case PROCESSOR_ARCHITECTURE_ARM: + return VIR_ARCH_ARMV7L; + case PROCESSOR_ARCHITECTURE_ARM64: + return VIR_ARCH_AARCH64; + default: + VIR_WARN("Unknown host arch %d, report to libvir-list@redhat.com", + info.wProcessorArchitecture); + return VIR_ARCH_NONE; + } +} +#else /* !WIN32 */ virArch virArchFromHost(void) { struct utsname ut; @@ -184,3 +233,4 @@ virArch virArchFromHost(void) =20 return arch; } +#endif /* !WIN32 */ --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779826; cv=none; d=zohomail.com; s=zohoarc; b=Wv5V4o3DadgaV9Mx2nefEiDJwrKRb7fpJipNY71lhZAp89kazMZaj2j43vf+I5pcuWgHq/Em4nwyXeO3Hld3l9Ufkjn+vntp3v/rj2Kd6HTaaCs8IZRWIufUpyZvZ2LQvoqcIVYLciP2sP7P5vBp1gbDi8dYE0ABicA2xiP5tBA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779826; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=baK56A43saJ3x0tN8SXmkS+0yr8/SR1JvXsQplWtIho=; b=UKgS/PYMnSK8hEcIFVCJ/Y1vT5FhvhVznPrKHLh8lWTp0vzK16ZW4tRwjpczobY1OdPYjy7vXQt5/XrsVpY7T39I76XuffV7eV4VYda3htKjrFOa8i0aL455D35xpi57E4mLodWcvVDGx4f/8byslV14/J7PLSV7SSTk76zrQx0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1579779826724267.9240737485394; Thu, 23 Jan 2020 03:43:46 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-55-zIpesGsSNC6Ohk3r2atsWA-1; Thu, 23 Jan 2020 06:43:43 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C8D5B1005F76; Thu, 23 Jan 2020 11:43:36 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9DA498CCDB; Thu, 23 Jan 2020 11:43:36 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 53DB085907; Thu, 23 Jan 2020 11:43:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBhWfr025284 for ; Thu, 23 Jan 2020 06:43:32 -0500 Received: by smtp.corp.redhat.com (Postfix) id B69759CA3; Thu, 23 Jan 2020 11:43:32 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 24D1C1CB; Thu, 23 Jan 2020 11:43:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779825; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=baK56A43saJ3x0tN8SXmkS+0yr8/SR1JvXsQplWtIho=; b=ZefwzFvgCB6IljnmM7yAMe3QU69XN15spaVJcs/Dh+INDpm7OQd/UrwVQQ0IaH703p5XmH gsZmY8JkzYtIpV+FFI3GKdi8wy0JEpRjVLnAg3g84QeBkqa6tphILMkt7erguf2ALsJeF0 kZGADcjc1nJWmE5Yat75G1jZU3pt0Eo= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 03/32] util: add API for reading password from the console Date: Thu, 23 Jan 2020 11:42:56 +0000 Message-Id: <20200123114325.3860881-4-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: zIpesGsSNC6Ohk3r2atsWA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This imports a simpler version of GNULIB's getpass() function impl for Windows. Note that GNULIB's impl was buggy as it returned a static string on UNIX, and a heap allocated string on Windows. This new impl always heap allocates. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pavel Hrdina --- src/libvirt.c | 9 ++++----- src/libvirt_private.syms | 1 + src/util/virutil.c | 29 +++++++++++++++++++++++++++++ src/util/virutil.h | 2 ++ 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index f1ffc97261..353b3a55d8 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -30,7 +30,6 @@ =20 #include #include -#include "getpass.h" =20 #ifdef WITH_CURL # include @@ -157,9 +156,9 @@ virConnectAuthCallbackDefault(virConnectCredentialPtr c= red, if (fflush(stdout) !=3D 0) return -1; =20 - bufptr =3D getpass(""); - if (!bufptr) - return -1; + bufptr =3D virGetPassword(); + if (STREQ(bufptr, "")) + VIR_FREE(bufptr); break; =20 default: @@ -167,7 +166,7 @@ virConnectAuthCallbackDefault(virConnectCredentialPtr c= red, } =20 if (cred[i].type !=3D VIR_CRED_EXTERNAL) { - cred[i].result =3D g_strdup(STREQ(bufptr, "") && cred[i].defre= sult ? cred[i].defresult : bufptr); + cred[i].result =3D bufptr ? bufptr : g_strdup(cred[i].defresul= t ? cred[i].defresult : ""); cred[i].resultlen =3D strlen(cred[i].result); } } diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index b63feb4054..fa046051a3 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3371,6 +3371,7 @@ virGetGroupList; virGetGroupName; virGetHostname; virGetHostnameQuiet; +virGetPassword; virGetSelfLastChanged; virGetSystemPageSize; virGetSystemPageSizeKB; diff --git a/src/util/virutil.c b/src/util/virutil.c index 7c2c5a78f6..87ca16c088 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -28,6 +28,10 @@ #include #include =20 +#ifdef WIN32 +# include +#endif /* WIN32 */ + #ifdef MAJOR_IN_MKDEV # include #elif MAJOR_IN_SYSMACROS @@ -1731,3 +1735,28 @@ virHostGetDRMRenderNode(void) VIR_DIR_CLOSE(driDir); return ret; } + +/* + * Get a password from the console input stream. + * The caller must free the returned password. + * + * Returns: the password, or NULL + */ +char *virGetPassword(void) +{ +#ifdef WIN32 + GString *pw =3D g_string_new(""); + + while (1) { + char c =3D _getch(); + if (c =3D=3D '\r') + break; + + g_string_append_c(pw, c); + } + + return g_string_free(pw, FALSE); +#else /* !WIN32 */ + return g_strdup(getpass("")); +#endif /* ! WIN32 */ +} diff --git a/src/util/virutil.h b/src/util/virutil.h index 1a6ae1787a..62a53f34cb 100644 --- a/src/util/virutil.h +++ b/src/util/virutil.h @@ -159,3 +159,5 @@ char *virHostGetDRMRenderNode(void) G_GNUC_NO_INLINE; */ #define VIR_ASSIGN_IS_OVERFLOW(lvalue, rvalue) \ (((lvalue) =3D (rvalue)) !=3D (rvalue)) + +char *virGetPassword(void); --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779831; cv=none; d=zohomail.com; s=zohoarc; b=SMPkuxm06JtNctWSsjz5IVu5Mw5k9tThYjtJSJj5pUFPONbsHhxXnLsQAQroBEz/cBRIO2J+jeCQeWZHaJuM0QbATvlISDt1pu5gmXYjkTkGpBKV1pu9eUPFqzfYtVZ9xglDalqKkm+HNlZ48z0tBkQgjldh6A+5hBssdF6Whu8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779831; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/8BWZxcAl5WF7oDl+rN1QeklVYOdwSmCUM4nfbZRIhk=; b=ZeMukCg0JphF8//3zgQgPsWwkCYxh/Itq0JDXrOfUf7kZHR1YkX8MjcleQ+LiGbj+LNrmM9e0PAcXXdUGub8rRo5HCXC/jV7D7eptVuCeqLUuo686nt6eNbCO3ifyZO7J5btvhtJ8OMPX2zBE1I5z7r1aRUdOYGWDL4imoYkyGs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1579779831719325.1092941143189; Thu, 23 Jan 2020 03:43:51 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-311-jxA3QWZ9N0C4y4REKA26wA-1; Thu, 23 Jan 2020 06:43:48 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ACB51190D349; Thu, 23 Jan 2020 11:43:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 72CCD85759; Thu, 23 Jan 2020 11:43:40 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2D48318089D5; Thu, 23 Jan 2020 11:43:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBhZEt025300 for ; Thu, 23 Jan 2020 06:43:35 -0500 Received: by smtp.corp.redhat.com (Postfix) id B033985750; Thu, 23 Jan 2020 11:43:35 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C0619CA3; Thu, 23 Jan 2020 11:43:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779830; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=/8BWZxcAl5WF7oDl+rN1QeklVYOdwSmCUM4nfbZRIhk=; b=f+WTYUs/n6tehRXc2YSIt6rtIB32WHSw74/Qw4LCA7whdnP9XGtdvll3gu8GBW65rUfcKm LV/Nx+VvgS9ACtoRC8zXcJk62ZUeH3Cf/VSGy6AhilCZ7U4H5YiYQ8qYqGQYcM3cLZRep5 UmCAeEWm7DpkPuu5q+g9pQpczpRjjdk= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 04/32] src: remove usage of strchrnul function Date: Thu, 23 Jan 2020 11:42:57 +0000 Message-Id: <20200123114325.3860881-5-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: jxA3QWZ9N0C4y4REKA26wA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The strchrnul function doesn't exist on Windows and rather than attempt to implement it, it is simpler to just avoid its usage, as any callers are easily adapted. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pavel Hrdina --- src/openvz/openvz_conf.c | 4 +++- src/security/security_selinux.c | 16 ++++++++-------- src/util/vircgroup.c | 10 +++++++--- src/util/virdnsmasq.c | 9 +++++++-- src/util/virsysinfo.c | 14 ++++++++------ tests/testutils.c | 2 +- 6 files changed, 34 insertions(+), 21 deletions(-) diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index e9ee1a7bf4..1ec42c1d93 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -245,7 +245,9 @@ openvzReadNetworkConf(virDomainDefPtr def, =20 /*parse string*/ do { - char *next =3D strchrnul(p, ','); + char *next =3D strchr(p, ','); + if (!next) + next =3D strchr(p, '\0'); if (STRPREFIX(p, "ifname=3D")) { /* skip in libvirt */ } else if (STRPREFIX(p, "host_ifname=3D")) { diff --git a/src/security/security_selinux.c b/src/security/security_selinu= x.c index 21279e7622..2fd9c113f3 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -721,14 +721,14 @@ virSecuritySELinuxQEMUInitialize(virSecurityManagerPt= r mgr) goto error; } =20 - ptr =3D strchrnul(data->domain_context, '\n'); - if (ptr && *ptr =3D=3D '\n') { + ptr =3D strchr(data->domain_context, '\n'); + if (ptr) { *ptr =3D '\0'; ptr++; if (*ptr !=3D '\0') { data->alt_domain_context =3D g_strdup(ptr); - ptr =3D strchrnul(data->alt_domain_context, '\n'); - if (ptr && *ptr =3D=3D '\n') + ptr =3D strchr(data->alt_domain_context, '\n'); + if (ptr) *ptr =3D '\0'; } } @@ -743,12 +743,12 @@ virSecuritySELinuxQEMUInitialize(virSecurityManagerPt= r mgr) goto error; } =20 - ptr =3D strchrnul(data->file_context, '\n'); - if (ptr && *ptr =3D=3D '\n') { + ptr =3D strchr(data->file_context, '\n'); + if (ptr) { *ptr =3D '\0'; data->content_context =3D g_strdup(ptr + 1); - ptr =3D strchrnul(data->content_context, '\n'); - if (ptr && *ptr =3D=3D '\n') + ptr =3D strchr(data->content_context, '\n'); + if (ptr) *ptr =3D '\0'; } =20 diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 87ed9f4565..4aa1918c1b 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -174,9 +174,13 @@ virCgroupPartitionNeedsEscaping(const char *path) if (STRPREFIX(line, "#subsys_name")) continue; =20 - tmp =3D strchrnul(line, ' '); - *tmp =3D '\0'; - len =3D tmp - line; + tmp =3D strchr(line, ' '); + if (tmp) { + *tmp =3D '\0'; + len =3D tmp - line; + } else { + len =3D strlen(line); + } =20 if (STRPREFIX(path, line) && path[len] =3D=3D '.') { diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c index 2555f3110f..adc6f96bb6 100644 --- a/src/util/virdnsmasq.c +++ b/src/util/virdnsmasq.c @@ -640,6 +640,7 @@ dnsmasqCapsSet(dnsmasqCapsPtr caps, static int dnsmasqCapsSetFromBuffer(dnsmasqCapsPtr caps, const char *buf) { + int len; const char *p; =20 caps->noRefresh =3D true; @@ -675,10 +676,14 @@ dnsmasqCapsSetFromBuffer(dnsmasqCapsPtr caps, const c= har *buf) return 0; =20 fail: - p =3D strchrnul(buf, '\n'); + p =3D strchr(buf, '\n'); + if (!p) + len =3D strlen(buf); + else + len =3D p - buf; virReportError(VIR_ERR_INTERNAL_ERROR, _("cannot parse %s version number in '%.*s'"), - caps->binaryPath, (int) (p - buf), buf); + caps->binaryPath, len, buf); return -1; =20 } diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index c526c0322f..4cc4523be0 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -460,18 +460,20 @@ virSysinfoReadARM(void) return g_steal_pointer(&ret); } =20 -static char * +static const char * virSysinfoParseS390Delimited(const char *base, const char *name, char **va= lue, char delim1, char delim2) { const char *start; - char *end; + const char *end; =20 if (delim1 !=3D delim2 && (start =3D strstr(base, name)) && (start =3D strchr(start, delim1))) { start +=3D 1; - end =3D strchrnul(start, delim2); + end =3D strchr(start, delim2); + if (!end) + end =3D start + strlen(start); virSkipSpaces(&start); *value =3D g_strndup(start, end - start); virTrimSpaces(*value, NULL); @@ -480,7 +482,7 @@ virSysinfoParseS390Delimited(const char *base, const ch= ar *name, char **value, return NULL; } =20 -static char * +static const char * virSysinfoParseS390Line(const char *base, const char *name, char **value) { return virSysinfoParseS390Delimited(base, name, value, ':', '\n'); @@ -521,7 +523,7 @@ virSysinfoParseS390System(const char *base, virSysinfoS= ystemDefPtr *sysdef) static int virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret) { - char *tmp_base; + const char *tmp_base; char *manufacturer =3D NULL; char *procline =3D NULL; char *ncpu =3D NULL; @@ -555,7 +557,7 @@ virSysinfoParseS390Processor(const char *base, virSysin= foDefPtr ret) } =20 /* now, for each processor found, extract the frequency information */ - tmp_base =3D (char *) base; + tmp_base =3D base; =20 while ((tmp_base =3D strstr(tmp_base, "cpu number")) && (tmp_base =3D virSysinfoParseS390Line(tmp_base, "cpu number", &= ncpu))) { diff --git a/tests/testutils.c b/tests/testutils.c index b490609e36..248f9ee8be 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -1200,7 +1200,7 @@ virTestCounterReset(const char *prefix) virtTestCounter =3D 0; =20 ignore_value(virStrcpyStatic(virtTestCounterStr, prefix)); - virtTestCounterPrefixEndOffset =3D strchrnul(virtTestCounterStr, '\0'); + virtTestCounterPrefixEndOffset =3D virtTestCounterStr + strlen(virtTes= tCounterStr); } =20 =20 --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779831; cv=none; d=zohomail.com; s=zohoarc; b=elVlFMRku2QIdtzmaku0s/jzluL0h2QJd+MN49qooLYr205OWZF95FfBDDtC13GD7EF8vIJEX6BDOmntQ9iApuXl1tPk9BO7rwClrgkZ/8lxptmAs0uAwOIH+jZstWNFLortJrTj37RLHlggfGK1xMBXTFHZwBnk7BHb+p1gjgk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779831; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1hWZOhi7O8U+6f4hu7jjGruFsWMYh74a7XWXYKUltK8=; b=nY3mcHxsZE1bsFq9zeOfYxVpGPPn+DlWK6EjF9GXOHtLCBeegxTOdVRT3CFt4EfNPs4Qa3q43Q3DVS6pHcIwvC8oVh3dRvE1fuOsmuB7Ve/KK0Ge/w3KbMzEIV/DGhYwCxs0iM/waGjpJs3Y6DnZogv1yh43SltmJEHB83rJdks= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1579779831242960.8743538356723; Thu, 23 Jan 2020 03:43:51 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-122-DXTD4xWKNk2fIpbXgFx9ew-1; Thu, 23 Jan 2020 06:43:43 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0EF671005F7A; Thu, 23 Jan 2020 11:43:38 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D0673100164D; Thu, 23 Jan 2020 11:43:37 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 76F6A18089CF; Thu, 23 Jan 2020 11:43:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBha2X025307 for ; Thu, 23 Jan 2020 06:43:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id 967409CA3; Thu, 23 Jan 2020 11:43:36 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 026A985759; Thu, 23 Jan 2020 11:43:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779830; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1hWZOhi7O8U+6f4hu7jjGruFsWMYh74a7XWXYKUltK8=; b=A8anlZWzLQFP824AzVTHCFksuZYJ5uoNJExuivf7HsGzXKNGEgnORRynLB5u6a+z1WN2Jp +WLnV0pvAh7nsO0r1zdaS9wAM3EJhBN9WgAfVmiCsl39BXZB6JSG3fhf6GufJNdjvdqscy VGTf+1KF2iTRSI73tG7fRSavuqPcCfM= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 05/32] build: generate configmake.h in root directory Date: Thu, 23 Jan 2020 11:42:58 +0000 Message-Id: <20200123114325.3860881-6-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: DXTD4xWKNk2fIpbXgFx9ew-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Currently we rely on gnulib creating configmake.h, but we can easily create it ourselves instead. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pavel Hrdina --- Makefile.am | 44 ++++++++++++++++++++++++++++++++++++++++ configure.ac | 12 +++++------ tools/nss/libvirt_nss.c | 7 +------ tools/virt-login-shell.c | 6 +----- 4 files changed, 51 insertions(+), 18 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8a8eecb697..485b281a03 100644 --- a/Makefile.am +++ b/Makefile.am @@ -129,6 +129,9 @@ clean-cov: =20 MAINTAINERCLEANFILES =3D .git-module-status =20 +BUILT_SOURCES =3D configmake.h +CLEANFILES =3D configmake.h + distclean-local: clean-GNUmakefile clean-GNUmakefile: test '$(srcdir)' =3D . || rm -f $(top_builddir)/GNUmakefile @@ -154,3 +157,44 @@ gen-AUTHORS: =20 ci-%: $(MAKE) -C $(srcdir)/ci/ $@ + +# Listed in the same order as the GNU makefile conventions, and +# provided by autoconf 2.59c+ or 2.70. +# The Automake-defined pkg* macros are appended, in the order +# listed in the Automake 1.10a+ documentation. +configmake.h: Makefile + $(AM_V_GEN)rm -f $@-t && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + echo '#if HAVE_WINSOCK2_H'; \ + echo '# include /* avoid mingw pollution on DATADIR */'; \ + echo '#endif'; \ + echo '#define PREFIX "$(prefix)"'; \ + echo '#define EXEC_PREFIX "$(exec_prefix)"'; \ + echo '#define BINDIR "$(bindir)"'; \ + echo '#define SBINDIR "$(sbindir)"'; \ + echo '#define LIBEXECDIR "$(libexecdir)"'; \ + echo '#define DATAROOTDIR "$(datarootdir)"'; \ + echo '#define DATADIR "$(datadir)"'; \ + echo '#define SYSCONFDIR "$(sysconfdir)"'; \ + echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \ + echo '#define LOCALSTATEDIR "$(localstatedir)"'; \ + echo '#define RUNSTATEDIR "$(runstatedir)"'; \ + echo '#define INCLUDEDIR "$(includedir)"'; \ + echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \ + echo '#define DOCDIR "$(docdir)"'; \ + echo '#define INFODIR "$(infodir)"'; \ + echo '#define HTMLDIR "$(htmldir)"'; \ + echo '#define DVIDIR "$(dvidir)"'; \ + echo '#define PDFDIR "$(pdfdir)"'; \ + echo '#define PSDIR "$(psdir)"'; \ + echo '#define LIBDIR "$(libdir)"'; \ + echo '#define LISPDIR "$(lispdir)"'; \ + echo '#define LOCALEDIR "$(localedir)"'; \ + echo '#define MANDIR "$(mandir)"'; \ + echo '#define MANEXT "$(manext)"'; \ + echo '#define PKGDATADIR "$(pkgdatadir)"'; \ + echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \ + echo '#define PKGLIBDIR "$(pkglibdir)"'; \ + echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ + } | sed '/""/d' > $@-t && \ + mv -f $@-t $@ diff --git a/configure.ac b/configure.ac index 4bdf38ec15..f0d79b95d4 100644 --- a/configure.ac +++ b/configure.ac @@ -132,14 +132,12 @@ AC_PROG_CPP dnl autoconf 2.70 adds a --runstatedir option so that downstreams dnl can point to /run instead of the historic /var/run, but dnl autoconf hasn't had a release since 2012. -dnl -dnl gnulib sets configmake.h to include runstatedir, but sets -dnl it to $localstatedir/run if $runstatedir env var is not set -dnl which is useless for apps that need to use /run without -dnl waiting for autoconf 2.70 -dnl +if test "x$runstatedir" =3D x; then + AC_SUBST([runstatedir], ['${localstatedir}/run']) +fi + dnl we introduce --with-runstatedir and then overwrite the -dnl value of $runstatedir so gnulib's configmake.h becomes useful +dnl value of $runstatedir so configmake.h is more useful AC_ARG_WITH( [runstatedir], [AS_HELP_STRING( diff --git a/tools/nss/libvirt_nss.c b/tools/nss/libvirt_nss.c index 6e332f7578..3b89f72742 100644 --- a/tools/nss/libvirt_nss.c +++ b/tools/nss/libvirt_nss.c @@ -41,12 +41,7 @@ # include #endif =20 -/* - * This gnulib files is used for its macros only, - * so doesn't introduce a link time dep, which we - * must avoid - */ -#include "gnulib/lib/configmake.h" +#include "configmake.h" =20 #include "libvirt_nss_leases.h" =20 diff --git a/tools/virt-login-shell.c b/tools/virt-login-shell.c index cf4a249f0a..25449f972d 100644 --- a/tools/virt-login-shell.c +++ b/tools/virt-login-shell.c @@ -28,11 +28,7 @@ #include #include =20 -/* - * These gnulib files are used for their macros only, - * so don't introduce a link time dep, which we must avoid - */ -#include "gnulib/lib/configmake.h" +#include "configmake.h" =20 #define VIR_INT64_STR_BUFLEN 21 =20 --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779834; cv=none; d=zohomail.com; s=zohoarc; b=ClTU8FyMYavxevLP+U155085XNMP9TXTjCijIlxFd9Ib3iHeUer8m5vQXHH3EUQ8Hc1vXGJl4uHFChxs7sxJzIE52Wr1WMRSc78HLk+yki6Ab5ie97i38JbjcZcjD/YTs/Yp1ULHaYh0PMjKkJa51yQsWI5yzzm28aniV+kc9Ts= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779834; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FuVi9KOl94ilmovm7DFKXaLQvIBGocJAr4wjiDMtlvE=; b=DVj7buJMPQ9+A2b4VfdOaOtXimqXYHi7QHu5P7lfQkk/FEYQHpHVXAF+wJQdTZwpvN1tgCl3/M7XM3rGVvfAY+lnWqNRKheK1fR5gv8CVTrZnn6D50GXwiuqnRFqObDTP5fC4ACA1sV21j4y3kSEVGtmWNSM4AtUXmX23Ls3eT0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1579779834018212.91292787448083; Thu, 23 Jan 2020 03:43:54 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-44-gEHcISHwMoKuAcqtNQmIZg-1; Thu, 23 Jan 2020 06:43:50 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 369C2190D34F; Thu, 23 Jan 2020 11:43:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0DB4D399; Thu, 23 Jan 2020 11:43:45 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BD24D85904; Thu, 23 Jan 2020 11:43:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBhbRn025315 for ; Thu, 23 Jan 2020 06:43:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id 849D885754; Thu, 23 Jan 2020 11:43:37 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC6AD9CA3; Thu, 23 Jan 2020 11:43:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779832; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=FuVi9KOl94ilmovm7DFKXaLQvIBGocJAr4wjiDMtlvE=; b=VVe4OKEN6jB+f972Vpk7T2dFUR8Fj4mGhMrKFdu4b+b2eAFV24NYhhrS/KkCmOrUFqd5Jd nAhhSUa3tuemm7PadeUJ9SILV/25Z79FDRXBvFVFZVG9gO7cjXpK/HOHuMbQt6TpCU4cro JSTvUHvphRrDGdinSZAt0B+WcLZ/VB8= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 06/32] util: use getgrouplist() directly instead of mgetgroups Date: Thu, 23 Jan 2020 11:42:59 +0000 Message-Id: <20200123114325.3860881-7-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: gEHcISHwMoKuAcqtNQmIZg-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The mgetgroups function is a GNULIB custom wrapper around getgrouplist(). This implements a simplified version of that code directly. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pavel Hrdina --- src/internal.h | 4 ++++ src/util/virutil.c | 34 ++++++++++++++++++++++++++++------ 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/internal.h b/src/internal.h index 4b0286e237..4a63984cec 100644 --- a/src/internal.h +++ b/src/internal.h @@ -155,6 +155,10 @@ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\"") =20 +#define VIR_WARNINGS_NO_POINTER_SIGN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wpointer-sign\"") + #if HAVE_SUGGEST_ATTRIBUTE_FORMAT # define VIR_WARNINGS_NO_PRINTF \ _Pragma ("GCC diagnostic push") \ diff --git a/src/util/virutil.c b/src/util/virutil.c index 87ca16c088..4bc0aef35f 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -66,7 +66,6 @@ # include #endif =20 -#include "mgetgroups.h" #include "virerror.h" #include "virlog.h" #include "virbuffer.h" @@ -980,6 +979,11 @@ virDoesGroupExist(const char *name) } =20 =20 + +/* Work around an incompatibility of OS X 10.11: getgrouplist + accepts int *, not gid_t *, and int and gid_t differ in sign. */ +VIR_WARNINGS_NO_POINTER_SIGN + /* Compute the list of primary and supplementary groups associated * with @uid, and including @gid in the list (unless it is -1), * storing a malloc'd result into @list. If uid is -1 or doesn't exist in = the @@ -1000,11 +1004,27 @@ virGetGroupList(uid_t uid, gid_t gid, gid_t **list) /* invalid users have no supplementary groups */ if (uid !=3D (uid_t)-1 && virGetUserEnt(uid, &user, &primary, NULL, NULL, true) >=3D 0) { - if ((ret =3D mgetgroups(user, primary, list)) < 0) { - virReportSystemError(errno, - _("cannot get group list for '%s'"), user= ); - ret =3D -1; - goto cleanup; + int nallocgrps =3D 10; + gid_t *grps =3D g_new(gid_t, nallocgrps); + + while (1) { + int nprevallocgrps =3D nallocgrps; + int rv; + + rv =3D getgrouplist(user, primary, grps, &nallocgrps); + + /* Some systems (like Darwin) have a bug where they + never increase max_n_groups. */ + if (rv < 0 && nprevallocgrps =3D=3D nallocgrps) + nallocgrps *=3D 2; + + /* either shrinks to actual size, or enlarges tonew size */ + grps =3D g_renew(gid_t, grps, nallocgrps); + + if (rv >=3D 0) { + ret =3D rv; + break; + } } } =20 @@ -1029,6 +1049,8 @@ virGetGroupList(uid_t uid, gid_t gid, gid_t **list) return ret; } =20 +VIR_WARNINGS_RESET + =20 /* Set the real and effective uid and gid to the given values, as well * as all the supplementary groups, so that the process has all the --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779904; cv=none; d=zohomail.com; s=zohoarc; b=ZHhzyiJaQ8q1PI2SGhEsue0guQGi2hIT6vORYvQzUZhQhXDa235omsT5kNyItH7Z/LU4D4/y1rWOCMREi9APStlqptoo+sYj8OFSRXQPG0nPU4sKe0hgTMFVurVYqiLCvl8FBkvqsfXsrRvYLLVu2bdUr4QnDUibjvaIW91KhF4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779904; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tAA77GDkpuzb7euWrgkYFXQHOoEQ2gZFa28SYq/VJ6c=; b=GV2MSLiATfZkqPiQJKKYM+9cZrrVY3P9KEd2CNpKOtx1AuDWitb55d7Woj/tSzQ0MSoK1Wp+rMJzCFEryU4hLB3MklT4Jir7r4+kfR2nOIR38earHJvGxzvXcskf1oeQS+MwC9+HHht4yKZo9NRlC4p8YOqzN/apGcKQR7CFMAk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1579779904927719.7332087758072; Thu, 23 Jan 2020 03:45:04 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-367-BuG-sjUVOYy4ipWS0LqzUg-1; Thu, 23 Jan 2020 06:43:54 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DD198800D41; Thu, 23 Jan 2020 11:43:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B485410016E8; Thu, 23 Jan 2020 11:43:48 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7365A18089D8; Thu, 23 Jan 2020 11:43:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBhcNa025333 for ; Thu, 23 Jan 2020 06:43:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id D9C9985754; Thu, 23 Jan 2020 11:43:38 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id C9ADF85750; Thu, 23 Jan 2020 11:43:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779903; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=tAA77GDkpuzb7euWrgkYFXQHOoEQ2gZFa28SYq/VJ6c=; b=PX9VPNcsy1KrCl0OME7o1WBACQECY2KWont/cKlrUkDLQXHzrW0sOqk0cbz0PZrSeyPQKE wLGMEf/AxwVDScS+xhQ1n7HJ0eV1tuETCs31fN/BBEtwQ3QcCRWueHKYzyLq7h9U6rAGc7 tZeoGcJ6tQ8NM5WHdB1WA0Sl+35gwXA= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 07/32] tools: replace wcwidth() with g_unichar_* APIs Date: Thu, 23 Jan 2020 11:43:00 +0000 Message-Id: <20200123114325.3860881-8-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: BuG-sjUVOYy4ipWS0LqzUg-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The combination of g_unichar_iszerowidth and g_unichar_iswide is sufficient to replicate the logic of wcwidth() for libvirt. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pavel Hrdina --- tests/vshtabletest.c | 8 ++------ tools/vsh-table.c | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/vshtabletest.c b/tests/vshtabletest.c index f2e0554f0a..54498b8a5a 100644 --- a/tests/vshtabletest.c +++ b/tests/vshtabletest.c @@ -155,14 +155,12 @@ testUnicodeArabic(const void *opaque G_GNUC_UNUSED) " 1 =EF=BB=89=EF=BA=AA=EF=BB=B4=EF=BB=9F =EF=BA=8E=EF= =BB=A0=EF=BA=9C=EF=BB=98=EF=BB=B4=EF=BB=9F =EF=BB=95=EF=BA=8E=EF=BB=A3 =EF= =BB=8A=EF=BB=A7, =D9=A3=D9=A0 =EF=BB=8E=EF=BB=B4=EF=BB=A8=EF=BB=B3=EF=BA=8D= =EF=BB=AE=EF=BA=98=EF=BB=A7=EF=BA=8E=EF=BB=A4=EF=BA=97 =EF=BA=8E=EF=BB=A0= =EF=BA=9B=EF=BA=8E=EF=BB=A0=EF=BA=9B=D8=8C =EF=BA=84=EF=BA=B3=EF=BA=AD, =EF= =BA=A9=EF=BB=AE=EF=BB=9F =EF=BA=A9=EF=BB=AE=EF=BB=9F. =EF=BA=84=EF=BB=A3= =EF=BA=8E=EF=BB=A3 =EF=BA=8D =EF=BA=8E=EF=BB=A7 =EF=BB=B2=EF=BB=9C=EF=BB=A7= \n" " =EF=BA=BA=EF=BB=94=EF=BA=A3=EF=BA=93 =EF=BA=96=EF=BB= =9C=EF=BA=98=EF=BB=B4=EF=BB=9B=EF=BA=8D=D9=8B =EF=BB=8A=EF=BB=9F, =EF=BA=8E= =EF=BB=A0=EF=BA=A0=EF=BB=A7=EF=BB=AD=EF=BA=A9 =EF=BB=AD=EF=BA=8E=EF=BB=A0= =EF=BB=8C=EF=BA=97=EF=BA=8D=EF=BA=A9 =EF=BA=B5= =EF=BA=AD\n"; vshTablePtr table; - wchar_t wc; =20 /* If this char is not classed as printable, the actual * output won't match what this test expects. The code * is still operating correctly, but we have different * layout */ - mbrtowc(&wc, "=D8=8C", MB_CUR_MAX, NULL); - if (!iswprint(wc)) + if (!g_unichar_isprint(g_utf8_get_char(","))) return EXIT_AM_SKIP; =20 table =3D vshTableNew("=EF=BB=A1=EF=BA=8D =EF=BB=A2=EF=BB=A3=EF=BA=8D = =EF=BB=95=EF=BA=8E=EF=BA=8C=EF=BB=A3=EF=BA=93", "=EF=BA=93 =EF=BA=8E=EF=BB= =A0=EF=BA=BC=EF=BB=8B", "=EF=BA=8D=EF=BB=B8=EF=BA=9C=EF=BB=A7=EF=BA=8E=EF= =BB=A7", NULL); @@ -197,14 +195,12 @@ testUnicodeZeroWidthChar(const void *opaque G_GNUC_UN= USED) " 1\u200B fedora28 run\u200Bning\n" " 2 rhel7.5 running\n"; char *act =3D NULL; - wchar_t wc; =20 /* If this char is not classed as printable, the actual * output won't match what this test expects. The code * is still operating correctly, but we have different * layout */ - mbrtowc(&wc, "\u200B", MB_CUR_MAX, NULL); - if (!iswprint(wc)) + if (!g_unichar_isprint(g_utf8_get_char("\u200B"))) return EXIT_AM_SKIP; =20 table =3D vshTableNew("I\u200Bd", "Name", "\u200BStatus", NULL); diff --git a/tools/vsh-table.c b/tools/vsh-table.c index a2365b2c32..e21514e86f 100644 --- a/tools/vsh-table.c +++ b/tools/vsh-table.c @@ -261,7 +261,7 @@ vshTableSafeEncode(const char *s, size_t *width) } else { memcpy(buf, p, len); buf +=3D len; - *width +=3D wcwidth(wc); + *width +=3D g_unichar_iszerowidth(wc) ? 0 : (g_unichar_isw= ide(wc) ? 2 : 1); } p +=3D len; } --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779845; cv=none; d=zohomail.com; s=zohoarc; b=dEcwmAhdzfh796T0dH+l2IC0/Q/IrBzcaqmxOr+MjJEUrsF9DXIABbFhSeBobuBWZ73JAC8Fid3qIn0L1v+rEPICT46AiXCXHWcsGfSF9VLZcOupIsoJGJT8MLkieE8y0j7bAR2CYV2NgwY0yyJmORv7tIRqcwZG7KNqSm2x24M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779845; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZiU1vgn3dCXK6hECI4P1DF+b8UvEGaSPkuX6t+DkkF4=; b=WUxor8y1hQvpHtkCiEVC2oAfevPcv7ehtg5KzhYesykQpQgWPNN8XhkjjoZa67gBsgV4FgLr5TMBprJtVUH68nJ72ctDkQs5INeV6iUvjVvA7dw/2o7uTrmYlbvKpB1YnJoJX3sSwh/9BinLdnpG8lnrsSeiu+xsRGY+p/8pD0Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1579779845228228.31648480129297; Thu, 23 Jan 2020 03:44:05 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-360-Ou4XyvUGMqijDtSmf6yQfw-1; Thu, 23 Jan 2020 06:44:01 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BD21D190D349; Thu, 23 Jan 2020 11:43:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8AB831001DD7; Thu, 23 Jan 2020 11:43:53 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4488785908; Thu, 23 Jan 2020 11:43:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBhhFp025355 for ; Thu, 23 Jan 2020 06:43:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id CEA0885750; Thu, 23 Jan 2020 11:43:43 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2134E85759; Thu, 23 Jan 2020 11:43:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779844; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ZiU1vgn3dCXK6hECI4P1DF+b8UvEGaSPkuX6t+DkkF4=; b=a3RCzVm86ocZk9HNeYHgpsjN6krmQD4cKXH/GRIXswuv/X0SINBIwLUlx+M2chx8+yVYcT mopeN8V15U/RYQ8UGZVK3p5yNGqBGdj9WIH3MnZLli2Y760Rbb9rYdEFZw4Dl+0Hxxr8Vh WHrC6IgYjLSprkESBfiQYiHaqmWA6dQ= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 08/32] src: remove unused sys/utsname.h includes Date: Thu, 23 Jan 2020 11:43:01 +0000 Message-Id: <20200123114325.3860881-9-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: Ou4XyvUGMqijDtSmf6yQfw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pavel Hrdina --- src/util/virhostcpu.c | 1 - src/util/virhostmem.c | 1 - 2 files changed, 2 deletions(-) diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c index 0bde532a0c..81293eea8c 100644 --- a/src/util/virhostcpu.c +++ b/src/util/virhostcpu.c @@ -22,7 +22,6 @@ #include =20 #include -#include #include #ifndef WIN32 # include diff --git a/src/util/virhostmem.c b/src/util/virhostmem.c index f37d1ad588..9097716f54 100644 --- a/src/util/virhostmem.c +++ b/src/util/virhostmem.c @@ -21,7 +21,6 @@ =20 #include =20 -#include #include #include =20 --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779842; cv=none; d=zohomail.com; s=zohoarc; b=iOiwMb3PgsGLGd06056+cDrcGJgZnxqXG6U0dypE6QcwwN1t/sPrawc5DY6Y4hUQwGdoNm3WdStNttFcMy8Cac/E5nfgcTjmHqCXzFo5i49lV8ybi7trRW5qSip9oyMFPSRJXGAl/yOXIAmjM6feCFLU5pclozkL+be+J4D/p00= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779842; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Wi8fyU57zWa+M5JGWckIgKfhFzM3SjxnqRnoicBOZ3w=; b=hlna1BlV9rRN/jIHF0laeEmEjRPT1BQ4GlSdpF4vy4gNnGoIxRwAWnTHqbvvXlF6GhHaYVYyZsi0LI8w9Nwlnik1qWT3Dl4m0j6RUYk7Mzx1W1u34rVJEAbQ9jvR+QOP5F07p5XmoiUkIi0ptcbcdIjgikhX/+0r5cusR9mSoLM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1579779842812554.3216816027538; Thu, 23 Jan 2020 03:44:02 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-384-EGNmZbxyO22Tk4w1kADP8A-1; Thu, 23 Jan 2020 06:43:57 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4DD1D800D50; Thu, 23 Jan 2020 11:43:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 222FD1001B2C; Thu, 23 Jan 2020 11:43:52 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D0C0E85905; Thu, 23 Jan 2020 11:43:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBhoNU025368 for ; Thu, 23 Jan 2020 06:43:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id AFF5585783; Thu, 23 Jan 2020 11:43:50 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF4A585759; Thu, 23 Jan 2020 11:43:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779841; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Wi8fyU57zWa+M5JGWckIgKfhFzM3SjxnqRnoicBOZ3w=; b=Uvuj/5w975O1V+x6d+Ad9Oh4izNCviw0S4q8ICrzRaxOLvhK28WQQV6zk0U0j/KXqUMMIo qY3MJAHB5ZUOszckiyoMlU5BCwx480ytPED9ETSiDhSVjoAg++nDhFaM+pQP5e2BMUQavY 1oFx/NAPLIKh5ir4DoZrFzlzBD5VxQQ= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 09/32] util: explicitly include windows.h Date: Thu, 23 Jan 2020 11:43:02 +0000 Message-Id: <20200123114325.3860881-10-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: EGNmZbxyO22Tk4w1kADP8A-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The virProcess code relies on windows.h and is getting it indirectly via some GNULIB header fixes. This dependancy needs to be made explicit. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pavel Hrdina --- src/util/virprocess.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/util/virprocess.c b/src/util/virprocess.c index d5589daf6a..d8ee3142da 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -50,6 +50,11 @@ # include #endif =20 +#ifdef WIN32 +# define WIN32_LEAN_AND_MEAN +# include +#endif + #include "viratomic.h" #include "virprocess.h" #include "virerror.h" --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779846; cv=none; d=zohomail.com; s=zohoarc; b=JzBiAm6pKQDu4TxkWjUG8DVf7Oz4aIYMHW7c5uzpbYGdO2Wzt9hn8UmuZyaW5iBUKd+PqJwKVf1qoBmj3MO4HuhFPY//AAuRCPBqXjMosuVimYwZ7r2AZIJPsKe9K+2cS+3SSthVEZqvyIY6J23hw6u/Hb/zoRzf+9d9q8G1JGM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779846; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DxG6rAUx9XMuQ96twSPrUEZlJ1r2h+2Xe8YHsIo2Owg=; b=kmcWNfQ/0OIuTC9ZvtC9Cd60nyOPeG379A7MDnnuUFu2RuEyQSqBVK1NjvA7voFXjCCKNqTRQhhQrtNnBgpfOhxx3+35kYKuEGngikV92N8z7T4rw1fs686q3nNiz/q3KMynMVlbuhsmOIzvhxFR0vI/NCcmaZbD3mb3X8VdjPE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1579779846514127.49087477132218; Thu, 23 Jan 2020 03:44:06 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-334-waiPnKdlOy29kAe2ZFeoRA-1; Thu, 23 Jan 2020 06:44:02 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E7A7B190D347; Thu, 23 Jan 2020 11:43:55 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C041485759; Thu, 23 Jan 2020 11:43:55 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7DFE58590A; Thu, 23 Jan 2020 11:43:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBhp9e025373 for ; Thu, 23 Jan 2020 06:43:51 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9599885750; Thu, 23 Jan 2020 11:43:51 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id F362885783; Thu, 23 Jan 2020 11:43:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779845; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=DxG6rAUx9XMuQ96twSPrUEZlJ1r2h+2Xe8YHsIo2Owg=; b=bZZK0Yu4KgOPY/p9nAxqYVufpTkO5NpEBfnSrbwEK2CG3fAphJ/S6eA7xwhhOWlZ0KytAk WqyFBz4QUK/q3Al8inqagwHKEJko1jgUYRxDvgvvZchSlSvKFelH9gBEAvOHP1W/rgPVYv ubF9RuWyw5LCJev1bSjhVZ2fUeSOooI= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 10/32] storage: remove use of stat-time.h headers Date: Thu, 23 Jan 2020 11:43:03 +0000 Message-Id: <20200123114325.3860881-11-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: waiPnKdlOy29kAe2ZFeoRA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The gnulib stat-time.h header provides wrapper functions to hide the differences in 'struct stat' between various platforms. Linux and FreeBSD support the same names, except for birthtime which Linux only provides in the new 'statx()' syscall we're not using. macOS has completely different naming. Since we only rely on this code in one place we just use conditionals at time of need. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pavel Hrdina --- src/storage/storage_util.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 987d937b04..7bbcfde064 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -71,7 +71,6 @@ #include "virfile.h" #include "virjson.h" #include "virqemu.h" -#include "stat-time.h" #include "virstring.h" #include "virxml.h" #include "virfdstream.h" @@ -1830,10 +1829,22 @@ virStorageBackendUpdateVolTargetInfoFD(virStorageSo= urcePtr target, =20 if (!target->timestamps && VIR_ALLOC(target->timestamps) < 0) return -1; - target->timestamps->atime =3D get_stat_atime(sb); - target->timestamps->btime =3D get_stat_birthtime(sb); - target->timestamps->ctime =3D get_stat_ctime(sb); - target->timestamps->mtime =3D get_stat_mtime(sb); + +#ifdef __APPLE__ + target->timestamps->atime =3D sb->st_atimespec; + target->timestamps->btime =3D sb->st_birthtimespec; + target->timestamps->ctime =3D sb->st_ctimespec; + target->timestamps->mtime =3D sb->st_mtimespec; +#else /* ! __APPLE__ */ + target->timestamps->atime =3D sb->st_atim; +# ifdef __linux__ + target->timestamps->btime =3D (struct timespec){0, 0}; +# else /* ! __linux__ */ + target->timestamps->btime =3D sb->st_birthtim; +# endif /* ! __linux__ */ + target->timestamps->ctime =3D sb->st_ctim; + target->timestamps->mtime =3D sb->st_mtim; +#endif /* ! __APPLE__ */ =20 target->type =3D VIR_STORAGE_TYPE_FILE; =20 --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779846; cv=none; d=zohomail.com; s=zohoarc; b=ahGNgjhcmMj0g45tGA1D1WDuvWOEfjiaxJ6+6ip22xqcE3KyIzFi1HGiLxakqyxeJtkuQLduzXnb49ISBzFlnxuiJfWngUe7jodTvpOfQNYXkYrEYXEtlvEBawE9hnvcB4JH/OXqRen+gP5mIdbsvAlMiHflbi6hsGQlrWLMwIw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779846; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6L62MJ1/1Bc9LxoUNjILbIC3nkIsMJvyxzz96rVMV0M=; b=GFsq3TG0lUKe3n/obg7sd+gMDRaAJN7Lpp7Jakr7nnJTR7iKk+tD5Qea1FQ7voD7Ule9d69VNsEReoKgXRhrAhN4QHkYFvKRoQdtiUryfFi79BSQvfqqLuxFATcMV3lwUUP3zzYuoiuFV13Azb3ZN7Earz8Vv3Zjdv8a3oR2Ptw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1579779846637407.6910006478789; Thu, 23 Jan 2020 03:44:06 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-48-3MYtFdiDNeebq22wiSqwQg-1; Thu, 23 Jan 2020 06:44:03 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 46054800D41; Thu, 23 Jan 2020 11:43:56 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1BE988CCD5; Thu, 23 Jan 2020 11:43:56 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D09BE180887A; Thu, 23 Jan 2020 11:43:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBhrDw025387 for ; Thu, 23 Jan 2020 06:43:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2CD0685757; Thu, 23 Jan 2020 11:43:53 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA8759CA3; Thu, 23 Jan 2020 11:43:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779845; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=6L62MJ1/1Bc9LxoUNjILbIC3nkIsMJvyxzz96rVMV0M=; b=CXCjnr7Fo29+f40iwH9FEBziQliHUB3uvs5J7Ez0G6jRFZFMCU/cqwEuJNSSeICixH1Be/ Y4xXXN5SXuCS/JvxSZ52sMAu5vZS3f4w3Oc8fjhCivtHo9AP/XUUg9yNlRmMreaV8hbrWS +oZRTn5ptTQttrfS9GnoVNCz9+VIoSg= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 11/32] src: implement APIs for passing FDs over UNIX sockets Date: Thu, 23 Jan 2020 11:43:04 +0000 Message-Id: <20200123114325.3860881-12-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: 3MYtFdiDNeebq22wiSqwQg-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This is a simplified variant of gnulib's passfd module without the portability code that we do not require. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pavel Hrdina --- src/libvirt_private.syms | 5 ++ src/qemu/qemu_interface.c | 4 +- src/rpc/virnetsocket.c | 5 +- src/util/virfile.c | 5 +- src/util/virsocket.c | 142 +++++++++++++++++++++++++++++++++++++- src/util/virsocket.h | 3 + 6 files changed, 154 insertions(+), 10 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index fa046051a3..4fe93e785c 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3004,6 +3004,11 @@ virSecretLookupFormatSecret; virSecretLookupParseSecret; =20 =20 +# util/virsocket.h +virSocketRecvFD; +virSocketSendFD; + + # util/virsocketaddr.h virSocketAddrBroadcast; virSocketAddrBroadcastByPrefix; diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c index bb62b53c04..48bb0043fe 100644 --- a/src/qemu/qemu_interface.c +++ b/src/qemu/qemu_interface.c @@ -25,7 +25,6 @@ #include "domain_audit.h" #include "domain_nwfilter.h" #include "qemu_interface.h" -#include "passfd.h" #include "viralloc.h" #include "virlog.h" #include "virstring.h" @@ -34,6 +33,7 @@ #include "virnetdevmacvlan.h" #include "virnetdevbridge.h" #include "virnetdevvportprofile.h" +#include "virsocket.h" =20 #include #include @@ -347,7 +347,7 @@ qemuCreateInBridgePortWithHelper(virQEMUDriverConfigPtr= cfg, } =20 do { - *tapfd =3D recvfd(pair[0], 0); + *tapfd =3D virSocketRecvFD(pair[0], 0); } while (*tapfd < 0 && errno =3D=3D EINTR); =20 if (*tapfd < 0) { diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index 973827ebde..687099720f 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -56,7 +56,6 @@ #include "virprobe.h" #include "virprocess.h" #include "virstring.h" -#include "passfd.h" =20 #if WITH_SSH2 # include "virnetsshsession.h" @@ -2045,7 +2044,7 @@ int virNetSocketSendFD(virNetSocketPtr sock, int fd) virObjectLock(sock); PROBE(RPC_SOCKET_SEND_FD, "sock=3D%p fd=3D%d", sock, fd); - if (sendfd(sock->fd, fd) < 0) { + if (virSocketSendFD(sock->fd, fd) < 0) { if (errno =3D=3D EAGAIN) ret =3D 0; else @@ -2078,7 +2077,7 @@ int virNetSocketRecvFD(virNetSocketPtr sock, int *fd) } virObjectLock(sock); =20 - if ((*fd =3D recvfd(sock->fd, O_CLOEXEC)) < 0) { + if ((*fd =3D virSocketRecvFD(sock->fd, O_CLOEXEC)) < 0) { if (errno =3D=3D EAGAIN) ret =3D 0; else diff --git a/src/util/virfile.c b/src/util/virfile.c index b3a63fa2ea..51a0d40b50 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -25,7 +25,6 @@ #include #include "internal.h" =20 -#include #include #ifndef WIN32 # include @@ -2268,7 +2267,7 @@ virFileOpenForked(const char *path, int openflags, mo= de_t mode, } =20 do { - ret =3D sendfd(pair[1], fd); + ret =3D virSocketSendFD(pair[1], fd); } while (ret < 0 && errno =3D=3D EINTR); =20 if (ret < 0) { @@ -2302,7 +2301,7 @@ virFileOpenForked(const char *path, int openflags, mo= de_t mode, VIR_FORCE_CLOSE(pair[1]); =20 do { - fd =3D recvfd(pair[0], 0); + fd =3D virSocketRecvFD(pair[0], 0); } while (fd < 0 && errno =3D=3D EINTR); VIR_FORCE_CLOSE(pair[0]); /* NB: this preserves errno */ if (fd < 0) diff --git a/src/util/virsocket.c b/src/util/virsocket.c index 96b9ece2b7..0e3775ac44 100644 --- a/src/util/virsocket.c +++ b/src/util/virsocket.c @@ -19,10 +19,12 @@ #include =20 #include "virsocket.h" +#include "virutil.h" +#include "virfile.h" =20 -#ifdef WIN32 +#include =20 -# include +#ifdef WIN32 =20 # define FD2SK(fd) _get_osfhandle(fd) # define SK2FD(sk) (_open_osfhandle((intptr_t) (sk), O_RDWR | O_BINARY)) @@ -365,3 +367,139 @@ vir_socket(int domain, int type, int protocol) } =20 #endif /* WIN32 */ + +/* The code that uses CMSG_FIRSTHDR is enabled on + Linux, Mac OS X, FreeBSD, OpenBSD, NetBSD, AIX, OSF/1, Cygwin. + The code that uses HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS is enabled on + HP-UX, IRIX, Solaris. */ + +/* MSG_CMSG_CLOEXEC is defined only on Linux, as of 2011. */ +#ifndef MSG_CMSG_CLOEXEC +# define MSG_CMSG_CLOEXEC 0 +#endif + +#ifndef WIN32 +/* virSocketSendFD sends the file descriptor fd along the socket + to a process calling recvfd on the other end. + + Return 0 on success, or -1 with errno set in case of error. +*/ +int +virSocketSendFD(int sock, int fd) +{ + char byte =3D 0; + struct iovec iov; + struct msghdr msg; + struct cmsghdr *cmsg; + char buf[CMSG_SPACE(sizeof(fd))]; + + /* send at least one char */ + memset(&msg, 0, sizeof(msg)); + iov.iov_base =3D &byte; + iov.iov_len =3D 1; + msg.msg_iov =3D &iov; + msg.msg_iovlen =3D 1; + msg.msg_name =3D NULL; + msg.msg_namelen =3D 0; + + msg.msg_control =3D buf; + msg.msg_controllen =3D sizeof(buf); + cmsg =3D CMSG_FIRSTHDR(&msg); + cmsg->cmsg_level =3D SOL_SOCKET; + cmsg->cmsg_type =3D SCM_RIGHTS; + cmsg->cmsg_len =3D CMSG_LEN(sizeof(fd)); + /* Initialize the payload: */ + memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd)); + msg.msg_controllen =3D cmsg->cmsg_len; + + if (sendmsg(sock, &msg, 0) !=3D iov.iov_len) + return -1; + return 0; +} +#else +int +virSocketSendFD(int sock G_GNUC_UNUSED, int fd G_GNUC_UNUSED) +{ + errno =3D ENOSYS; + return -1; +} +#endif + + +#ifndef WIN32 +/* virSocketRecvFD receives a file descriptor through the socket. + The flags are a bitmask, possibly including O_CLOEXEC (defined in ). + + Return the fd on success, or -1 with errno set in case of error. +*/ +int +virSocketRecvFD(int sock, int fdflags) +{ + char byte =3D 0; + struct iovec iov; + struct msghdr msg; + int fd =3D -1; + ssize_t len; + struct cmsghdr *cmsg; + char buf[CMSG_SPACE(sizeof(fd))]; + int fdflags_recvmsg =3D fdflags & O_CLOEXEC ? MSG_CMSG_CLOEXEC : 0; + + if ((fdflags & ~O_CLOEXEC) !=3D 0) { + errno =3D EINVAL; + return -1; + } + + /* send at least one char */ + memset(&msg, 0, sizeof(msg)); + iov.iov_base =3D &byte; + iov.iov_len =3D 1; + msg.msg_iov =3D &iov; + msg.msg_iovlen =3D 1; + msg.msg_name =3D NULL; + msg.msg_namelen =3D 0; + + msg.msg_control =3D buf; + msg.msg_controllen =3D sizeof(buf); + cmsg =3D CMSG_FIRSTHDR(&msg); + cmsg->cmsg_level =3D SOL_SOCKET; + cmsg->cmsg_type =3D SCM_RIGHTS; + cmsg->cmsg_len =3D CMSG_LEN(sizeof(fd)); + /* Initialize the payload: */ + memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd)); + msg.msg_controllen =3D cmsg->cmsg_len; + + len =3D recvmsg(sock, &msg, fdflags_recvmsg); + if (len < 0) + return -1; + + cmsg =3D CMSG_FIRSTHDR(&msg); + /* be paranoiac */ + if (len =3D=3D 0 || cmsg =3D=3D NULL || cmsg->cmsg_len !=3D CMSG_LEN(s= izeof(fd)) + || cmsg->cmsg_level !=3D SOL_SOCKET || cmsg->cmsg_type !=3D SCM_RI= GHTS) { + /* fake errno: at end the file is not available */ + errno =3D len ? EACCES : ENOTCONN; + return -1; + } + + memcpy(&fd, CMSG_DATA(cmsg), sizeof(fd)); + + /* set close-on-exec flag */ + if (!MSG_CMSG_CLOEXEC && (fdflags & O_CLOEXEC)) { + if (virSetCloseExec(fd) < 0) { + int saved_errno =3D errno; + VIR_FORCE_CLOSE(fd); + errno =3D saved_errno; + return -1; + } + } + + return fd; +} +#else +int +virSocketRecvFD(int sock G_GNUC_UNUSED, int fdflags G_GNUC_UNUSED) +{ + errno =3D ENOSYS; + return -1; +} +#endif diff --git a/src/util/virsocket.h b/src/util/virsocket.h index 33f237886f..e1e7d08bb4 100644 --- a/src/util/virsocket.h +++ b/src/util/virsocket.h @@ -20,6 +20,9 @@ =20 #include "internal.h" =20 +int virSocketSendFD(int sock, int fd); +int virSocketRecvFD(int sock, int fdflags); + #ifdef WIN32 =20 # define WIN32_LEAN_AND_MEAN --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779912; cv=none; d=zohomail.com; s=zohoarc; b=FFb/msbZ/nSoDvO1wCOrsBS60DCo9HoRvJeFtGD+uY4x2/j1js7eaKLMG2ALE+lUVuk7npEOuTLZ5vPqeGoVZP+tRpyemJSCnc7uQH+2jJz1TnXJs9zBidFwoglQLVIAWIgW3MtIgOpy0MAaGdmGfnxGbsxSIY1XzVKWQmYGXnY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779912; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Or5csbEVrEUmyupc3LP49ggskEEqRNKBmGmyjlgSjGw=; b=e8yXDerwUmrECngmI8W7NoAb5zC5bHYpV83YcOBgFZBVA/qXzxOht5ApxkiovJs862X5LmvLXE0qJzAkYVOLOeJ9XvZb9OJ7SfyA4KOLMJXLsnxBzGa/JetQzIYQsx4Xjhef/Ue0uJLh/Cm2t0XhVCghkDrQfNqQ2eNBUTF+Anc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1579779912755250.54126522645788; Thu, 23 Jan 2020 03:45:12 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-243-fDKETBwyOLqS0oaqmXtZHA-1; Thu, 23 Jan 2020 06:44:06 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 911D51005F72; Thu, 23 Jan 2020 11:44:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E31410631CD; Thu, 23 Jan 2020 11:44:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 725D21802030; Thu, 23 Jan 2020 11:43:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBhss5025403 for ; Thu, 23 Jan 2020 06:43:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id 634368575C; Thu, 23 Jan 2020 11:43:54 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 753A39CA3; Thu, 23 Jan 2020 11:43:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779911; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Or5csbEVrEUmyupc3LP49ggskEEqRNKBmGmyjlgSjGw=; b=ST+ZynhJB5yg6NtMZLYa9emBrKwlbD45o/IlSF92n+U76VPYr0crm5sN4jcRv10yIKG/oK Gn+FqRZzcr/BzvNvkp8loGXi5wjVIkCsMUYNP/d66neWXWuNT7MjH9bf3xWZPF2uCuV+tf 6TOssY7z/8sjq49YzR6wf1iVS3I0I9M= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 12/32] rpc: conditionalize signal handling Date: Thu, 23 Jan 2020 11:43:05 +0000 Message-Id: <20200123114325.3860881-13-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: fDKETBwyOLqS0oaqmXtZHA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The Windows platform does not have the signal handling support we need, so it must be disabled in several parts of the codebase. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/rpc/virnetclient.c | 33 ++++++++++++++++++++++-------- src/rpc/virnetdaemon.c | 35 +++++++++++++++++++++++++++++--- src/rpc/virnetdaemon.h | 4 ++++ tools/virsh-domain.c | 46 +++++++++++++++++++++++++++++++++++++----- tools/vsh.c | 12 ++++++++++- 5 files changed, 113 insertions(+), 17 deletions(-) diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index 50489b754c..eac02282e6 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -845,16 +845,19 @@ int virNetClientSetTLSSession(virNetClientPtr client, char buf[1]; int len; struct pollfd fds[1]; + +# ifndef WIN32 sigset_t oldmask, blockedsigs; =20 sigemptyset(&blockedsigs); -# ifdef SIGWINCH +# ifdef SIGWINCH sigaddset(&blockedsigs, SIGWINCH); -# endif -# ifdef SIGCHLD +# endif +# ifdef SIGCHLD sigaddset(&blockedsigs, SIGCHLD); -# endif +# endif sigaddset(&blockedsigs, SIGPIPE); +# endif /* !WIN32 */ =20 virObjectLock(client); =20 @@ -880,19 +883,23 @@ int virNetClientSetTLSSession(virNetClientPtr client, else fds[0].events =3D POLLOUT; =20 +# ifndef WIN32 /* Block SIGWINCH from interrupting poll in curses programs, * then restore the original signal mask again immediately * after the call (RHBZ#567931). Same for SIGCHLD and SIGPIPE * at the suggestion of Paolo Bonzini and Daniel Berrange. */ ignore_value(pthread_sigmask(SIG_BLOCK, &blockedsigs, &oldmask)); +# endif /* !WIN32 */ =20 repoll: ret =3D poll(fds, G_N_ELEMENTS(fds), -1); if (ret < 0 && (errno =3D=3D EAGAIN || errno =3D=3D EINTR)) goto repoll; =20 +# ifndef WIN32 ignore_value(pthread_sigmask(SIG_SETMASK, &oldmask, NULL)); +# endif /* !WIN32 */ } =20 ret =3D virNetTLSContextCheckCertificate(tls, client->tls); @@ -908,15 +915,19 @@ int virNetClientSetTLSSession(virNetClientPtr client, fds[0].revents =3D 0; fds[0].events =3D POLLIN; =20 +# ifndef WIN32 /* Block SIGWINCH from interrupting poll in curses programs */ ignore_value(pthread_sigmask(SIG_BLOCK, &blockedsigs, &oldmask)); +# endif /* !WIN32 */ =20 repoll2: ret =3D poll(fds, G_N_ELEMENTS(fds), -1); if (ret < 0 && (errno =3D=3D EAGAIN || errno =3D=3D EINTR)) goto repoll2; =20 +# ifndef WIN32 ignore_value(pthread_sigmask(SIG_SETMASK, &oldmask, NULL)); +# endif /* !WIN32 */ =20 len =3D virNetTLSSessionRead(client->tls, buf, 1); if (len < 0 && errno !=3D ENOMSG) { @@ -1574,7 +1585,9 @@ static int virNetClientIOEventLoop(virNetClientPtr cl= ient, =20 for (;;) { char ignore; +#ifndef WIN32 sigset_t oldmask, blockedsigs; +#endif /* !WIN32 */ int timeout =3D -1; virNetMessagePtr msg =3D NULL; =20 @@ -1615,27 +1628,31 @@ static int virNetClientIOEventLoop(virNetClientPtr = client, * can stuff themselves on the queue */ virObjectUnlock(client); =20 +#ifndef WIN32 /* Block SIGWINCH from interrupting poll in curses programs, * then restore the original signal mask again immediately * after the call (RHBZ#567931). Same for SIGCHLD and SIGPIPE * at the suggestion of Paolo Bonzini and Daniel Berrange. */ sigemptyset(&blockedsigs); -#ifdef SIGWINCH +# ifdef SIGWINCH sigaddset(&blockedsigs, SIGWINCH); -#endif -#ifdef SIGCHLD +# endif +# ifdef SIGCHLD sigaddset(&blockedsigs, SIGCHLD); -#endif +# endif sigaddset(&blockedsigs, SIGPIPE); ignore_value(pthread_sigmask(SIG_BLOCK, &blockedsigs, &oldmask)); +#endif /* !WIN32 */ =20 repoll: ret =3D poll(fds, G_N_ELEMENTS(fds), timeout); if (ret < 0 && (errno =3D=3D EAGAIN || errno =3D=3D EINTR)) goto repoll; =20 +#ifndef WIN32 ignore_value(pthread_sigmask(SIG_SETMASK, &oldmask, NULL)); +#endif /* !WIN32 */ =20 virObjectLock(client); =20 diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c index 570930436a..9634e93b52 100644 --- a/src/rpc/virnetdaemon.c +++ b/src/rpc/virnetdaemon.c @@ -45,6 +45,7 @@ =20 VIR_LOG_INIT("rpc.netdaemon"); =20 +#ifndef WIN32 typedef struct _virNetDaemonSignal virNetDaemonSignal; typedef virNetDaemonSignal *virNetDaemonSignalPtr; =20 @@ -54,17 +55,20 @@ struct _virNetDaemonSignal { virNetDaemonSignalFunc func; void *opaque; }; +#endif /* !WIN32 */ =20 struct _virNetDaemon { virObjectLockable parent; =20 bool privileged; =20 +#ifndef WIN32 size_t nsignals; virNetDaemonSignalPtr *signals; int sigread; int sigwrite; int sigwatch; +#endif /* !WIN32 */ =20 virHashTablePtr servers; virJSONValuePtr srvObject; @@ -84,10 +88,9 @@ static void virNetDaemonDispose(void *obj) { virNetDaemonPtr dmn =3D obj; +#ifndef WIN32 size_t i; =20 - VIR_FORCE_CLOSE(dmn->autoShutdownInhibitFd); - for (i =3D 0; i < dmn->nsignals; i++) { sigaction(dmn->signals[i]->signum, &dmn->signals[i]->oldaction, NU= LL); VIR_FREE(dmn->signals[i]); @@ -97,6 +100,9 @@ virNetDaemonDispose(void *obj) VIR_FORCE_CLOSE(dmn->sigwrite); if (dmn->sigwatch > 0) virEventRemoveHandle(dmn->sigwatch); +#endif /* !WIN32 */ + + VIR_FORCE_CLOSE(dmn->autoShutdownInhibitFd); =20 virHashFree(dmn->servers); =20 @@ -119,7 +125,9 @@ virNetDaemonPtr virNetDaemonNew(void) { virNetDaemonPtr dmn; +#ifndef WIN32 struct sigaction sig_action; +#endif /* !WIN32 */ =20 if (virNetDaemonInitialize() < 0) return NULL; @@ -130,16 +138,21 @@ virNetDaemonNew(void) if (!(dmn->servers =3D virHashCreate(5, virObjectFreeHashData))) goto error; =20 +#ifndef WIN32 dmn->sigwrite =3D dmn->sigread =3D -1; +#endif /* !WIN32 */ + dmn->privileged =3D geteuid() =3D=3D 0; dmn->autoShutdownInhibitFd =3D -1; =20 if (virEventRegisterDefaultImpl() < 0) goto error; =20 +#ifndef WIN32 memset(&sig_action, 0, sizeof(sig_action)); sig_action.sa_handler =3D SIG_IGN; sigaction(SIGPIPE, &sig_action, NULL); +#endif /* !WIN32 */ =20 return dmn; =20 @@ -587,7 +600,7 @@ virNetDaemonRemoveShutdownInhibition(virNetDaemonPtr dm= n) } =20 =20 - +#ifndef WIN32 static sig_atomic_t sigErrors; static int sigLastErrno; static int sigWrite =3D -1; @@ -689,6 +702,7 @@ virNetDaemonSignalSetup(virNetDaemonPtr dmn) return -1; } =20 + int virNetDaemonAddSignalHandler(virNetDaemonPtr dmn, int signum, @@ -731,6 +745,21 @@ virNetDaemonAddSignalHandler(virNetDaemonPtr dmn, return -1; } =20 +#else /* WIN32 */ + +int +virNetDaemonAddSignalHandler(virNetDaemonPtr dmn G_GNUC_UNUSED, + int signum G_GNUC_UNUSED, + virNetDaemonSignalFunc func G_GNUC_UNUSED, + void *opaque G_GNUC_UNUSED) +{ + virReportSystemError(ENOSYS, "%s", + _("Signal handling not available on this platform= ")); + return -1; +} + +#endif /* WIN32 */ + =20 static void virNetDaemonAutoShutdownTimer(int timerid G_GNUC_UNUSED, diff --git a/src/rpc/virnetdaemon.h b/src/rpc/virnetdaemon.h index 5a9842bee6..c2c7767037 100644 --- a/src/rpc/virnetdaemon.h +++ b/src/rpc/virnetdaemon.h @@ -55,6 +55,10 @@ void virNetDaemonAutoShutdown(virNetDaemonPtr dmn, void virNetDaemonAddShutdownInhibition(virNetDaemonPtr dmn); void virNetDaemonRemoveShutdownInhibition(virNetDaemonPtr dmn); =20 +#ifdef WIN32 +# define siginfo_t void +#endif + typedef void (*virNetDaemonSignalFunc)(virNetDaemonPtr dmn, siginfo_t *inf= o, void *opaque); =20 int virNetDaemonAddSignalHandler(virNetDaemonPtr dmn, diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index e64e08e5da..df4a03290f 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -1697,12 +1697,14 @@ virshPrintJobProgress(const char *label, unsigned l= ong long remaining, =20 static volatile sig_atomic_t intCaught; =20 +#ifndef WIN32 static void virshCatchInt(int sig G_GNUC_UNUSED, siginfo_t *siginfo G_GNUC_UNUSED, void *context G_GNUC_UNUSED) { intCaught =3D 1; } +#endif /* !WIN32 */ =20 =20 typedef struct _virshBlockJobWaitData virshBlockJobWaitData; @@ -1842,11 +1844,11 @@ virshBlockJobWait(virshBlockJobWaitDataPtr data) * the event to the given block job we will wait for the number of ret= ries * before claiming that we entered synchronised phase */ unsigned int retries =3D 5; - +#ifndef WIN32 struct sigaction sig_action; struct sigaction old_sig_action; sigset_t sigmask, oldsigmask; - +#endif /* !WIN32 */ unsigned long long start =3D 0; unsigned long long curr =3D 0; =20 @@ -1861,6 +1863,7 @@ virshBlockJobWait(virshBlockJobWaitDataPtr data) if (data->async_abort) abort_flags |=3D VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC; =20 +#ifndef WIN32 sigemptyset(&sigmask); sigaddset(&sigmask, SIGINT); =20 @@ -1869,6 +1872,7 @@ virshBlockJobWait(virshBlockJobWaitDataPtr data) sig_action.sa_flags =3D SA_SIGINFO; sigemptyset(&sig_action.sa_mask); sigaction(SIGINT, &sig_action, &old_sig_action); +#endif /* !WIN32 */ =20 if (data->timeout && virTimeMillisNow(&start) < 0) { vshSaveLibvirtError(); @@ -1878,9 +1882,13 @@ virshBlockJobWait(virshBlockJobWaitDataPtr data) last.cur =3D last.end =3D 0; =20 while (true) { +#ifndef WIN32 pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask); +#endif /* !WIN32 */ result =3D virDomainGetBlockJobInfo(data->dom, data->dev, &info, 0= ); +#ifndef WIN32 pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL); +#endif /* !WIN32 */ =20 if (result < 0) { vshError(data->ctl, _("failed to query job for disk %s"), data= ->dev); @@ -1944,7 +1952,9 @@ virshBlockJobWait(virshBlockJobWaitDataPtr data) virshPrintJobProgress(data->job_name, 0, 1); =20 cleanup: +#ifndef WIN32 sigaction(SIGINT, &old_sig_action, NULL); +#endif /* !WIN32 */ return ret; } =20 @@ -4226,12 +4236,14 @@ doSave(void *opaque) unsigned int flags =3D 0; const char *xmlfile =3D NULL; char *xml =3D NULL; +#ifndef WIN32 sigset_t sigmask, oldsigmask; =20 sigemptyset(&sigmask); sigaddset(&sigmask, SIGINT); if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) < 0) goto out_sig; +#endif /* !WIN32 */ =20 if (vshCommandOptStringReq(ctl, cmd, "file", &to) < 0) goto out; @@ -4265,8 +4277,10 @@ doSave(void *opaque) ret =3D '0'; =20 out: +#ifndef WIN32 pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL); out_sig: +#endif /* !WIN32 */ virshDomainFree(dom); VIR_FREE(xml); ignore_value(safewrite(data->writefd, &ret, sizeof(ret))); @@ -4285,8 +4299,11 @@ virshWatchJob(vshControl *ctl, void *opaque, const char *label) { +#ifndef WIN32 struct sigaction sig_action; struct sigaction old_sig_action; + sigset_t sigmask, oldsigmask; +#endif /* !WIN32 */ struct pollfd pollfd[2] =3D {{.fd =3D pipe_fd, .events =3D POLLIN, .re= vents =3D 0}, {.fd =3D STDIN_FILENO, .events =3D POLLIN, = .revents =3D 0}}; unsigned long long start_us, curr_us; @@ -4294,10 +4311,10 @@ virshWatchJob(vshControl *ctl, int ret =3D -1; char retchar; bool functionReturn =3D false; - sigset_t sigmask, oldsigmask; bool jobStarted =3D false; nfds_t npollfd =3D 2; =20 +#ifndef WIN32 sigemptyset(&sigmask); sigaddset(&sigmask, SIGINT); =20 @@ -4306,6 +4323,7 @@ virshWatchJob(vshControl *ctl, sig_action.sa_flags =3D SA_SIGINFO; sigemptyset(&sig_action.sa_mask); sigaction(SIGINT, &sig_action, &old_sig_action); +#endif /* !WIN32 */ =20 /* don't poll on STDIN if we are not using a terminal */ if (!vshTTYAvailable(ctl)) @@ -4355,9 +4373,13 @@ virshWatchJob(vshControl *ctl, } =20 if (verbose || !jobStarted) { +#ifndef WIN32 pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask); +#endif /* !WIN32 */ ret =3D virDomainGetJobInfo(dom, &jobinfo); +#ifndef WIN32 pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL); +#endif /* !WIN32 */ if (ret =3D=3D 0) { if (verbose && jobinfo.dataTotal > 0) virshPrintJobProgress(label, jobinfo.dataRemaining, @@ -4378,7 +4400,9 @@ virshWatchJob(vshControl *ctl, functionReturn =3D true; =20 cleanup: +#ifndef WIN32 sigaction(SIGINT, &old_sig_action, NULL); +#endif /* !WIN32 */ vshTTYRestore(ctl); return functionReturn; } @@ -4662,12 +4686,14 @@ doManagedsave(void *opaque) virDomainPtr dom =3D NULL; const char *name; unsigned int flags =3D 0; +#ifndef WIN32 sigset_t sigmask, oldsigmask; =20 sigemptyset(&sigmask); sigaddset(&sigmask, SIGINT); if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) < 0) goto out_sig; +#endif /* !WIN32 */ =20 if (vshCommandOptBool(cmd, "bypass-cache")) flags |=3D VIR_DOMAIN_SAVE_BYPASS_CACHE; @@ -4686,8 +4712,10 @@ doManagedsave(void *opaque) =20 ret =3D '0'; out: +#ifndef WIN32 pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL); out_sig: +#endif /* !WIN32 */ virshDomainFree(dom); ignore_value(safewrite(data->writefd, &ret, sizeof(ret))); } @@ -5340,17 +5368,19 @@ doDump(void *opaque) vshControl *ctl =3D data->ctl; const vshCmd *cmd =3D data->cmd; virDomainPtr dom =3D NULL; - sigset_t sigmask, oldsigmask; const char *name =3D NULL; const char *to =3D NULL; unsigned int flags =3D 0; const char *format =3D NULL; unsigned int dumpformat =3D VIR_DOMAIN_CORE_DUMP_FORMAT_RAW; +#ifndef WIN32 + sigset_t sigmask, oldsigmask; =20 sigemptyset(&sigmask); sigaddset(&sigmask, SIGINT); if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) < 0) goto out_sig; +#endif /* !WIN32 */ =20 if (vshCommandOptStringReq(ctl, cmd, "file", &to) < 0) goto out; @@ -5407,8 +5437,10 @@ doDump(void *opaque) =20 ret =3D '0'; out: +#ifndef WIN32 pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL); out_sig: +#endif /* !WIN32 */ if (dom) virshDomainFree(dom); ignore_value(safewrite(data->writefd, &ret, sizeof(ret))); @@ -10601,7 +10633,6 @@ doMigrate(void *opaque) virshCtrlData *data =3D opaque; vshControl *ctl =3D data->ctl; const vshCmd *cmd =3D data->cmd; - sigset_t sigmask, oldsigmask; virTypedParameterPtr params =3D NULL; int nparams =3D 0; int maxparams =3D 0; @@ -10609,11 +10640,14 @@ doMigrate(void *opaque) unsigned long long ullOpt =3D 0; int rv; virConnectPtr dconn =3D data->dconn; +#ifndef WIN32 + sigset_t sigmask, oldsigmask; =20 sigemptyset(&sigmask); sigaddset(&sigmask, SIGINT); if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) < 0) goto out_sig; +#endif /* !WIN32 */ =20 if (!(dom =3D virshCommandOptDomain(ctl, cmd, NULL))) goto out; @@ -10881,8 +10915,10 @@ doMigrate(void *opaque) } =20 out: +#ifndef WIN32 pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL); out_sig: +#endif /* !WIN32 */ virTypedParamsFree(params, nparams); virshDomainFree(dom); ignore_value(safewrite(data->writefd, &ret, sizeof(ret))); diff --git a/tools/vsh.c b/tools/vsh.c index 949c8dad7b..39bb75f192 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -2013,6 +2013,7 @@ vshEventLoop(void *opaque) =20 /* We want to use SIGINT to cancel a wait; but as signal handlers * don't have an opaque argument, we have to use static storage. */ +#ifndef WIN32 static int vshEventFd =3D -1; static struct sigaction vshEventOldAction; =20 @@ -2027,6 +2028,7 @@ vshEventInt(int sig G_GNUC_UNUSED, if (vshEventFd >=3D 0) ignore_value(safewrite(vshEventFd, &reason, 1)); } +#endif /* !WIN32 */ =20 =20 /* Event loop handler used to limit length of waiting for any other event.= */ @@ -2057,10 +2059,13 @@ vshEventTimeout(int timer G_GNUC_UNUSED, int vshEventStart(vshControl *ctl, int timeout_ms) { +#ifndef WIN32 struct sigaction action; + assert(vshEventFd =3D=3D -1); +#endif /* !WIN32 */ =20 assert(ctl->eventPipe[0] =3D=3D -1 && ctl->eventPipe[1] =3D=3D -1 && - vshEventFd =3D=3D -1 && ctl->eventTimerId >=3D 0); + ctl->eventTimerId >=3D 0); if (pipe2(ctl->eventPipe, O_CLOEXEC) < 0) { char ebuf[1024]; =20 @@ -2068,12 +2073,15 @@ vshEventStart(vshControl *ctl, int timeout_ms) virStrerror(errno, ebuf, sizeof(ebuf))); return -1; } + +#ifndef WIN32 vshEventFd =3D ctl->eventPipe[1]; =20 action.sa_sigaction =3D vshEventInt; action.sa_flags =3D SA_SIGINFO; sigemptyset(&action.sa_mask); sigaction(SIGINT, &action, &vshEventOldAction); +#endif /* !WIN32 */ =20 if (timeout_ms) virEventUpdateTimeout(ctl->eventTimerId, timeout_ms); @@ -2140,10 +2148,12 @@ vshEventWait(vshControl *ctl) void vshEventCleanup(vshControl *ctl) { +#ifndef WIN32 if (vshEventFd >=3D 0) { sigaction(SIGINT, &vshEventOldAction, NULL); vshEventFd =3D -1; } +#endif /* !WIN32 */ VIR_FORCE_CLOSE(ctl->eventPipe[0]); VIR_FORCE_CLOSE(ctl->eventPipe[1]); virEventUpdateTimeout(ctl->eventTimerId, -1); --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779851; cv=none; d=zohomail.com; s=zohoarc; b=boti5/m+tVVwmCaNJRn5wDTKtapN1Nxe3Nlf6sEhslmAG6EjEhdSC0/nnl+ioOzPm9YVUkWRcNw64kvxDnxs+uEzt6lo9NqhYkXt6saDqinyKy+xJgFWHh+JlvK6XiDDiW8a+/1WyKPrH9HrH6Z9eAtOyg0KoJTLvc3ZuI7EQVA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779851; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Fbuf6+G+x636HSAyRhjmDClTWqjPMXSptSVxCCuQssI=; b=kg19Ry5DZQZFuBdPDYVWtd3/Bxf3CGcGurBdhJ/fs6bwxyJRDeZvjR1mkg/K3YiQbE1xNR1h9g+5fpAxpoP8lITvr0Z1BhMQYZLRxdg+nkqCObhSbCqh5J4Jc8xrDmB233QhoXJscPNgBQ64X4fC9yl/MfXVYKvw+NTsfVFrXjs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1579779851003535.2654161095601; Thu, 23 Jan 2020 03:44:11 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-381-zii7QnmlPw-8xObDS3LsGQ-1; Thu, 23 Jan 2020 06:44:07 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A0E2210120A0; Thu, 23 Jan 2020 11:43:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 74F1128989; Thu, 23 Jan 2020 11:43:59 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 322388590B; Thu, 23 Jan 2020 11:43:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBhtJo025408 for ; Thu, 23 Jan 2020 06:43:55 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2009E85750; Thu, 23 Jan 2020 11:43:55 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 829748575D; Thu, 23 Jan 2020 11:43:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779850; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Fbuf6+G+x636HSAyRhjmDClTWqjPMXSptSVxCCuQssI=; b=FQDknMAvY1nKPhQBFQcYayF7sjBE9nCDozbWeu1PCBNU3V0u3RHP2jCOd1rp2O7r9AgV37 RYqsxecjCk3UzerODzX8mvfwZtmcwUYSwElkwHFDNHzjXVSH7gf7l9IGtuWsfgtHorWJVp +IFY/9cPtSB/eEDXlFFeopJzrKGgSaY= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 13/32] src: only import sys/uio.h when journald is built Date: Thu, 23 Jan 2020 11:43:06 +0000 Message-Id: <20200123114325.3860881-14-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: zii7QnmlPw-8xObDS3LsGQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The sys/uio.h header is only needed when building logging code with journald support enabled. Conditionally include it so that we avoid break on platforms which lack this header. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/util/virlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virlog.c b/src/util/virlog.c index ddc3ac1edb..8c17d666de 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -28,7 +28,6 @@ #include #include #include -#include #if HAVE_SYSLOG_H # include #endif @@ -52,6 +51,7 @@ * htole64. */ #if HAVE_SYSLOG_H && defined(__linux__) && HAVE_DECL_HTOLE64 # define USE_JOURNALD 1 +# include #endif =20 #define VIR_FROM_THIS VIR_FROM_NONE --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779907; cv=none; d=zohomail.com; s=zohoarc; b=Q9VMfYUX/HEZF8Z3skOaXPCj8MInDu+wXr9zXGZu6wUsk+ARn3eB+CEYFkXA4KjDfgyNhOpXO2yWwdPsWbLLak93jmi+L5Jq7B7Ni2fuJEtI86QWJB1yXMdwNE6hq2ZNqtvd9Dw0JNyAClUJ8it7FyuTBDoZi4Ri9rwU+3mXmkA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779907; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oRnengYz+E1QG+aurkmA9qvFCtPzSzte9Ze2tVvi5LU=; b=lt3hyy1vuOB026gROFra8HZW36IEoT3yxd5PuBJHGUQAnbbDBwuxgp7/+cfr3UduPylf5o6YIygJCW0UvYZ/gdXB/axlHfT7rw8BdcBnp6FE9/RhgYWMQ1iBbpTo1BnO28WFBAx5/84zC/s0ePG63bAOIJ6aG7JC0zOKZwV9zj0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1579779907090835.9224142561545; Thu, 23 Jan 2020 03:45:07 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-58-5us78kRtODWqecE_KBl0mw-1; Thu, 23 Jan 2020 06:44:10 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 05139477; Thu, 23 Jan 2020 11:44:05 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC56E60C88; Thu, 23 Jan 2020 11:44:04 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 866C98590C; Thu, 23 Jan 2020 11:44:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBhuk7025414 for ; Thu, 23 Jan 2020 06:43:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id 062E685750; Thu, 23 Jan 2020 11:43:56 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 68DF785754; Thu, 23 Jan 2020 11:43:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779905; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=oRnengYz+E1QG+aurkmA9qvFCtPzSzte9Ze2tVvi5LU=; b=LPUW5hMtPU5yeGickOGVuwJeUZEwPH6yZsU7i8IQNmm/1l7xQOCotpX3VXpf5OX4sYyxUg i7TiNv3IGTCQoh3w54NWwsdATWcmgwa8gJiJ8ChexI0rn1frLXlQUHX3VWOgcCeht2pIcn n6somyF/9HmdFMPDfVjUJwyWcCk2x3s= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 14/32] src: replace mkdir() with g_mkdir() Date: Thu, 23 Jan 2020 11:43:07 +0000 Message-Id: <20200123114325.3860881-15-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: 5us78kRtODWqecE_KBl0mw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" g_mkdir() provides portability to Windows platforms. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/util/virfile.c | 2 +- tests/virlockspacetest.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 51a0d40b50..d0e0062aa7 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -3029,7 +3029,7 @@ virFileMakePathHelper(char *path, mode_t mode) *p =3D '/'; } =20 - if (mkdir(path, mode) < 0 && errno !=3D EEXIST) + if (g_mkdir(path, mode) < 0 && errno !=3D EEXIST) return -1; =20 return 0; diff --git a/tests/virlockspacetest.c b/tests/virlockspacetest.c index 57deb288a9..40395e8c72 100644 --- a/tests/virlockspacetest.c +++ b/tests/virlockspacetest.c @@ -300,7 +300,7 @@ static int testLockSpaceResourceLockPath(const void *ar= gs G_GNUC_UNUSED) if (!(lockspace =3D virLockSpaceNew(NULL))) goto cleanup; =20 - if (mkdir(LOCKSPACE_DIR, 0700) < 0) + if (g_mkdir(LOCKSPACE_DIR, 0700) < 0) goto cleanup; =20 if (virLockSpaceCreateResource(lockspace, LOCKSPACE_DIR "/foo") < 0) --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779853; cv=none; d=zohomail.com; s=zohoarc; b=CJmyPSSDjhfVLfRqp8v/db4Z753mBC7dA5uC2DstcQh5PGMYFHeYZnK0zZO0WXvpmeLB+vq+z1RivUiOTwdYD/0uZy1brzpwl81smg/WxsWgX2eN7nxuHTfYfEGApt+H9Od0aDt7S8yLfk9ybUKDWTGor3IjlJV3FGXeC+RW81Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779853; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=38uTNYEaS8ZCTBUreVt6gQGa7bwfskp3E2wLz9q5bZU=; b=AzDZWzv68oMcbu0ziYfg58jLBt9cP0xir/DspiW+D5ZqUbkZ1BIku4Zozze3xZ6ah0n16mDC08jOW9tfT9ZYAbcwiCP10esY4drKpkPqM1Xr+uFUxFmWE3Ben8CaZq0jZf8EJtR/2716p045Fey0oIbAQfQkA4RGabBk16Cifew= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1579779853869150.01860337464905; Thu, 23 Jan 2020 03:44:13 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-318-rAY6DmghMMWnR4VUlb2yGQ-1; Thu, 23 Jan 2020 06:44:10 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CD8E5800053; Thu, 23 Jan 2020 11:44:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F84185754; Thu, 23 Jan 2020 11:44:04 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 56FE28590A; Thu, 23 Jan 2020 11:44:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBhuSf025428 for ; Thu, 23 Jan 2020 06:43:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id E38549CA3; Thu, 23 Jan 2020 11:43:56 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C5D085750; Thu, 23 Jan 2020 11:43:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779852; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=38uTNYEaS8ZCTBUreVt6gQGa7bwfskp3E2wLz9q5bZU=; b=W/IJxlR8sD4NitMZZEOBEQf0/ixW7HprwFeFjhCYVfM4LtfH+RWFC9lSL/5urN/Vm3l6iR BG3kVog7MO3l6TZYVZTguA6gyUfMm1ekKKrI/2vjj+CW+8qvez9tMQkyC4zJk6g6MGdFe7 g2vTJZuh45ZUZExnstNa1Qn0Z3Z2E10= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 15/32] m4: disable polkit build on Windows Date: Thu, 23 Jan 2020 11:43:08 +0000 Message-Id: <20200123114325.3860881-16-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: rAY6DmghMMWnR4VUlb2yGQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" polkit is only useful on Linux systems Signed-off-by: Daniel P. Berrang=C3=A9 --- m4/virt-polkit.m4 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/m4/virt-polkit.m4 b/m4/virt-polkit.m4 index 16889e1639..06da9e4ba6 100644 --- a/m4/virt-polkit.m4 +++ b/m4/virt-polkit.m4 @@ -25,6 +25,10 @@ AC_DEFUN([LIBVIRT_ARG_POLKIT], [ AC_DEFUN([LIBVIRT_CHECK_POLKIT], [ AC_REQUIRE([LIBVIRT_CHECK_DBUS]) =20 + if test "x$with_win" =3D "xyes"; then + with_polkit=3Dno + fi + if test "x$with_polkit" =3D "xcheck"; then dnl For --with-polkit=3Dcheck, also require the pkcheck binary, even dnl though we talk to polkit directly over D-Bus. --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779913; cv=none; d=zohomail.com; s=zohoarc; b=K0qC+cx0iCmi376okrE7uRUfgcp3twA2/E50w4RFxUlvTIndkeLrkFyT2rbnXu1m68XQ6OUXq6qiASujrmstvv7vFkfiGzWI1kpV9cAmzgblQjlnrp4QAQDvXAdBYEi+zJiZ4+FMlwBSpX61Q3OdKEy9QN+FIXtMEdWsQZjIKis= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779913; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eklhtOkGGv6Vs69KB4Jwkbijo5TgR79UpPNy7AUcv6w=; b=gB3zEcmr6UiOnhu/PsRWyXZJmNF2Yu3s9uIVdN6uT3lozQafrsH+E9WZ8tQAUFpJiPocyAwhxDTQ5fMmwbHnRGVI1H9/a89sQDPo4cVIgNQV2FAo3ObiByj119EpBvRW8/YF4tLe5kgX8VUwuXWxuk6m9CurpvQ1P/bVCIFY65A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1579779913650942.2186702279322; Thu, 23 Jan 2020 03:45:13 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-404-HU4DMVBEPWGK0TMmA6IwAw-1; Thu, 23 Jan 2020 06:44:14 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 17AE88010E4; Thu, 23 Jan 2020 11:44:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E202F8575F; Thu, 23 Jan 2020 11:44:08 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8B3EB1803C41; Thu, 23 Jan 2020 11:44:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBhv5w025440 for ; Thu, 23 Jan 2020 06:43:57 -0500 Received: by smtp.corp.redhat.com (Postfix) id CCE9285757; Thu, 23 Jan 2020 11:43:57 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 373E39CA3; Thu, 23 Jan 2020 11:43:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779911; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=eklhtOkGGv6Vs69KB4Jwkbijo5TgR79UpPNy7AUcv6w=; b=IkXLhokxqGTur9owiF3Hux+y8+J7vppP1fCRmys8adWn5CADtlVEVF8JqfrumGhAISF2hV nkIruUlR8jUDPN2SF409uXRlV1/Vr0zfL9GrTjEMrH4C59KlLU0Ctu3cumRjRtzoM8lU8y 8aoEj0t3GiQvVpyLNdZ+XwXFTBJDWWY= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 16/32] util: conditionalize more of virCommand on WIN32 Date: Thu, 23 Jan 2020 11:43:09 +0000 Message-Id: <20200123114325.3860881-17-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: HU4DMVBEPWGK0TMmA6IwAw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" A large part of the virCommand code is still built on WIN32, despite the fact that the core fork() & execve() functions are not available. So despite succesfully building most of the code, at runtime the APIs are none the less unusuable. With the elimination of GNULIB many of the APIs being used in this code no longer have portability wrappers/shims for Windows. Rather than try to add portability wrappers, or do tests for each individual function, it is clearer to conditionalize nearly all of the code using #ifdef WIN32. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/util/vircommand.c | 165 ++++++++++++++++++++++++++---------------- 1 file changed, 103 insertions(+), 62 deletions(-) diff --git a/src/util/vircommand.c b/src/util/vircommand.c index dd37b0b8dc..26b3488d6b 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -21,11 +21,15 @@ =20 #include =20 -#include +#ifndef WIN32 +# include +#endif #include #include #include -#include +#ifndef WIN32 +# include +#endif #include #include =20 @@ -153,7 +157,9 @@ struct _virCommand { static virBufferPtr dryRunBuffer; static virCommandDryRunCallback dryRunCallback; static void *dryRunOpaque; +#ifndef WIN32 static int dryRunStatus; +#endif /* !WIN32 */ =20 /* * virCommandFDIsSet: @@ -538,6 +544,7 @@ virCommandMassClose(virCommandPtr cmd, return 0; } =20 + /* * virExec: * @cmd virCommandPtr containing all information about the program to @@ -805,6 +812,7 @@ virExec(virCommandPtr cmd) return -1; } =20 + /** * virRun: * @argv NULL terminated argv to run @@ -842,18 +850,6 @@ virRun(const char *const *argv G_GNUC_UNUSED, return -1; } =20 -static int -virExec(virCommandPtr cmd G_GNUC_UNUSED) -{ - /* XXX: Some day we can implement pieces of virCommand/virExec on - * top of _spawn() or CreateProcess(), but we can't implement - * everything, since mingw completely lacks fork(), so we cannot - * run our own code in the child process. */ - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("virExec is not implemented for WIN32")); - return -1; -} - pid_t virFork(void) { @@ -1682,6 +1678,7 @@ virCommandFreeSendBuffers(virCommandPtr cmd) } =20 =20 +#ifndef WIN32 /** * virCommandSetSendBuffer * @cmd: the command to modify @@ -1690,7 +1687,6 @@ virCommandFreeSendBuffers(virCommandPtr cmd) * given file descriptor. The buffer will be freed automatically * and the file descriptor closed. */ -#if defined(F_SETFL) int virCommandSetSendBuffer(virCommandPtr cmd, int fd, @@ -1724,23 +1720,6 @@ virCommandSetSendBuffer(virCommandPtr cmd, return 0; } =20 -#else /* !defined(F_SETFL) */ - -int -virCommandSetSendBuffer(virCommandPtr cmd, - int fd G_GNUC_UNUSED, - unsigned char *buffer G_GNUC_UNUSED, - size_t buflen G_GNUC_UNUSED) -{ - if (!cmd || cmd->has_error) - return -1; - - cmd->has_error =3D ENOTSUP; - - return -1; -} - -#endif =20 static int virCommandSendBuffersFillPollfd(virCommandPtr cmd, @@ -1797,6 +1776,9 @@ virCommandSendBuffersHandlePoll(virCommandPtr cmd, return 0; } =20 +#endif /* !WIN32 */ + + /** * virCommandSetInputBuffer: * @cmd: the command to modify @@ -2105,6 +2087,7 @@ virCommandToString(virCommandPtr cmd, bool linebreaks) } =20 =20 +#ifndef WIN32 /* * Manage input and output to the child process. */ @@ -2276,7 +2259,6 @@ virCommandProcessIO(virCommandPtr cmd) * Returns -1 on any error executing the command. * Will not return on success. */ -#ifndef WIN32 int virCommandExec(virCommandPtr cmd, gid_t *groups, int ngroups) { if (!cmd ||cmd->has_error =3D=3D ENOMEM) { @@ -2299,19 +2281,7 @@ int virCommandExec(virCommandPtr cmd, gid_t *groups,= int ngroups) cmd->args[0]); return -1; } -#else -int virCommandExec(virCommandPtr cmd G_GNUC_UNUSED, gid_t *groups G_GNUC_U= NUSED, - int ngroups G_GNUC_UNUSED) -{ - /* Mingw execve() has a broken signature. Disable this - * function until gnulib fixes the signature, since we - * don't really need this on Win32 anyway. - */ - virReportSystemError(ENOSYS, "%s", - _("Executing new processes is not supported on Wi= n32 platform")); - return -1; -} -#endif + =20 /** * virCommandRun: @@ -2516,7 +2486,7 @@ virCommandRunAsync(virCommandPtr cmd, pid_t *pid) } cmd->infd =3D infd[0]; cmd->inpipe =3D infd[1]; -#if defined (F_SETFL) + if (fcntl(cmd->inpipe, F_SETFL, O_NONBLOCK) < 0) { virReportSystemError(errno, "%s", _("fcntl failed to set O_NONBLOCK")); @@ -2524,11 +2494,6 @@ virCommandRunAsync(virCommandPtr cmd, pid_t *pid) ret =3D -1; goto cleanup; } -#else /* !defined(F_SETFL) */ - cmd->has_error =3D ENOTSUP; - ret =3D -1; - goto cleanup; -#endif } else if ((cmd->inbuf && cmd->infd =3D=3D -1) || (cmd->outbuf && cmd->outfdptr !=3D &cmd->outfd) || (cmd->errbuf && cmd->errfdptr !=3D &cmd->errfd)) { @@ -2719,7 +2684,6 @@ virCommandWait(virCommandPtr cmd, int *exitstatus) } =20 =20 -#ifndef WIN32 /** * virCommandAbort: * @cmd: command to abort @@ -2738,15 +2702,6 @@ virCommandAbort(virCommandPtr cmd) cmd->pid =3D -1; cmd->reap =3D false; } -#else /* WIN32 */ -void -virCommandAbort(virCommandPtr cmd G_GNUC_UNUSED) -{ - /* Mingw lacks WNOHANG and kill(). But since we haven't ported - * virExec to mingw yet, there's no process to be killed, - * making this implementation trivially correct for now :) */ -} -#endif =20 =20 /** @@ -2891,6 +2846,92 @@ int virCommandHandshakeNotify(virCommandPtr cmd) VIR_FORCE_CLOSE(cmd->handshakeNotify[1]); return 0; } +#else /* WIN32 */ +int +virCommandSetSendBuffer(virCommandPtr cmd, + int fd G_GNUC_UNUSED, + unsigned char *buffer G_GNUC_UNUSED, + size_t buflen G_GNUC_UNUSED) +{ + if (!cmd || cmd->has_error) + return -1; + + cmd->has_error =3D ENOTSUP; + + return -1; +} + + +int +virCommandExec(virCommandPtr cmd G_GNUC_UNUSED, gid_t *groups G_GNUC_UNUSE= D, + int ngroups G_GNUC_UNUSED) +{ + virReportSystemError(ENOSYS, "%s", + _("Executing new processes is not supported on Wi= n32 platform")); + return -1; +} + + +int +virCommandRun(virCommandPtr cmd G_GNUC_UNUSED, int *exitstatus G_GNUC_UNUS= ED) +{ + virReportSystemError(ENOSYS, "%s", + _("Executing new processes is not supported on Wi= n32 platform")); + return -1; +} + + +int +virCommandRunAsync(virCommandPtr cmd G_GNUC_UNUSED, pid_t *pid G_GNUC_UNUS= ED) +{ + virReportSystemError(ENOSYS, "%s", + _("Executing new processes is not supported on Wi= n32 platform")); + return -1; +} + + +int +virCommandWait(virCommandPtr cmd G_GNUC_UNUSED, int *exitstatus G_GNUC_UNU= SED) +{ + virReportSystemError(ENOSYS, "%s", + _("Executing new processes is not supported on Wi= n32 platform")); + return -1; +} + + +void +virCommandAbort(virCommandPtr cmd G_GNUC_UNUSED) +{ + /* Mingw lacks WNOHANG and kill(). But since we haven't ported + * virExec to mingw yet, there's no process to be killed, + * making this implementation trivially correct for now :) */ +} + + +void virCommandRequireHandshake(virCommandPtr cmd) +{ + if (!cmd || cmd->has_error) + return; + + cmd->has_error =3D ENOSYS; +} + + +int virCommandHandshakeWait(virCommandPtr cmd G_GNUC_UNUSED) +{ + virReportSystemError(ENOSYS, "%s", + _("Executing new processes is not supported on Wi= n32 platform")); + return -1; +} + + +int virCommandHandshakeNotify(virCommandPtr cmd G_GNUC_UNUSED) +{ + virReportSystemError(ENOSYS, "%s", + _("Executing new processes is not supported on Wi= n32 platform")); + return -1; +} +#endif /* WIN32 */ =20 =20 /** --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779858; cv=none; d=zohomail.com; s=zohoarc; b=EclSgWejB4xSUlhetVEflgtHAo3IjC5tJHAS5NFENnYoGI2Q8LLb9UODcVRrMBoyU9Ip1xuF0oH+D+FaaYMWlYT4/RMWM9FcZWnpIdkwe2H4rvEZBypbX4KNx9ZtqOucrUDglm1LI8ZjvLeX6P1KjIGRkteEMdw2+KOkrZxcT1Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779858; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8Lxk71+0Xbd5FXrXdC2Iv2RFuDmqBqF0+dyP3zPGhAE=; b=evaIj23w8b4cDKFHoJL5uTlcW054C80rTkOQSs+1wxq1Tw0wIimZdD4hJBLgxQUYv3qm1q49HS6ugwpdPFkG9VEXtOSqGvPYYak0AsgTZUc4myTv5mXphI4E7JpkyB84xQkcoRUg9iFMDrKpK/pUs5Wc+EjNFNZQECOSKcbXmRI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1579779858250119.4793105980392; Thu, 23 Jan 2020 03:44:18 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-417-D7BHkVQ8OuqqRwqo5_cwug-1; Thu, 23 Jan 2020 06:44:14 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0CC0810120A0; Thu, 23 Jan 2020 11:44:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C1DB21001DDE; Thu, 23 Jan 2020 11:44:08 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7D96885913; Thu, 23 Jan 2020 11:44:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBhwKR025447 for ; Thu, 23 Jan 2020 06:43:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id B40F585754; Thu, 23 Jan 2020 11:43:58 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F7D29CA3; Thu, 23 Jan 2020 11:43:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779857; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=8Lxk71+0Xbd5FXrXdC2Iv2RFuDmqBqF0+dyP3zPGhAE=; b=c6UyhKPmSXr+iusRfEUAJw/+jNi1HarIHye3i6fkwEZqn67y7DpBeuhGvOi9eDpoJ8mf1S EJhPq934PYh6SZ4hr3BN9RTVunzVl4kMksc+rqzrmtoyLq6pxBs3So8NGJuF14CgmGwFOQ fgD/2YsfoaRVxQ1dq2zLeWqSe3bIL/U= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 17/32] src: remove all traces of Cygwin support Date: Thu, 23 Jan 2020 11:43:10 +0000 Message-Id: <20200123114325.3860881-18-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: D7BHkVQ8OuqqRwqo5_cwug-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Cygwin is not a supported build platform for libvirt and has no testing coverage in our CI systems. Stop pretending the code is usable and remove it so there is less to port to Meson. Signed-off-by: Daniel P. Berrang=C3=A9 --- configure.ac | 11 ++--------- m4/virt-compile-pie.m4 | 2 +- m4/virt-win-common.m4 | 8 +++----- m4/virt-win-cygwin.m4 | 32 -------------------------------- m4/virt-win-symbols.m4 | 4 ++-- m4/virt-win-windres.m4 | 4 ++-- m4/virt-xdr.m4 | 9 +++------ src/Makefile.am | 8 +++----- src/admin/Makefile.inc.am | 1 - src/locking/Makefile.inc.am | 1 - src/logging/Makefile.inc.am | 1 - src/rpc/Makefile.inc.am | 3 --- src/rpc/genprotocol.pl | 2 +- src/util/virsocketaddr.h | 10 ---------- src/util/virxdrdefs.h | 12 +----------- 15 files changed, 18 insertions(+), 90 deletions(-) delete mode 100644 m4/virt-win-cygwin.m4 diff --git a/configure.ac b/configure.ac index f0d79b95d4..855654c75d 100644 --- a/configure.ac +++ b/configure.ac @@ -181,8 +181,6 @@ case "$host" in # mingw's ld has the --version-script parameter, but it requires a .de= f file # instead to work properly, therefore clear --version-script here and = use # -Wl, to pass the .def file to the linker - # cygwin's ld has the --version-script parameter too, but for some rea= son - # it's working there as expected VERSION_SCRIPT_FLAGS=3D"-Wl," ;; * ) @@ -204,13 +202,12 @@ dnl are also linux specific. The "network" and stora= ge_fs drivers are known dnl to not work on macOS presently, so we also make a note if compiling dnl for that =20 -with_linux=3Dno with_macos=3Dno with_freebsd=3Dno with_win=3Dno with_cygwi= n=3Dno +with_linux=3Dno with_macos=3Dno with_freebsd=3Dno with_win=3Dno case $host in *-*-linux*) with_linux=3Dyes ;; *-*-darwin*) with_macos=3Dyes ;; *-*-freebsd*) with_freebsd=3Dyes ;; *-*-mingw* | *-*-msvc* ) with_win=3Dyes ;; - *-*-cygwin*) with_cygwin=3Dyes ;; esac =20 if test $with_linux =3D no; then @@ -227,9 +224,6 @@ if test $with_freebsd =3D yes; then with_firewalld=3Dno fi =20 -if test $with_cygwin =3D yes; then - with_vbox=3Dno -fi =20 AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" =3D "yes"]) AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" =3D "yes"]) @@ -778,9 +772,8 @@ if test "$enable_test_coverage" =3D yes; then WARN_CFLAGS=3D$save_WARN_CFLAGS fi =20 -dnl Cygwin, MinGW and MSVC checks +dnl MinGW checks LIBVIRT_WIN_CHECK_COMMON -LIBVIRT_WIN_CHECK_CYGWIN LIBVIRT_WIN_CHECK_MINGW LIBVIRT_WIN_CHECK_SYMBOLS LIBVIRT_WIN_CHECK_WINDRES diff --git a/m4/virt-compile-pie.m4 b/m4/virt-compile-pie.m4 index a2df38ea72..da5cdf57b7 100644 --- a/m4/virt-compile-pie.m4 +++ b/m4/virt-compile-pie.m4 @@ -22,7 +22,7 @@ AC_DEFUN([LIBVIRT_COMPILE_PIE],[ PIE_CFLAGS=3D PIE_LDFLAGS=3D case "$host" in - *-*-mingw* | *-*-msvc* | *-*-cygwin* ) + *-*-mingw* ) ;; dnl All code is position independent on Win32 target *) gl_COMPILER_OPTION_IF([-fPIE -DPIE -pie], [ diff --git a/m4/virt-win-common.m4 b/m4/virt-win-common.m4 index b639866e64..ebc9d0836e 100644 --- a/m4/virt-win-common.m4 +++ b/m4/virt-win-common.m4 @@ -1,4 +1,4 @@ -dnl The Cygwin, MinGW and MSVC common checks +dnl The MinGW common checks dnl dnl Copyright (C) 2016 Red Hat, Inc. dnl @@ -22,7 +22,7 @@ AC_DEFUN([LIBVIRT_WIN_CHECK_COMMON], [ WIN32_EXTRA_LIBS=3D =20 case "$host" in - *-*-mingw* | *-*-cygwin* | *-*-msvc* ) + *-*-mingw* ) WIN32_EXTRA_LIBS=3D"-lole32 -loleaut32" # If the host is Windows, and shared libraries are disabled, we # need to add -DLIBVIRT_STATIC to the CFLAGS for proper linking @@ -38,7 +38,5 @@ AC_DEFUN([LIBVIRT_WIN_CHECK_COMMON], [ =20 AC_DEFUN([LIBVIRT_WIN_RESULT_COMMON], [ details=3D"CFLAGS=3D'$WIN32_EXTRA_CFLAGS' LIBS=3D'$WIN32_EXTRA_LIBS'" - LIBVIRT_RESULT([Cygwin], [$with_cygwin], [$details]) - LIBVIRT_RESULT([MinGW], [$with_cygwin], [$details]) - LIBVIRT_RESULT([MSVC], [$with_cygwin], [$details]) + LIBVIRT_RESULT([MinGW], [$with_win], [$details]) ]) diff --git a/m4/virt-win-cygwin.m4 b/m4/virt-win-cygwin.m4 deleted file mode 100644 index 211b3c2b7b..0000000000 --- a/m4/virt-win-cygwin.m4 +++ /dev/null @@ -1,32 +0,0 @@ -dnl The Cygwin check -dnl -dnl Copyright (C) 2016 Red Hat, Inc. -dnl -dnl This library is free software; you can redistribute it and/or -dnl modify it under the terms of the GNU Lesser General Public -dnl License as published by the Free Software Foundation; either -dnl version 2.1 of the License, or (at your option) any later version. -dnl -dnl This library is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl Lesser General Public License for more details. -dnl -dnl You should have received a copy of the GNU Lesser General Public -dnl License along with this library. If not, see -dnl . -dnl - -AC_DEFUN([LIBVIRT_WIN_CHECK_CYGWIN], [ - CYGWIN_EXTRA_LDFLAGS=3D - CYGWIN_EXTRA_LIBADD=3D - case "$host" in - *-*-cygwin*) - CYGWIN_EXTRA_LDFLAGS=3D"-no-undefined" - CYGWIN_EXTRA_LIBADD=3D"${INTLLIBS}" - ;; - esac - - AC_SUBST([CYGWIN_EXTRA_LDFLAGS]) - AC_SUBST([CYGWIN_EXTRA_LIBADD]) -]) diff --git a/m4/virt-win-symbols.m4 b/m4/virt-win-symbols.m4 index 66dd3b7b1c..eba5596e4b 100644 --- a/m4/virt-win-symbols.m4 +++ b/m4/virt-win-symbols.m4 @@ -1,4 +1,4 @@ -dnl The Cygwin, MinGW and MSVC symbols checks +dnl The MinGW symbols checks dnl dnl Copyright (C) 2016 Red Hat, Inc. dnl @@ -23,7 +23,7 @@ AC_DEFUN([LIBVIRT_WIN_CHECK_SYMBOLS], [ LIBVIRT_LXC_SYMBOL_FILE=3D'$(srcdir)/libvirt_lxc.syms' LIBVIRT_QEMU_SYMBOL_FILE=3D'$(srcdir)/libvirt_qemu.syms' case "$host" in - *-*-mingw* | *-*-msvc* ) + *-*-mingw* ) # Also set the symbol file to .def, so src/Makefile generates libvir= t.def # from libvirt.syms and passes libvirt.def instead of libvirt.syms t= o the # linker diff --git a/m4/virt-win-windres.m4 b/m4/virt-win-windres.m4 index af27f231b4..e913eb48b8 100644 --- a/m4/virt-win-windres.m4 +++ b/m4/virt-win-windres.m4 @@ -1,4 +1,4 @@ -dnl The Cygwin, MinGW and MSVC windres checks +dnl The MinGW windres checks dnl dnl Copyright (C) 2016 Red Hat, Inc. dnl @@ -21,7 +21,7 @@ AC_DEFUN([LIBVIRT_WIN_CHECK_WINDRES], [ dnl Look for windres to build a Windows icon resource. with_windres=3Dno case "$host" in - *-*-mingw* | *-*-cygwin* | *-*-msvc* ) + *-*-mingw* ) AC_CHECK_TOOL([WINDRES], [windres], []) if test "x$WINDRES" !=3D "x"; then with_windres=3Dyes diff --git a/m4/virt-xdr.m4 b/m4/virt-xdr.m4 index a65407d955..83754157d9 100644 --- a/m4/virt-xdr.m4 +++ b/m4/virt-xdr.m4 @@ -22,18 +22,15 @@ AC_DEFUN([LIBVIRT_CHECK_XDR], [ if test x"$with_remote" =3D x"yes" || test x"$with_libvirtd" =3D x"yes";= then dnl Where are the XDR functions? dnl If portablexdr is installed, prefer that. - dnl Otherwise try -lrpc (Cygwin) -lxdr (some MinGW), -lnsl (Solaris) + dnl Otherwise try -lxdr (some MinGW) dnl -ltirpc (glibc 2.13.90 or newer) or none (most Unix) AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[ - AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl tirpc],[], + AC_SEARCH_LIBS([xdrmem_create],[xdr tirpc],[], [AC_MSG_ERROR([Cannot find a XDR library])]) ]) with_xdr=3D"yes" =20 - dnl check for cygwin's variation in xdr function names - AC_CHECK_FUNCS([xdr_u_int64_t],[],[],[#include ]) - - dnl Cygwin/recent glibc requires -I/usr/include/tirpc for + dnl Recent glibc requires -I/usr/include/tirpc for old_CFLAGS=3D$CFLAGS AC_CACHE_CHECK([where to find ], [lv_cv_xdr_cflags], [ for add_CFLAGS in '' '-I/usr/include/tirpc' 'missing'; do diff --git a/src/Makefile.am b/src/Makefile.am index c9b5eeba47..a9b71131ce 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -42,7 +42,6 @@ AM_LDFLAGS =3D $(DRIVER_MODULES_LDFLAGS) \ $(COVERAGE_LDFLAGS) \ $(RELRO_LDFLAGS) \ $(NO_INDIRECT_LDFLAGS) \ - $(CYGWIN_EXTRA_LDFLAGS) \ $(MINGW_EXTRA_LDFLAGS) \ $(NULL) AM_LDFLAGS_MOD =3D \ @@ -449,8 +448,7 @@ endif WITH_MACOS libvirt_la_LDFLAGS +=3D $(NULL) libvirt_la_BUILT_LIBADD +=3D ../gnulib/lib/libgnu.la libvirt_la_LIBADD +=3D \ - $(DRIVER_MODULES_LIBS) \ - $(CYGWIN_EXTRA_LIBADD) + $(DRIVER_MODULES_LIBS) libvirt_la_CFLAGS =3D -DIN_LIBVIRT $(AM_CFLAGS) # Because we specify libvirt_la_DEPENDENCIES for $(LIBVIRT_SYMBOL_FILE), we # lose automake's automatic dependencies on an appropriate subset of @@ -517,7 +515,7 @@ libvirt_qemu_la_LDFLAGS =3D \ $(AM_LDFLAGS) \ $(NULL) libvirt_qemu_la_CFLAGS =3D $(AM_CFLAGS) -libvirt_qemu_la_LIBADD =3D libvirt.la $(CYGWIN_EXTRA_LIBADD) +libvirt_qemu_la_LIBADD =3D libvirt.la =20 libvirt_lxc_la_SOURCES =3D libvirt-lxc.c libvirt_lxc_la_LDFLAGS =3D \ @@ -527,7 +525,7 @@ libvirt_lxc_la_LDFLAGS =3D \ $(AM_LDFLAGS) \ $(NULL) libvirt_lxc_la_CFLAGS =3D $(AM_CFLAGS) -libvirt_lxc_la_LIBADD =3D libvirt.la $(CYGWIN_EXTRA_LIBADD) +libvirt_lxc_la_LIBADD =3D libvirt.la =20 EXTRA_DIST +=3D \ $(SYSCONF_FILES) \ diff --git a/src/admin/Makefile.inc.am b/src/admin/Makefile.inc.am index 7ceccafa8e..b4e2f1f2d3 100644 --- a/src/admin/Makefile.inc.am +++ b/src/admin/Makefile.inc.am @@ -73,7 +73,6 @@ libvirt_admin_la_LDFLAGS =3D \ =20 libvirt_admin_la_LIBADD =3D \ libvirt.la \ - $(CYGWIN_EXTRA_LIBADD) \ $(CAPNG_LIBS) \ $(YAJL_LIBS) \ $(DEVMAPPER_LIBS) \ diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index 65b46ad5f3..d49383d9d7 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -162,7 +162,6 @@ virtlockd_LDADD =3D \ libvirt_driver_admin.la \ $(GLIB_LIBS) \ ../gnulib/lib/libgnu.la \ - $(CYGWIN_EXTRA_LIBADD) \ $(NULL) if WITH_DTRACE_PROBES virtlockd_LDADD +=3D libvirt_probes.lo diff --git a/src/logging/Makefile.inc.am b/src/logging/Makefile.inc.am index 0f7ffa73b3..e8240fa5c4 100644 --- a/src/logging/Makefile.inc.am +++ b/src/logging/Makefile.inc.am @@ -99,7 +99,6 @@ virtlogd_LDADD =3D \ libvirt.la \ $(GLIB_LIBS) \ ../gnulib/lib/libgnu.la \ - $(CYGWIN_EXTRA_LIBADD) \ $(NULL) if WITH_DTRACE_PROBES virtlogd_LDADD +=3D libvirt_probes.lo diff --git a/src/rpc/Makefile.inc.am b/src/rpc/Makefile.inc.am index 11920b3270..0e154d9c69 100644 --- a/src/rpc/Makefile.inc.am +++ b/src/rpc/Makefile.inc.am @@ -97,7 +97,6 @@ libvirt_net_rpc_la_LDFLAGS =3D \ $(SECDRIVER_LIBS) \ $(AM_LDFLAGS) \ $(NULL) -libvirt_net_rpc_la_LIBADD =3D $(CYGWIN_EXTRA_LIBADD) =20 libvirt_net_rpc_server_la_SOURCES =3D \ rpc/virnetserverprogram.h \ @@ -122,7 +121,6 @@ libvirt_net_rpc_server_la_LDFLAGS =3D \ $(AM_LDFLAGS) \ $(DBUS_LIBS) \ $(NULL) -libvirt_net_rpc_server_la_LIBADD =3D $(CYGWIN_EXTRA_LIBADD) =20 libvirt_net_rpc_client_la_SOURCES =3D \ rpc/virnetclientprogram.h \ @@ -138,7 +136,6 @@ libvirt_net_rpc_client_la_CFLAGS =3D \ $(XDR_CFLAGS) \ $(NULL) libvirt_net_rpc_client_la_LDFLAGS =3D $(AM_LDFLAGS) -libvirt_net_rpc_client_la_LIBADD =3D $(CYGWIN_EXTRA_LIBADD) =20 if WITH_SASL libvirt_net_rpc_client_la_CFLAGS +=3D \ diff --git a/src/rpc/genprotocol.pl b/src/rpc/genprotocol.pl index 6baa4f22d5..f567260588 100755 --- a/src/rpc/genprotocol.pl +++ b/src/rpc/genprotocol.pl @@ -47,7 +47,7 @@ open RPCGEN, "-|", "$rpcgen $mode $xdrdef" open TARGET, ">$target" or die "cannot create $target: $!"; =20 -my $fixup =3D $^O eq "linux" || $^O eq "cygwin" || $^O eq "gnukfreebsd" ||= $^O eq "freebsd" || $^O eq "darwin"; +my $fixup =3D $^O eq "linux" || $^O eq "gnukfreebsd" || $^O eq "freebsd" |= | $^O eq "darwin"; =20 if ($mode eq "-c") { print TARGET "#include \n"; diff --git a/src/util/virsocketaddr.h b/src/util/virsocketaddr.h index 1180864f06..66aee2abcd 100644 --- a/src/util/virsocketaddr.h +++ b/src/util/virsocketaddr.h @@ -26,16 +26,6 @@ =20 #include "internal.h" =20 -/* On architectures which lack these limits, define them (ie. Cygwin). - * Note that the libvirt code should be robust enough to handle the - * case where actual value is longer than these limits (eg. by setting - * length correctly in second argument to gethostname and by always - * using strncpy instead of strcpy). - */ -#ifndef INET_ADDRSTRLEN -# define INET_ADDRSTRLEN 16 -#endif - #define VIR_LOOPBACK_IPV4_ADDR "127.0.0.1" =20 typedef struct { diff --git a/src/util/virxdrdefs.h b/src/util/virxdrdefs.h index 264d02e7cd..b6f6ad5a4d 100644 --- a/src/util/virxdrdefs.h +++ b/src/util/virxdrdefs.h @@ -20,18 +20,8 @@ =20 #pragma once =20 -/* cygwin's xdr implementation defines xdr_u_int64_t instead of xdr_uint64= _t - * and lacks IXDR_PUT_INT32 and IXDR_GET_INT32 +/* The portablexdr implementation lacks IXDR_PUT_U_INT32 and IXDR_GET_U_IN= T32 */ -#ifdef HAVE_XDR_U_INT64_T -# define xdr_uint64_t xdr_u_int64_t -#endif -#ifndef IXDR_PUT_INT32 -# define IXDR_PUT_INT32 IXDR_PUT_LONG -#endif -#ifndef IXDR_GET_INT32 -# define IXDR_GET_INT32 IXDR_GET_LONG -#endif #ifndef IXDR_PUT_U_INT32 # define IXDR_PUT_U_INT32 IXDR_PUT_U_LONG #endif --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779913; cv=none; d=zohomail.com; s=zohoarc; b=eh51pXtNMOtojfm5Ul9dB5Ljm++plExU6LJjm8MzUgzhjR3KrqxfC1j0sOL5+vUvIL2gj1qZtttjP1i33FjOax9CFCOcOBo5wWrlGdWJo1e4N+bAnFIrrtLQAPmvIU+Rm3OCoFqLgxYzbPUvGLbwtDiPJm8KGYS4H1wsScTCYFE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779913; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IuCbYmFS4GPY5usoqlkllqZs6Qntdd0BpB7z5jBA1qo=; b=ZrYKToG3NNtkTdWtC3rIaHc7sJewNrFw0GpIzkdDvwWmQ9fRDdHrtnuv1/5DZiPekgUAl664DKnstfjQzMleKr/CrjazRrlNWAKj4BZICQJBbLOuyaeTzQEL5a6nwLJL7KFJhWBv6movHP3j5MsEhr9F68QBxg2dVqw3HRaHp2w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1579779913909812.7965552873112; Thu, 23 Jan 2020 03:45:13 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-293-gVElXhwWMriU3QFegTLJxw-1; Thu, 23 Jan 2020 06:44:10 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6FDD4800D41; Thu, 23 Jan 2020 11:44:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 431FD28991; Thu, 23 Jan 2020 11:44:04 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D9A831803C33; Thu, 23 Jan 2020 11:44:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBi0Ml025456 for ; Thu, 23 Jan 2020 06:44:00 -0500 Received: by smtp.corp.redhat.com (Postfix) id 558118575D; Thu, 23 Jan 2020 11:44:00 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 06C288575C; Thu, 23 Jan 2020 11:43:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779912; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=IuCbYmFS4GPY5usoqlkllqZs6Qntdd0BpB7z5jBA1qo=; b=H7lbKcv7oWhJiRTnGEyQO1pWxcTP83/cAM7OoLNn9+Wb/pP8x9nm8QZu8xGcsL674FOvtl AFKwET5NJaqQGsIxI3489i0PmxLr35TaogbxcJ1K5HvHufYlITzPVH85XyAVXwk7cK8wZ9 dYkPNn36gyNQuOJGHMP0UcLjke831nY= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 18/32] util: conditionalize virProcess APIs on Windows Date: Thu, 23 Jan 2020 11:43:11 +0000 Message-Id: <20200123114325.3860881-19-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: gVElXhwWMriU3QFegTLJxw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Many of the virProcess APIs are relying on GNULIB providing POSIX API stubs. Even with these stubs the APIs don't do anything useful once compiled. We can thus conditionalize the code so that we don't compile anything at all. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/util/virprocess.c | 98 +++++++++++++++++++++++++++++++++---------- 1 file changed, 76 insertions(+), 22 deletions(-) diff --git a/src/util/virprocess.c b/src/util/virprocess.c index d8ee3142da..60419538e2 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -24,7 +24,9 @@ =20 #include #include -#include +#ifndef WIN32 +# include +#endif #include #if HAVE_SYS_MOUNT_H # include @@ -121,6 +123,8 @@ VIR_ENUM_IMPL(virProcessSchedPolicy, "rr", ); =20 + +#ifndef WIN32 /** * virProcessTranslateStatus: * @status: child exit status to translate @@ -146,7 +150,6 @@ virProcessTranslateStatus(int status) } =20 =20 -#ifndef WIN32 /** * virProcessAbort: * @pid: child process to kill @@ -206,14 +209,6 @@ virProcessAbort(pid_t pid) cleanup: errno =3D saved_errno; } -#else -void -virProcessAbort(pid_t pid) -{ - /* Not yet ported to mingw. Any volunteers? */ - VIR_DEBUG("failed to reap child %lld, abandoning it", (long long)pid); -} -#endif =20 =20 /** @@ -282,6 +277,33 @@ virProcessWait(pid_t pid, int *exitstatus, bool raw) return -1; } =20 +#else /* WIN32 */ + +char * +virProcessTranslateStatus(int status) +{ + return g_strdup_printf(_("invalid value %d"), status); +} + + +void +virProcessAbort(pid_t pid) +{ + /* Not yet ported to mingw. Any volunteers? */ + VIR_DEBUG("failed to reap child %lld, abandoning it", (long long)pid); +} + + +int +virProcessWait(pid_t pid, int *exitstatus G_GNUC_UNUSED, bool raw G_GNUC_U= NUSED) +{ + virReportSystemError(ENOSYS, _("unable to wait for process %lld"), + (long long) pid); + return -1; +} + +#endif /* WIN32 */ + =20 /* send signal to a single process */ int virProcessKill(pid_t pid, int sig) @@ -1036,6 +1058,7 @@ int virProcessGetStartTime(pid_t pid, #endif =20 =20 +#ifdef __linux__ typedef struct _virProcessNamespaceHelperData virProcessNamespaceHelperDat= a; struct _virProcessNamespaceHelperData { pid_t pid; @@ -1088,7 +1111,22 @@ virProcessRunInMountNamespace(pid_t pid, return virProcessRunInFork(virProcessNamespaceHelper, &data); } =20 +#else /* ! __linux__ */ =20 +int +virProcessRunInMountNamespace(pid_t pid G_GNUC_UNUSED, + virProcessNamespaceCallback cb G_GNUC_UNUSED, + void *opaque G_GNUC_UNUSED) +{ + virReportSystemError(ENOSYS, "%s", + _("Namespaces are not supported on this platform"= )); + return -1; +} + +#endif /* ! __linux__ */ + + +#ifndef WIN32 static int virProcessRunInForkHelper(int errfd, pid_t ppid, @@ -1174,8 +1212,21 @@ virProcessRunInFork(virProcessForkCallback cb, return ret; } =20 +#else /* WIN32 */ + +int +virProcessRunInFork(virProcessForkCallback cb G_GNUC_UNUSED, + void *opaque G_GNUC_UNUSED) +{ + virReportSystemError(ENOSYS, "%s", + _("Process spawning is not supported on this plat= form")); + return -1; +} + +#endif /* WIN32 */ =20 -#if defined(HAVE_SYS_MOUNT_H) && defined(HAVE_UNSHARE) + +#if defined(__linux__) int virProcessSetupPrivateMountNS(void) { @@ -1194,24 +1245,14 @@ virProcessSetupPrivateMountNS(void) return 0; } =20 -#else /* !defined(HAVE_SYS_MOUNT_H) || !defined(HAVE_UNSHARE) */ - -int -virProcessSetupPrivateMountNS(void) -{ - virReportSystemError(ENOSYS, "%s", - _("Namespaces are not supported on this platform.= ")); - return -1; -} -#endif /* !defined(HAVE_SYS_MOUNT_H) || !defined(HAVE_UNSHARE) */ =20 -#if defined(__linux__) G_GNUC_NORETURN static int virProcessDummyChild(void *argv G_GNUC_UNUSED) { _exit(0); } =20 + /** * virProcessNamespaceAvailable: * @ns: what namespaces to check (bitwise-OR of virProcessNamespaceFlags) @@ -1269,6 +1310,14 @@ virProcessNamespaceAvailable(unsigned int ns) =20 #else /* !defined(__linux__) */ =20 +int +virProcessSetupPrivateMountNS(void) +{ + virReportSystemError(ENOSYS, "%s", + _("Namespaces are not supported on this platform.= ")); + return -1; +} + int virProcessNamespaceAvailable(unsigned int ns G_GNUC_UNUSED) { @@ -1276,6 +1325,7 @@ virProcessNamespaceAvailable(unsigned int ns G_GNUC_U= NUSED) _("Namespaces are not supported on this platform.= ")); return -1; } + #endif /* !defined(__linux__) */ =20 /** @@ -1296,6 +1346,7 @@ virProcessExitWithStatus(int status) { int value =3D EXIT_CANNOT_INVOKE; =20 +#ifndef WIN32 if (WIFEXITED(status)) { value =3D WEXITSTATUS(status); } else if (WIFSIGNALED(status)) { @@ -1312,6 +1363,9 @@ virProcessExitWithStatus(int status) raise(WTERMSIG(status)); value =3D 128 + WTERMSIG(status); } +#else /* WIN32 */ + (void)status; +#endif /* WIN32 */ exit(value); } =20 --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779864; cv=none; d=zohomail.com; s=zohoarc; b=gYz9Bo24cTZe6CJ9dcTW8waDRkjSJju8aixOH3qKvpw+KIe0nqg616vaVNcpfWJrWt5kfJaNUoIsPOcy1CN+MV5PTiKAOIoULt063yPyWqUGRtA+mdI0+X7Q152UvVkrLGymDSOycZazszINO70SOicb4UYdct/6V8TUVwDqcFU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779864; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=we65Tk0OxXD22XRCBeUtUcZ2nTi07k5GjiiWHVfANzs=; b=ZoDMroyD9jDKQJprZ3Mc8TVmxVvG6CsIXLWk9D2FDTjQ8Q3kVuFM533kvbQyiCAPwtKUbne4J7rYqefvJZime3U/WNbaA/dPWfT/OV3WtuA52gNRq0/3RK2n/A7njdr7HyswM9IPYC49j90eI1mJZ0W+pM1p8kt3zK+CIxW78Gg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1579779864418595.0312906397064; Thu, 23 Jan 2020 03:44:24 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-117-12UoSMD8PquHtmEdYdMMPA-1; Thu, 23 Jan 2020 06:44:19 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 592DC190D34F; Thu, 23 Jan 2020 11:44:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2DF3760C88; Thu, 23 Jan 2020 11:44:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id DD0A88590B; Thu, 23 Jan 2020 11:44:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBi1Ih025468 for ; Thu, 23 Jan 2020 06:44:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5CEF485750; Thu, 23 Jan 2020 11:44:01 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id A1E3185754; Thu, 23 Jan 2020 11:44:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779863; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=we65Tk0OxXD22XRCBeUtUcZ2nTi07k5GjiiWHVfANzs=; b=HZS6d/AfI67Uix9x2DEcEozOEyen/dMKYYlcUGjDRDNVwElhESi8fxHMvKfF369fjRznR7 8qzw3n/jYAtri54aAcJhyQSWCSEjeuWM8rccbkDDp9JvyZ81Fsfq1whLjCNoX9IORBcOW8 VuSQ3FWImMSABB7W0BJmhri7LqJSaIo= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 19/32] src: conditionalize use of net/if.h Date: Thu, 23 Jan 2020 11:43:12 +0000 Message-Id: <20200123114325.3860881-20-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: 12UoSMD8PquHtmEdYdMMPA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The net/if.h is not portable so we must check for its existance and avoid using it when missing. Some use of net/if.h was redundant and could be removed. Signed-off-by: Daniel P. Berrang=C3=A9 --- build-aux/syntax-check.mk | 2 +- configure.ac | 1 + src/util/virnetdev.c | 1 - src/util/virnetdev.h | 4 +++- src/util/virnetdevbridge.c | 4 +++- src/util/virnetdevip.c | 4 +++- src/util/virnetdevtap.c | 4 +++- 7 files changed, 14 insertions(+), 6 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index e5623606dd..7eb7d0beab 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -2338,4 +2338,4 @@ exclude_file_name_regexp--sc_prohibit_backslash_align= ment =3D \ ^build-aux/syntax-check\.mk$$ =20 exclude_file_name_regexp--sc_prohibit_always_true_header_tests =3D \ - ^src/util/virfile\.c$$ + ^src/util/(virfile|virnetdev|virnetdevip)\.[c,h]|$$ diff --git a/configure.ac b/configure.ac index 855654c75d..75df326795 100644 --- a/configure.ac +++ b/configure.ac @@ -381,6 +381,7 @@ AC_CHECK_HEADERS([\ mntent.h \ net/ethernet.h \ netinet/tcp.h \ + net/if.h \ pty.h \ pwd.h \ stdarg.h \ diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index b896a7507e..094d1ac09b 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -34,7 +34,6 @@ #ifndef WIN32 # include #endif -#include #include =20 #ifdef __linux__ diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h index 24b41498ed..78e1aa656a 100644 --- a/src/util/virnetdev.h +++ b/src/util/virnetdev.h @@ -18,7 +18,9 @@ =20 #pragma once =20 -#include +#ifdef HAVE_NET_IF_H +# include +#endif =20 #include "virbitmap.h" #include "virsocketaddr.h" diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c index 5bb533f1f0..5a0fb5f42f 100644 --- a/src/util/virnetdevbridge.c +++ b/src/util/virnetdevbridge.c @@ -31,7 +31,9 @@ # include #endif #include -#include +#ifdef HAVE_NET_IF +# include +#endif #include =20 #ifdef __linux__ diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c index 5897c4aa76..bfb93cf258 100644 --- a/src/util/virnetdevip.c +++ b/src/util/virnetdevip.c @@ -36,7 +36,9 @@ #ifndef WIN32 # include #endif -#include +#ifdef HAVE_NET_IF_H +# include +#endif #include =20 #ifdef __linux__ diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index 8656e267cb..84d91428e7 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -36,7 +36,9 @@ #ifndef WIN32 # include #endif -#include +#ifdef HAVE_NET_IF +# include +#endif #include #ifdef __linux__ # include /* IFF_TUN, IFF_NO_PI */ --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579780101; cv=none; d=zohomail.com; s=zohoarc; b=LLc1gCZS+vxiZbmAZC7GxPVo/477Bo4brYS/lvMvJHTYP9wQQQk5VHPwd36IsuWN8dDq0QKR+vt9ikTuTJQbkJ+ZuTXYsI08K1Xv4iRW32mkiLE2TSsFYiaZ+hZXxArF0w9mR4qdL3QL3CbvC61n5qL2m8YP2Owk64Izyo2+eb4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579780101; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ilsST9fOVHfIBZbKrkaE5P0aOWuWPgYpEE7inSiw12s=; b=k81v4wtVJF1kQwIZGiEMB04+3CT5w+WvDg/hdSaXdWaWfqJeHd75U4ZC562XPGLdnwVnH0WFFSb0BN/I6s82HUSPBvLSKB4FmIvBxZ/HD2tWW1c7yITN5D3KZkUzwJqA1f536snt5VxhA9Q0a3CVFB7xiCjHTOoZ1pZJ7nDhZiM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1579780101875110.28715716726822; Thu, 23 Jan 2020 03:48:21 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-18-LVYYIazSOZiueIHI67Fhkw-1; Thu, 23 Jan 2020 06:44:22 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D546C800D4E; Thu, 23 Jan 2020 11:44:16 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ACA945DDB0; Thu, 23 Jan 2020 11:44:16 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6974818034F0; Thu, 23 Jan 2020 11:44:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBi28P025484 for ; Thu, 23 Jan 2020 06:44:02 -0500 Received: by smtp.corp.redhat.com (Postfix) id 636FC8575E; Thu, 23 Jan 2020 11:44:02 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4C9685750; Thu, 23 Jan 2020 11:44:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579780100; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ilsST9fOVHfIBZbKrkaE5P0aOWuWPgYpEE7inSiw12s=; b=g5JT9jJHQ/dZyXz1TUWyyJm9/nqAoiJoPmkcEgMLQB4pRPt6klHlzUbeHhioFRlmhd5XDr xGlgYC/zJuy/4EG/UqFkZlJ/TwpVvkFni2QH56IrREV5YMPcgcqHp2LmpeJxTlA857qLe9 bEsT2dX6LJD8Sy/XuiRH27cRurUUt2E= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 20/32] configure: add check for sys/ioctl.h Date: Thu, 23 Jan 2020 11:43:13 +0000 Message-Id: <20200123114325.3860881-21-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: LVYYIazSOZiueIHI67Fhkw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" We currently get the sys/ioctl.h check indirectly via GNULIB, but this will soon stop happening. Signed-off-by: Daniel P. Berrang=C3=A9 --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index 75df326795..2cd0e7dcee 100644 --- a/configure.ac +++ b/configure.ac @@ -386,6 +386,7 @@ AC_CHECK_HEADERS([\ pwd.h \ stdarg.h \ syslog.h \ + sys/ioctl.h \ sys/mount.h \ sys/syscall.h \ sys/sysctl.h \ --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579780029; cv=none; d=zohomail.com; s=zohoarc; b=O0ZzuhqX0NxLuiDlPq26cU5pKERQXtVsqGPe1UsT5+Bv1ojI9tFq8vTHajO3jJXlYVzhsKIUAGenvpt+DQdqlcLcm+vKceAZiflaHDlyLUpF6B6erExSbDE73L30AC6m5jTyhIiBU8fkaOuKlwlyhnZUF5qs86eP2NQkKSopKxY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579780029; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DNYC1EiN7UmwpRwCF0UUBrJ6h0ivKxnMQi4hMPznzK0=; b=kTxjPi405r2PQ8RltIPFWBWXrwazwH1TfnKbtXhOeE1iKO1psByX60eiSp295ho/Fo/fbZOje7yAjtvAWYe+2+SaXBpi+PB+kg5ABZKepfeC4JdmA8PWkIAXKK8IvThM/xfp1WaLqKKaigQsipd3PIkGKzG8SA4eHN/TexednQ0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1579780029497974.4362598628345; Thu, 23 Jan 2020 03:47:09 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-260-1QMJ9dr5Nx6Ys_BiYoge2A-1; Thu, 23 Jan 2020 06:44:14 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7665ADB78; Thu, 23 Jan 2020 11:44:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C4CE5C541; Thu, 23 Jan 2020 11:44:09 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id F3F031803C43; Thu, 23 Jan 2020 11:44:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBi39h025494 for ; Thu, 23 Jan 2020 06:44:03 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4CD5685783; Thu, 23 Jan 2020 11:44:03 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC04A85780; Thu, 23 Jan 2020 11:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579780028; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=DNYC1EiN7UmwpRwCF0UUBrJ6h0ivKxnMQi4hMPznzK0=; b=XH1qaBkF6sy2kcg8pzZylgjwv4mkxnhV28VB5InpIzhpcIuKtc9ekHYgS2fAPENPaDvMkT RJkNdI89e+t0IEbX9UjY9tJF1bstln/FwWeaHdQHrvKi1AAv5G45l4XrDNjxrX3HXJDsGR UCU13dkpsvjws/6hVZ9rmN2KDVTFlEU= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 21/32] src: conditionalize use of S_ISSOCK macro Date: Thu, 23 Jan 2020 11:43:14 +0000 Message-Id: <20200123114325.3860881-22-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: 1QMJ9dr5Nx6Ys_BiYoge2A-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The S_ISSOCK macro is not available on Windows platforms. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/libvirt-domain.c | 2 ++ src/security/security_manager.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 4074397b30..ceda85c243 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -10584,12 +10584,14 @@ virDomainOpenGraphics(virDomainPtr dom, goto error; } =20 +#ifndef WIN32 if (!S_ISSOCK(sb.st_mode)) { virReportInvalidArg(fd, _("fd %d must be a socket"), fd); goto error; } +#endif /* !WIN32 */ =20 virCheckReadOnlyGoto(dom->conn->flags, error); =20 diff --git a/src/security/security_manager.c b/src/security/security_manage= r.c index f229d94570..fe9def7fb9 100644 --- a/src/security/security_manager.c +++ b/src/security/security_manager.c @@ -1340,11 +1340,13 @@ virSecurityManagerMetadataLock(virSecurityManagerPt= r mgr G_GNUC_UNUSED, } =20 if ((fd =3D open(p, O_RDWR)) < 0) { +#ifndef WIN32 if (S_ISSOCK(sb.st_mode)) { /* Sockets can be opened only if there exists the * other side that listens. */ continue; } +#endif /* !WIN32 */ =20 virReportSystemError(errno, _("unable to open %s"), --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779872; cv=none; d=zohomail.com; s=zohoarc; b=Dn4lNRu2o/bUg33NhDHV+T1Gt6w0GOOb8FTEISg8lwGQlO5lHd9uM1WmyIZnDd/ApPqkf6Cf38+TWFqObEX5ufx8E1y9MHc8R2sfiL2XEDpT0QoiTa/Fkswzn/xBUtK+Hh4VOdMXARLt3DihNIZCS8aUKMOm84gNo+HN4C2GbfU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779872; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=B4WwbpMjDDWPHEr3edkp5LKUGNRdWm3Jr5FrZ9t4THY=; b=U0K0GA+CjEKpN+euVNuF5K/pNvuQ49em8gLrmK1YrfVpYXKQbslAK66jED0pNXC5Ne/ND7utz4DbcWG0AxaiUdYbhxOC/e1lVj35JmKHrSxBzWtOMMacXWVVf/sniKKtwhs4RiN4/GJNStylFq3RfiE6WaxsG4+J31IKeCR3LLo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1579779872218939.7356218278467; Thu, 23 Jan 2020 03:44:32 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-149-YMHS8w--OYiMSZfWX4RW4A-1; Thu, 23 Jan 2020 06:44:26 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D36741005F6A; Thu, 23 Jan 2020 11:44:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A6E6D5C1BB; Thu, 23 Jan 2020 11:44:20 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5EF0618034FC; Thu, 23 Jan 2020 11:44:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBi8oX025525 for ; Thu, 23 Jan 2020 06:44:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9880885785; Thu, 23 Jan 2020 11:44:08 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0CA1285750; Thu, 23 Jan 2020 11:44:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779871; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=B4WwbpMjDDWPHEr3edkp5LKUGNRdWm3Jr5FrZ9t4THY=; b=JuCh0TbMiIS3S/4KKAqKwnYp+4St5PLwjL5vo68Qtv1VFbriDX5kT8W1JTi7bN0ySiwpHS nnjN98FTQIjSYdIcXzgnCLPuNjEvqNQE1Toc7DwTMFnDhTs8VwmMyiWWzkGY4simZI0+Sb uhvpOXBEH4QWM712z2pC0U4ShZrKHmY= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 22/32] configure: request system specific extensions Date: Thu, 23 Jan 2020 11:43:15 +0000 Message-Id: <20200123114325.3860881-23-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: YMHS8w--OYiMSZfWX4RW4A-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The AC_USE_SYSTEM_EXTENSIONS macro causes things like "USE_GNU" to be defined, which enables access to OS specific extensions to POSIX. We currently got this indirectly via GNULIB's 'extensions' module which is a dependancy of other GNULIB modules we use. Signed-off-by: Daniel P. Berrang=C3=A9 --- configure.ac | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.ac b/configure.ac index 2cd0e7dcee..adfd950260 100644 --- a/configure.ac +++ b/configure.ac @@ -55,6 +55,8 @@ m4_ifndef([AM_SILENT_RULES], =20 AC_CANONICAL_HOST =20 +AC_USE_SYSTEM_EXTENSIONS + # First extract pieces from the version number string LIBVIRT_MAJOR_VERSION=3D`echo $VERSION | awk -F. '{print $1}'` LIBVIRT_MINOR_VERSION=3D`echo $VERSION | awk -F. '{print $2}'` --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779861; cv=none; d=zohomail.com; s=zohoarc; b=ggOE2t3KStkaxFYQn4/pWTK2ZhN0Gg4l5LeWFf2PvAyCzgTnhQcLBJZt0yNS0Wq8pvsaycK1VE1ZqQv/fmCycm8qRCqvPluEiE8ibL/Sqmetp9/l0FSU2Q2yTUSFND1s3XRFctIgANsG6QC4QB1PL2TSXwclDZxStSZk5BM2hs4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779861; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YWdTtGPPFABvfg7wx1wsGjOKCM9qzMmzZuPse/cpjMc=; b=IuR/QuZArvBRiB+RSIM5pCWFO5l4sbqpYc+Lbeei28f/mTRl/5BVHnvU1tKliF3Tfj+vkCdSqgvevdcbvE8gVKYEvkfnewOQnuz/gXcmAAfd+YylyEXAGSp8nYXGc8NMUvrtk9luu4h8y2/kP3p2e/OO0QkGVVcGbFLITLC99ks= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1579779861886328.95502123680103; Thu, 23 Jan 2020 03:44:21 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-349-VE28T2uQP3ugMaeSd-RZ_w-1; Thu, 23 Jan 2020 06:44:18 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DCBCADB60; Thu, 23 Jan 2020 11:44:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B7AB95C541; Thu, 23 Jan 2020 11:44:12 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 60E0618034EB; Thu, 23 Jan 2020 11:44:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBi97h025530 for ; Thu, 23 Jan 2020 06:44:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id 68B941CB; Thu, 23 Jan 2020 11:44:09 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id C9A6885785; Thu, 23 Jan 2020 11:44:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779860; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=YWdTtGPPFABvfg7wx1wsGjOKCM9qzMmzZuPse/cpjMc=; b=T5VOIqyTp1NuswXsHQfUUBhknl1oEXbjL3apdCl68ODiGiLo8XEF0LwR2uJDPcl4bySElU wFddhWHu2KbnsRkPgWtAyg9696ZJPcUHsUqZXuA/B6lbzjxo2LG9L2NgauyusYJC0s4gg7 bMaVrmtcwjbHOC+WqfhVTEk6QBVgNMA= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 23/32] src: stop using O_DIRECTORY in resctrl Date: Thu, 23 Jan 2020 11:43:16 +0000 Message-Id: <20200123114325.3860881-24-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: VE28T2uQP3ugMaeSd-RZ_w-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The O_DIRECTORY flag causes open() to return an error if the filename is a directory. There's no obvious reason why resctrl needs to use this, while the rest of libvirt code does not. Removing it avoids build issues on platforms where O_DIRECTORY is not defined, once we remove GNULIB. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/util/virresctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index 684d2ce398..e9bcdb44b1 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -455,7 +455,7 @@ VIR_ONCE_GLOBAL_INIT(virResctrl); static int virResctrlLockWrite(void) { - int fd =3D open(SYSFS_RESCTRL_PATH, O_DIRECTORY | O_CLOEXEC); + int fd =3D open(SYSFS_RESCTRL_PATH, O_RDWR | O_CLOEXEC); =20 if (fd < 0) { virReportSystemError(errno, "%s", _("Cannot open resctrl")); --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779865; cv=none; d=zohomail.com; s=zohoarc; b=E5WVZbfBg066ryYWcjl3IN7deSenaQ9SJ5QHISnoK1dUhs096eG/yrT1dXNZGSk1pWFjTIkplV3u3Z37mtaLi6xTlMrCd6a8CrlEdyy3q3jVYC2IvNA+tQpaVuPlDckQid6KyyNwtNtFId0dXB0R2NtQgt2RD9OiPccblIPrFXI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779865; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MdOr9QprH+9qRmDbm121WzI5vxo6jvM+Eaet90SeptM=; b=hx5wVtF22A3kE90UrfJ11Y6vg2FK/WykrMf0sxCYT8R4DpceVxik32Wa+Nnw7wVUQjJJkU9j3YUO9Y6zbP79nbbZ76unwPHtjvblp0cZcK+DnuwBazihb1AJCbqTbZqezW1u2aNLO8VaV6S6gr6xVJ9KbFybjJF7d2ueRJc71wo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1579779865678562.2530937896269; Thu, 23 Jan 2020 03:44:25 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-180-Sj6oRAXEOT29FUn_NacxiQ-1; Thu, 23 Jan 2020 06:44:21 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 57BB2800D5A; Thu, 23 Jan 2020 11:44:16 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2B69D8645D; Thu, 23 Jan 2020 11:44:16 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D471918034EE; Thu, 23 Jan 2020 11:44:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBiAPT025538 for ; Thu, 23 Jan 2020 06:44:10 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4F9E785750; Thu, 23 Jan 2020 11:44:10 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF5461CB; Thu, 23 Jan 2020 11:44:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779864; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=MdOr9QprH+9qRmDbm121WzI5vxo6jvM+Eaet90SeptM=; b=NpsDru/ro2Nc35ABVjHKXR/oQPTnY0D5CVRuO0fA1Xcj9f3+j3/7M4ZD1cGV5TdNYZkAO4 hlSdTHO7A8rwjEnXgdHDF8mF1/RE0Sx0FxnYOSY0fJvcM6Vt/kVQzVqVvzIj178otxNPM8 xRurMSx2jgDeIK01bfj9LtCZiCP+Yzc= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 24/32] src: ensure O_CLOEXEC is defined on Windows Date: Thu, 23 Jan 2020 11:43:17 +0000 Message-Id: <20200123114325.3860881-25-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: Sj6oRAXEOT29FUn_NacxiQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Windows uses _O_NOINHERIT as the name for its O_CLOEXEC equivalent. Define O_CLOEXEC to match this to fix portability when we remove GNULIB. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/internal.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/internal.h b/src/internal.h index 4a63984cec..8c9322ec1e 100644 --- a/src/internal.h +++ b/src/internal.h @@ -89,6 +89,12 @@ =20 #define NUL_TERMINATE(buf) do { (buf)[sizeof(buf)-1] =3D '\0'; } while (0) =20 +#ifdef WIN32 +# ifndef O_CLOEXEC +# define O_CLOEXEC _O_NOINHERIT +# endif +#endif + /** * G_GNUC_NO_INLINE: * --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779913; cv=none; d=zohomail.com; s=zohoarc; b=fOBE7MxYkP+506B1RBDHD0agcEm8ko8iKXUgoa2PAUJ+7kdIVWWtWpWqBtnsCHLS2+iMph2QXeDIETrjpbmPJIUvwz/cxA+eQWxMj8Zv+1FlpNjL3kAx8fQY981UISwc45tG6P/dR3dXDq5y6M/LC8OX3CxnEfxUDOYvkSdDqY4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779913; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=c6DfG4IdZK2csHT9sR4fEQav4+hq7DxMm2nTiRGihzA=; b=FqGqxbLO3MAXA0uPXBGLQhCnvBsHgisISsfxYX7XFQFSs4CiiPpa8kZTrJ62PGcX0IaMcP6XdSlYM9oZiefQTMkUa8pyEHGM/jzg0R4eXwlfKusV65Ku3cV/dgSqg9S696cyDimFBvrJlSzRQPe3vep/FIsI47eacyJVrjfy/Rk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1579779913246466.1427165082283; Thu, 23 Jan 2020 03:45:13 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-259-qETfeyS4Na-4kOMF-IwKXw-1; Thu, 23 Jan 2020 06:44:26 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 531911005516; Thu, 23 Jan 2020 11:44:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 223735DDB9; Thu, 23 Jan 2020 11:44:20 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D1A0985919; Thu, 23 Jan 2020 11:44:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBiBna025551 for ; Thu, 23 Jan 2020 06:44:11 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3CCB2859A9; Thu, 23 Jan 2020 11:44:11 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9647C1CB; Thu, 23 Jan 2020 11:44:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779912; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=c6DfG4IdZK2csHT9sR4fEQav4+hq7DxMm2nTiRGihzA=; b=c7tu5A+3IqKC4I3AzH2CIrBC2Rnvk2UxHjzhuFnSvO42IlilWJRtjfsKE4NLzqD/J4729F pwIqhT29EXmxbkDQ7OdFJcU/hpts8ugbIiKF1adKV9B6rJrNrD1EmC2qcD9Ba09FvYoyw3 f5U1vEqKwhQJUNq8spzCOzm+VvyNWsE= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 25/32] src: conditionalize use of F_DUPFD_CLOEXEC Date: Thu, 23 Jan 2020 11:43:18 +0000 Message-Id: <20200123114325.3860881-26-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: qETfeyS4Na-4kOMF-IwKXw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The F_DUPFD_CLOEXEC functionality is not available on some platformms. We must thus explicitly call the virSetCloexec function once we remove GNULIB's equiv fix for this. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/rpc/virnetsocket.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index 687099720f..906b5165eb 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -1403,15 +1403,27 @@ int virNetSocketDupFD(virNetSocketPtr sock, bool cl= oexec) { int fd; =20 +#ifdef F_DUPFD_CLOEXEC if (cloexec) fd =3D fcntl(sock->fd, F_DUPFD_CLOEXEC, 0); else +#endif /* F_DUPFD_CLOEXEC */ fd =3D dup(sock->fd); if (fd < 0) { virReportSystemError(errno, "%s", _("Unable to copy socket file handle")); return -1; } +#ifndef F_DUPFD_CLOEXEC + if (cloexec && + virSetCloseExec(fd < 0)) { + int saveerr =3D errno; + closesocket(fd); + errno =3D saveerr; + return -1; + } +#endif /* F_DUPFD_CLOEXEC */ + return fd; } =20 --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779873; cv=none; d=zohomail.com; s=zohoarc; b=YCp0klZ/vZLajmlgsMHi9x8Cl4z/cX2ahTQIEY0OH3tuziRWYp70JNDb0uiQR3picdJ9I8m5kWqVlejQ8s/vR2Ktpo6raTvVuNxA+dyWDrdY4/8RzuJDDGyKWa22YFvhgjQEumE1C64eZYcG8BnfXdMYpq1xc5LW+gp2POvbfu4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779873; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6dsF+K7SvW9DF1DqeTw7FURff5fuXcFsLI1DvT7WBGw=; b=CrYvBrc66CN8iU8jrZhoktymGF2US9QIOms2wriBsGAfg7ysAR5+XLQlxPOZRc8ewnfvEddB36T6wRUjNmlNWrY3bpr6QubeEyA/YQINJeGdqc/yemu4aReujVKE3d+Oj+rP7xseIW9diUBeNqwIpSKGbM9YkRLW8Jv5BCx03ss= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 157977987382870.2354539176298; Thu, 23 Jan 2020 03:44:33 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-405-c2RPmhzvOAigWpUBQB2gxA-1; Thu, 23 Jan 2020 06:44:29 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 22E8D100551D; Thu, 23 Jan 2020 11:44:24 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E809486454; Thu, 23 Jan 2020 11:44:23 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9F7748591C; Thu, 23 Jan 2020 11:44:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBiCnh025562 for ; Thu, 23 Jan 2020 06:44:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id 264A885785; Thu, 23 Jan 2020 11:44:12 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7DA0C85783; Thu, 23 Jan 2020 11:44:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779872; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=6dsF+K7SvW9DF1DqeTw7FURff5fuXcFsLI1DvT7WBGw=; b=JT2dHZChHKK4OjyyAyahogo+cOyo5c9jN/KZWb2FI2Pzr9YT5R6drPMYfuAQ1bl9jtlOvE mCWAxdF9K8LiUBNG6EzV5EBC+lfbAY4zmSXMFPBNd15b4dyZFJ3XtfvaKODHKP1uk0tmKF 9ynBdNQ6b6KqSHdN5FBRqyNNdYsjMDA= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 26/32] src: conditionalize use of O_DIRECT Date: Thu, 23 Jan 2020 11:43:19 +0000 Message-Id: <20200123114325.3860881-27-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: c2RPmhzvOAigWpUBQB2gxA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The O_DIRECT flag is not available on platforms, so we must avoid it once we remove GNULIB. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/util/virfile.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/virfile.c b/src/util/virfile.c index d0e0062aa7..617d5d7a48 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -178,7 +178,11 @@ virFileDirectFdFlag(void) { /* XXX For now, Linux posix_fadvise is not powerful enough to * avoid O_DIRECT. */ +#ifdef O_DIRECT return O_DIRECT ? O_DIRECT : -1; +#else + return -1; +#endif } =20 /* Opaque type for managing a wrapper around a fd. For now, --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779876; cv=none; d=zohomail.com; s=zohoarc; b=TjLjtON7L7l2Du5cDXZJes3AcwY57otpC2tbq0hCwsDUfDC/zDsNMNCnw7/BirCOZidUUezy1VppV8Ef/iT2zlZvLzYhVAeUHVHVHVQkGPk+h3NTSCwms4dwmRXT2vPhSFAQWt83aCiEZNCzfxxL2ntoXeKOyd9uvyjx1tNX554= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779876; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sbjqDpjVCefIZO91TBh1eEZb/Ku5pa8bUtJqKjbAnLI=; b=IiJ+TdCuiCf74ebWcisywlmwdhSb8EcvT3gfML+/QA2XbSJgbwWr54C5EgztuFLdnHOfRGMb49QtECYUuFptUZB2eaWtRYfEF8RUxGrL9EHlv0N9swNKuh1QCwYYk6Udsdr07jl2TwdGfXjxcZjoAxcW9vcBtb5RoB4PbUa4DM8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1579779876181343.22531027025263; Thu, 23 Jan 2020 03:44:36 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-66-HTzH3-gcN7qjCXrgm3HLrw-1; Thu, 23 Jan 2020 06:44:32 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 734A8190D348; Thu, 23 Jan 2020 11:44:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4150D8CCE3; Thu, 23 Jan 2020 11:44:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E2D3A85921; Thu, 23 Jan 2020 11:44:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBiD3H025570 for ; Thu, 23 Jan 2020 06:44:13 -0500 Received: by smtp.corp.redhat.com (Postfix) id 07ECC8575C; Thu, 23 Jan 2020 11:44:13 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 692A885782; Thu, 23 Jan 2020 11:44:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779875; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=sbjqDpjVCefIZO91TBh1eEZb/Ku5pa8bUtJqKjbAnLI=; b=dM1nr2A6FnYLSsR5gyHlQOY7SBbbBmmWac7DoJ1HQn4qZttoM+XzkPUSI1YCJcOWhJQLGr HXdfct4WxfmYtfN4DSXaZmmYLhVED4AhSBe/vt/cwy/zMKBspjM2T8crcjsbe92/gClJKZ 0TTASlqhgkgE1K8hlOtPfPysCr73xzc= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 27/32] src: conditionalize use of O_BINARY Date: Thu, 23 Jan 2020 11:43:20 +0000 Message-Id: <20200123114325.3860881-28-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: HTzH3-gcN7qjCXrgm3HLrw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The O_BINARY flag is not defined on all platforms so we must conditionalize its use once we remove GNULIB. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/util/virfdstream.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/virfdstream.c b/src/util/virfdstream.c index a903107afb..58b77aa6fa 100644 --- a/src/util/virfdstream.c +++ b/src/util/virfdstream.c @@ -1243,7 +1243,10 @@ virFDStreamOpenFileInternal(virStreamPtr st, VIR_DEBUG("st=3D%p path=3D%s oflags=3D0x%x offset=3D%llu length=3D%llu= mode=3D0%o", st, path, oflags, offset, length, mode); =20 - oflags |=3D O_NOCTTY | O_BINARY; + oflags |=3D O_NOCTTY; +#ifdef O_BINARY + oflags |=3D O_BINARY; +#endif =20 if (oflags & O_CREAT) fd =3D open(path, oflags, mode); --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779905; cv=none; d=zohomail.com; s=zohoarc; b=JT0VmGXpNpRVtaeRXTY9txnW2wHCuzskU3r3cyPtCWxRQX8/Sw2d23MZY1QOQEB98gF6tegsN+ziOR+PhiYHeyEy6IlDKKM/jHvVUqDNiiIRakRWSJXDE4wSFIkxtCjPV0BLZw2ta94M439DpOGjmlsGDdy8b1gn5XyTRpPcijw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779905; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NyIkVOPygV5RG35niznNd6Tlz9Nciz64weohKqc/JS4=; b=njKg01OkOJF4YqpEjToKFXOuRZi1v0oo1lzsYTQBeuKRAN7LBpg5rK1mLNc3QjV0/PbfIq0fsrEjCHAu9wFplKaJuWyM1Mbz0211r3m6jI9mF7aLRfULzySelNN5xidCX0F+GeY1S+oUCQATlMrrmDCeGTXesB7CrsHrtOsl5hs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 157977990582077.87548280736235; Thu, 23 Jan 2020 03:45:05 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-423-hfgiZIw8NcSV8cS41Xn17g-1; Thu, 23 Jan 2020 06:44:24 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5B1F9190D340; Thu, 23 Jan 2020 11:44:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 29FD98CCD5; Thu, 23 Jan 2020 11:44:18 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C54D485917; Thu, 23 Jan 2020 11:44:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBiEI1025582 for ; Thu, 23 Jan 2020 06:44:14 -0500 Received: by smtp.corp.redhat.com (Postfix) id 715928575F; Thu, 23 Jan 2020 11:44:14 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4DA0F1CB; Thu, 23 Jan 2020 11:44:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779903; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=NyIkVOPygV5RG35niznNd6Tlz9Nciz64weohKqc/JS4=; b=jMCpzhYThXjqOV8x74r/v+6+VgomR12z/ancST543dmfdBDib4u9S2W7WibbxgLgd5h6lV fKaN2rmqfrMCiuseXPKNY/W1skzVbxeWRgTA6rJiNzqHuy7pg8nLMsgbB6W9m9RmSd10zA 3iAxnvXcSkeSFUJqGSOWAuQDvsA+PSg= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 28/32] src: conditionalize use of chown & stat constants Date: Thu, 23 Jan 2020 11:43:21 +0000 Message-Id: <20200123114325.3860881-29-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: hfgiZIw8NcSV8cS41Xn17g-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" chown and some stat constants are not available on the Windows platform. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/security/security_dac.c | 4 ++++ src/storage/storage_util.c | 3 +++ src/util/virfile.c | 44 +++++++++++++++++++++++++++++++++---- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 2561ee440e..2aab227d71 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -710,7 +710,11 @@ virSecurityDACSetOwnershipInternal(const virSecurityDA= CData *priv, return 0; } =20 +#ifdef WIN32 + rc =3D ENOSYS; +#else /* !WIN32 */ rc =3D chown(path, uid, gid); +#endif /* !WIN32 */ } =20 if (rc < 0) { diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 7bbcfde064..b6ea0a2760 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -79,6 +79,9 @@ =20 VIR_LOG_INIT("storage.storage_util"); =20 +#ifndef S_IRWXUGO +# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) +#endif =20 /* virStorageBackendNamespaceInit: * @poolType: virStoragePoolType diff --git a/src/util/virfile.c b/src/util/virfile.c index 617d5d7a48..d08eae5a1d 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -95,6 +95,17 @@ =20 VIR_LOG_INIT("util.file"); =20 +#ifndef S_ISUID +# define S_ISUID 04000 +#endif +#ifndef S_ISGID +# define S_ISGID 02000 +#endif +#ifndef S_ISVTX +# define S_ISVTX 01000 +#endif + + int virFileClose(int *fdptr, virFileCloseFlags flags) { int saved_errno =3D 0; @@ -314,7 +325,7 @@ virFileWrapperFdNew(int *fd, const char *name, unsigned= int flags) virFileWrapperFdFree(ret); return NULL; } -#else +#else /* WIN32 */ virFileWrapperFdPtr virFileWrapperFdNew(int *fd G_GNUC_UNUSED, const char *name G_GNUC_UNUSED, @@ -324,7 +335,7 @@ virFileWrapperFdNew(int *fd G_GNUC_UNUSED, _("virFileWrapperFd unsupported on this platform")); return NULL; } -#endif +#endif /* WIN32 */ =20 /** * virFileWrapperFdClose: @@ -479,7 +490,7 @@ int virFileFlock(int fd, bool lock, bool shared) return flock(fd, LOCK_UN); } =20 -#else +#else /* WIN32 */ =20 int virFileLock(int fd G_GNUC_UNUSED, bool shared G_GNUC_UNUSED, @@ -507,7 +518,7 @@ int virFileFlock(int fd G_GNUC_UNUSED, return -1; } =20 -#endif +#endif /* WIN32 */ =20 =20 int @@ -1581,10 +1592,12 @@ virFileResolveLinkHelper(const char *linkpath, if (g_lstat(linkpath, &st) < 0) return -1; =20 +#ifndef WIN32 if (!S_ISLNK(st.st_mode)) { *resultpath =3D g_strdup(linkpath); return 0; } +#endif /* WIN32 */ } =20 *resultpath =3D virFileCanonicalizePath(linkpath); @@ -1630,10 +1643,17 @@ virFileIsLink(const char *linkpath) { GStatBuf st; =20 + /* Still do this on Windows so we report + * errors like ENOENT, etc + */ if (g_lstat(linkpath, &st) < 0) return -errno; =20 +#ifndef WIN32 return S_ISLNK(st.st_mode) !=3D 0; +#else /* WIN32 */ + return 0; +#endif /* WIN32 */ } =20 /* @@ -2615,6 +2635,7 @@ virDirCreateNoFork(const char *path, virReportSystemError(errno, _("stat of '%s' failed"), path); goto error; } +# ifndef WIN32 if (((uid !=3D (uid_t) -1 && st.st_uid !=3D uid) || (gid !=3D (gid_t) -1 && st.st_gid !=3D gid)) && (chown(path, uid, gid) < 0)) { @@ -2623,6 +2644,7 @@ virDirCreateNoFork(const char *path, path, (unsigned int) uid, (unsigned int) gid); goto error; } +# endif if (mode !=3D (mode_t) -1 && chmod(path, mode) < 0) { ret =3D -errno; virReportSystemError(errno, @@ -2959,6 +2981,7 @@ void virDirClose(DIR **dirp) * * Returns -1 on error, with error already reported, 0 on success. */ +#ifndef WIN32 int virFileChownFiles(const char *name, uid_t uid, gid_t gid) @@ -2999,6 +3022,19 @@ int virFileChownFiles(const char *name, return ret; } =20 +#else + +int virFileChownFiles(const char *name, + uid_t uid, + gid_t gid) +{ + virReportSystemError(ENOSYS, + _("cannot chown '%s' to (%u, %u)"), + name, (unsigned int) uid, + (unsigned int) gid); + return -1; +} +#endif /* WIN32 */ =20 static int virFileMakePathHelper(char *path, mode_t mode) --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779874; cv=none; d=zohomail.com; s=zohoarc; b=Mph9TEOQ869F6F0+KRkcRj+23NtEBpYmqRQeueYOt6VJKlWkN/AJCLT3WFjbWeQ191nukPJnscUwL/EHu1lI6fW5CfvpRhkIMabKtL2tlq7s+heVDORaxFHH4ubm+E+imVFD3KifbVxjTCl+orbrINWunydyFahtHDMqVSZuxQU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779874; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vFTO6M1WIVtD0/ILltXDh8uYQaM8SRBMfcMLBZ9Jx/M=; b=mmjQMV4XXqKZKcukqgZI7KQQfnlNCSaxH5DXJV+123sGSpXEmIXbvJsrAyjK3fEu8amTLbgmCXi/X9Pksv2ePoO0la3Chf7Tn1w3GEVNs++FLmszZ2bES5kvjS6xNPqwyvTOIc40QruLiwTiuQd8xbp5r6fhPMJVsBAWqi090T4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1579779874871733.2506203817709; Thu, 23 Jan 2020 03:44:34 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-369-n2ppFtmvO1uqk0w9vpcCdg-1; Thu, 23 Jan 2020 06:44:30 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4EA56100551B; Thu, 23 Jan 2020 11:44:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2A06D5DDAA; Thu, 23 Jan 2020 11:44:25 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D8D8B8591D; Thu, 23 Jan 2020 11:44:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBiF51025595 for ; Thu, 23 Jan 2020 06:44:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id 848B78575E; Thu, 23 Jan 2020 11:44:15 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id BAB2E1CB; Thu, 23 Jan 2020 11:44:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779873; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=vFTO6M1WIVtD0/ILltXDh8uYQaM8SRBMfcMLBZ9Jx/M=; b=WH4CKFrAnkEN06sZbhzM7Z6tRwzgPscCM+2nCaw92cgqeyPMTN1+AdD2DyUEooe5OGRCmh T8v0MdJOz5rKyWqHKJk6hilhlQchXoF4080jJ3Add//X5i4/V41sWyDUzg2yu5+/3+ccu+ MFT9nFSdwgYcCmQIt5CWun7o3/EEXYw= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 29/32] src: convert all code to use virsocket.h Date: Thu, 23 Jan 2020 11:43:22 +0000 Message-Id: <20200123114325.3860881-30-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: n2ppFtmvO1uqk0w9vpcCdg-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" There are a large number of different header files that are related to the sockets APIs. The virsocket.h header includes all of the relevant headers for Windows and UNIX in one convenient place. If virsocketaddr.h is already included, then there's no need for virsocket.h Signed-off-by: Daniel P. Berrang=C3=A9 --- configure.ac | 8 +++++--- src/conf/network_conf.c | 2 -- src/esx/esx_util.c | 3 +-- src/esx/esx_util.h | 1 - src/libxl/libxl_conf.c | 2 -- src/lxc/lxc_controller.c | 4 +--- src/lxc/lxc_driver.c | 4 +--- src/nwfilter/nwfilter_dhcpsnoop.c | 3 --- src/nwfilter/nwfilter_learnipaddr.c | 4 +--- src/qemu/qemu_agent.c | 4 +--- src/qemu/qemu_conf.c | 3 +-- src/qemu/qemu_driver.c | 3 +-- src/qemu/qemu_migration.c | 3 +-- src/qemu/qemu_monitor.c | 3 +-- src/qemu/qemu_monitor_json.c | 4 +--- src/remote/qemu_protocol.x | 1 - src/remote/remote_protocol.x | 2 +- src/rpc/virnetprotocol.x | 2 +- src/rpc/virnetsocket.c | 14 ++++---------- src/util/virarptable.c | 1 - src/util/virfdstream.c | 8 ++------ src/util/virfile.c | 3 +-- src/util/virlog.c | 6 +----- src/util/virnetdevbridge.c | 6 +----- src/util/virnetdevmacvlan.c | 3 +-- src/util/virnetdevvportprofile.c | 3 +-- src/util/virnetlink.c | 3 +-- src/util/virsocket.h | 3 ++- src/util/virsocketaddr.c | 2 -- src/util/virsocketaddr.h | 10 ++-------- src/util/virsystemd.c | 9 ++------- src/util/virutil.c | 13 ------------- src/vbox/vbox_MSCOMGlue.c | 6 +----- tests/libxlmock.c | 2 +- tests/nsstest.c | 3 +-- tests/virnetsockettest.c | 1 - tests/virnettlscontexttest.c | 3 +-- tests/virnettlshelpers.c | 1 - tests/virnettlssessiontest.c | 3 +-- tests/virportallocatormock.c | 5 +---- tests/virtestmock.c | 9 ++------- 41 files changed, 43 insertions(+), 130 deletions(-) diff --git a/configure.ac b/configure.ac index adfd950260..b1f75fa751 100644 --- a/configure.ac +++ b/configure.ac @@ -231,9 +231,13 @@ AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" =3D "= yes"]) AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" =3D "yes"]) AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" =3D "yes"]) =20 -# We don't support the daemon yet if test "$with_win" =3D "yes" ; then + # We don't support the daemon yet with_libvirtd=3Dno + + # For AI_ADDRCONFIG + AC_DEFINE([_WIN32_WINNT], [0x0600], [Win Vista / Server 2008]) + AC_DEFINE([WINVER], [0x0600], [Win Vista / Server 2008]) fi =20 # The daemon requires remote support. Likewise, if we are not using @@ -382,7 +386,6 @@ AC_CHECK_HEADERS([\ linux/magic.h \ mntent.h \ net/ethernet.h \ - netinet/tcp.h \ net/if.h \ pty.h \ pwd.h \ @@ -393,7 +396,6 @@ AC_CHECK_HEADERS([\ sys/syscall.h \ sys/sysctl.h \ sys/ucred.h \ - sys/un.h \ ]) dnl Check whether endian provides handy macros. AC_CHECK_DECLS([htole64], [], [], [[#include ]]) diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index 27e83b7d85..1f14a964a2 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -22,8 +22,6 @@ #include =20 #include -#include -#include #include #include =20 diff --git a/src/esx/esx_util.c b/src/esx/esx_util.c index c265528056..89d136248f 100644 --- a/src/esx/esx_util.c +++ b/src/esx/esx_util.c @@ -23,8 +23,6 @@ =20 #include =20 -#include - #include "internal.h" #include "datatypes.h" #include "viralloc.h" @@ -34,6 +32,7 @@ #include "esx_private.h" #include "esx_util.h" #include "virstring.h" +#include "virsocket.h" =20 #define VIR_FROM_THIS VIR_FROM_ESX =20 diff --git a/src/esx/esx_util.h b/src/esx/esx_util.h index d80093dcb5..97b6d82a2b 100644 --- a/src/esx/esx_util.h +++ b/src/esx/esx_util.h @@ -21,7 +21,6 @@ =20 #pragma once =20 -#include #include "internal.h" #include "viruri.h" =20 diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index e41e84e3e2..b4462a6291 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -24,7 +24,6 @@ =20 #include #include -#include =20 #include "internal.h" #include "virlog.h" @@ -48,7 +47,6 @@ #include "virnetdevvportprofile.h" #include "virenum.h" =20 - #define VIR_FROM_THIS VIR_FROM_LIBXL =20 VIR_LOG_INIT("libxl.libxl_conf"); diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 42c631ed0b..558a964fca 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -23,7 +23,6 @@ =20 #include #include -#include =20 #ifdef MAJOR_IN_MKDEV # include @@ -31,8 +30,6 @@ # include #endif =20 -#include -#include #include #include #include @@ -69,6 +66,7 @@ #include "rpc/virnetdaemon.h" #include "virstring.h" #include "virgettext.h" +#include "virsocket.h" =20 #define VIR_FROM_THIS VIR_FROM_LXC =20 diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index bf1f8f8190..931730eabc 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -31,10 +31,7 @@ # include #endif =20 -#include -#include #include -#include #include #include #include @@ -75,6 +72,7 @@ #include "viraccessapichecklxc.h" #include "virhostdev.h" #include "netdev_bandwidth_conf.h" +#include "virsocket.h" =20 #define VIR_FROM_THIS VIR_FROM_LXC =20 diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcp= snoop.c index 629f974177..10567e9cd3 100644 --- a/src/nwfilter/nwfilter_dhcpsnoop.c +++ b/src/nwfilter/nwfilter_dhcpsnoop.c @@ -43,9 +43,6 @@ #include #include =20 -#include -#include -#include #include =20 #include "viralloc.h" diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_le= arnipaddr.c index 5791724cf4..f2d5e60d43 100644 --- a/src/nwfilter/nwfilter_learnipaddr.c +++ b/src/nwfilter/nwfilter_learnipaddr.c @@ -31,10 +31,7 @@ #include #include =20 -#include #include -#include -#include #include =20 #include "internal.h" @@ -53,6 +50,7 @@ #include "nwfilter_ipaddrmap.h" #include "nwfilter_learnipaddr.h" #include "virstring.h" +#include "virsocket.h" =20 #define VIR_FROM_THIS VIR_FROM_NWFILTER =20 diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index b6556ffbaf..4374235d34 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -21,9 +21,6 @@ =20 #include =20 -#include -#include -#include #include #include #include @@ -41,6 +38,7 @@ #include "virobject.h" #include "virstring.h" #include "virenum.h" +#include "virsocket.h" =20 #define VIR_FROM_THIS VIR_FROM_QEMU =20 diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index b62dd1df52..8bc323345a 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -26,7 +26,6 @@ #include #include #include -#include =20 #include "virerror.h" #include "qemu_conf.h" @@ -44,7 +43,7 @@ #include "cpu/cpu.h" #include "domain_nwfilter.h" #include "virfile.h" -#include "virsocketaddr.h" +#include "virsocket.h" #include "virstring.h" #include "viratomic.h" #include "storage_conf.h" diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2f66d7cd9a..d7b2528c80 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -32,8 +32,6 @@ #include #include #include -#include - =20 #include "qemu_driver.h" #include "qemu_agent.h" @@ -104,6 +102,7 @@ #include "virdomainsnapshotobjlist.h" #include "virenum.h" #include "virdomaincheckpointobjlist.h" +#include "virsocket.h" =20 #define VIR_FROM_THIS VIR_FROM_QEMU =20 diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 29d228a8d9..5a7586fab9 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -21,8 +21,6 @@ =20 #include =20 -#include -#include #include #include #include @@ -62,6 +60,7 @@ #include "virprocess.h" #include "nwfilter_conf.h" #include "virdomainsnapshotobjlist.h" +#include "virsocket.h" =20 #define VIR_FROM_THIS VIR_FROM_QEMU =20 diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index ccd20b3740..421dd9554f 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -22,8 +22,6 @@ #include =20 #include -#include -#include #include #include =20 @@ -41,6 +39,7 @@ #include "virprobe.h" #include "virstring.h" #include "virtime.h" +#include "virsocket.h" =20 #ifdef WITH_DTRACE_PROBES # include "libvirt_qemu_probes.h" diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index e5164d218a..b74633441f 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -21,9 +21,6 @@ =20 #include =20 -#include -#include -#include #include #include #include @@ -41,6 +38,7 @@ #include "virstring.h" #include "cpu/cpu_x86.h" #include "virenum.h" +#include "virsocket.h" =20 #ifdef WITH_DTRACE_PROBES # include "libvirt_qemu_probes.h" diff --git a/src/remote/qemu_protocol.x b/src/remote/qemu_protocol.x index 423e8fadaf..8ff5dc8568 100644 --- a/src/remote/qemu_protocol.x +++ b/src/remote/qemu_protocol.x @@ -22,7 +22,6 @@ =20 %#include "internal.h" %#include "remote_protocol.h" -%#include =20 /*----- Protocol. -----*/ struct qemu_domain_monitor_command_args { diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index 79cdb13a90..1f7963510a 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -37,7 +37,7 @@ %#include %#include "internal.h" %#include "virxdrdefs.h" -%#include +%#include "virsocket.h" =20 /*----- Data types. -----*/ =20 diff --git a/src/rpc/virnetprotocol.x b/src/rpc/virnetprotocol.x index 99f4f2e539..2d9b23ca18 100644 --- a/src/rpc/virnetprotocol.x +++ b/src/rpc/virnetprotocol.x @@ -20,7 +20,7 @@ =20 %#include "internal.h" %#include "virxdrdefs.h" -%#include +%#include "virsocket.h" =20 /*----- Data types. -----*/ =20 diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index 906b5165eb..8f3833e2ff 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -22,7 +22,6 @@ #include =20 #include -#include #include #include #include @@ -30,11 +29,6 @@ #ifdef HAVE_IFADDRS_H # include #endif -#include - -#ifdef HAVE_NETINET_TCP_H -# include -#endif =20 #ifdef HAVE_SYS_UCRED_H # include @@ -461,7 +455,7 @@ int virNetSocketNewListenTCP(const char *nodename, } =20 =20 -#if HAVE_SYS_UN_H +#ifndef WIN32 int virNetSocketNewListenUNIX(const char *path, mode_t mask, uid_t user, @@ -647,7 +641,7 @@ int virNetSocketNewConnectTCP(const char *nodename, } =20 =20 -#ifdef HAVE_SYS_UN_H +#ifndef WIN32 int virNetSocketNewConnectUNIX(const char *path, bool spawnDaemon, const char *binary, @@ -1349,7 +1343,7 @@ void virNetSocketDispose(void *obj) sock->watch =3D -1; } =20 -#ifdef HAVE_SYS_UN_H +#ifndef WIN32 /* If a server socket, then unlink UNIX path */ if (sock->unlinkUNIX && sock->localAddr.data.sa.sa_family =3D=3D AF_UNIX && @@ -2289,7 +2283,7 @@ void virNetSocketClose(virNetSocketPtr sock) sock->fd =3D -1; } =20 -#ifdef HAVE_SYS_UN_H +#ifndef WIN32 /* If a server socket, then unlink UNIX path */ if (sock->unlinkUNIX && sock->localAddr.data.sa.sa_family =3D=3D AF_UNIX && diff --git a/src/util/virarptable.c b/src/util/virarptable.c index 265f60d645..c4b46604a9 100644 --- a/src/util/virarptable.c +++ b/src/util/virarptable.c @@ -20,7 +20,6 @@ =20 #include =20 -#include #ifdef __linux__ # include #endif diff --git a/src/util/virfdstream.c b/src/util/virfdstream.c index 58b77aa6fa..c094876dee 100644 --- a/src/util/virfdstream.c +++ b/src/util/virfdstream.c @@ -25,12 +25,7 @@ #include #include #include -#include #include -#if HAVE_SYS_UN_H -# include -#endif -#include #ifndef WIN32 # include #endif @@ -46,6 +41,7 @@ #include "virstring.h" #include "virtime.h" #include "virprocess.h" +#include "virsocket.h" =20 #define VIR_FROM_THIS VIR_FROM_STREAMS =20 @@ -1163,7 +1159,7 @@ int virFDStreamOpen(virStreamPtr st, } =20 =20 -#if HAVE_SYS_UN_H +#ifndef WIN32 int virFDStreamConnectUNIX(virStreamPtr st, const char *path, bool abstract) diff --git a/src/util/virfile.c b/src/util/virfile.c index d08eae5a1d..0b51040638 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -42,8 +42,6 @@ # include #endif /* !HAVE_LIBUTIL_H */ #include -#include -#include #include #if defined(HAVE_SYS_MOUNT_H) # include @@ -90,6 +88,7 @@ #include "virprocess.h" #include "virstring.h" #include "virutil.h" +#include "virsocket.h" =20 #define VIR_FROM_THIS VIR_FROM_NONE =20 diff --git a/src/util/virlog.c b/src/util/virlog.c index 8c17d666de..e4944d1258 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -24,17 +24,12 @@ #include #include #include -#include #include #include #include #if HAVE_SYSLOG_H # include #endif -#include -#if HAVE_SYS_UN_H -# include -#endif =20 #include "virerror.h" #include "virlog.h" @@ -46,6 +41,7 @@ #include "virtime.h" #include "virstring.h" #include "configmake.h" +#include "virsocket.h" =20 /* Journald output is only supported on Linux new enough to expose * htole64. */ diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c index 5a0fb5f42f..769289ae0b 100644 --- a/src/util/virnetdevbridge.c +++ b/src/util/virnetdevbridge.c @@ -26,15 +26,11 @@ #include "viralloc.h" #include "virlog.h" #include "virstring.h" +#include "virsocket.h" =20 -#ifndef WIN32 -# include -#endif -#include #ifdef HAVE_NET_IF # include #endif -#include =20 #ifdef __linux__ # if defined(HAVE_LIBNL) diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index 3ca568fb44..dcea93a5fe 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -42,8 +42,6 @@ VIR_ENUM_IMPL(virNetDevMacVLanMode, =20 #if WITH_MACVTAP # include -# include -# include =20 # include # include @@ -61,6 +59,7 @@ VIR_ENUM_IMPL(virNetDevMacVLanMode, # include "virnetdev.h" # include "virpidfile.h" # include "virbitmap.h" +# include "virsocket.h" =20 VIR_LOG_INIT("util.netdevmacvlan"); =20 diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprof= ile.c index 5ca96132c4..475a0d9cbc 100644 --- a/src/util/virnetdevvportprofile.c +++ b/src/util/virnetdevvportprofile.c @@ -49,8 +49,6 @@ VIR_ENUM_IMPL(virNetDevVPortProfileOp, #if WITH_VIRTUALPORT =20 # include -# include -# include =20 # include # include @@ -59,6 +57,7 @@ VIR_ENUM_IMPL(virNetDevVPortProfileOp, # include "virfile.h" # include "virlog.h" # include "virnetdev.h" +# include "virsocket.h" =20 VIR_LOG_INIT("util.netdevvportprofile"); =20 diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c index 710b4f5f51..2ce3d0fae9 100644 --- a/src/util/virnetlink.c +++ b/src/util/virnetlink.c @@ -24,8 +24,6 @@ #include =20 #include -#include -#include =20 #include "virnetlink.h" #include "virnetdev.h" @@ -34,6 +32,7 @@ #include "virmacaddr.h" #include "virerror.h" #include "viralloc.h" +#include "virsocket.h" =20 #define VIR_FROM_THIS VIR_FROM_NET =20 diff --git a/src/util/virsocket.h b/src/util/virsocket.h index e1e7d08bb4..6d323e0a12 100644 --- a/src/util/virsocket.h +++ b/src/util/virsocket.h @@ -79,13 +79,14 @@ int vir_socket(int domain, int type, int protocol); #else =20 # include -# include # include # include +# include # include # include # include # include +# include =20 # define closesocket close # define ioctlsocket ioctl diff --git a/src/util/virsocketaddr.c b/src/util/virsocketaddr.c index f90022827e..4cad329d15 100644 --- a/src/util/virsocketaddr.c +++ b/src/util/virsocketaddr.c @@ -24,8 +24,6 @@ #include "virbuffer.h" #include "viralloc.h" =20 -#include - #define VIR_FROM_THIS VIR_FROM_NONE =20 /* diff --git a/src/util/virsocketaddr.h b/src/util/virsocketaddr.h index 66aee2abcd..d06e751f73 100644 --- a/src/util/virsocketaddr.h +++ b/src/util/virsocketaddr.h @@ -18,13 +18,7 @@ =20 #pragma once =20 -#include -#include -#ifdef HAVE_SYS_UN_H -# include -#endif - -#include "internal.h" +#include "virsocket.h" =20 #define VIR_LOOPBACK_IPV4_ADDR "127.0.0.1" =20 @@ -34,7 +28,7 @@ typedef struct { struct sockaddr_storage stor; struct sockaddr_in inet4; struct sockaddr_in6 inet6; -#ifdef HAVE_SYS_UN_H +#ifndef WIN32 struct sockaddr_un un; #endif } data; diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c index 96d43e5440..a9ff782fb8 100644 --- a/src/util/virsystemd.c +++ b/src/util/virsystemd.c @@ -21,11 +21,6 @@ =20 #include =20 -#include -#ifdef HAVE_SYS_UN_H -# include -#endif - #define LIBVIRT_VIRSYSTEMDPRIV_H_ALLOW #include "virsystemdpriv.h" =20 @@ -515,7 +510,7 @@ int virSystemdTerminateMachine(const char *name) void virSystemdNotifyStartup(void) { -#ifdef HAVE_SYS_UN_H +#ifndef WIN32 const char *path; const char *msg =3D "READY=3D1"; int fd; @@ -559,7 +554,7 @@ virSystemdNotifyStartup(void) VIR_WARN("Failed to notify systemd"); =20 VIR_FORCE_CLOSE(fd); -#endif /* HAVE_SYS_UN_H */ +#endif /* !WIN32 */ } =20 static int diff --git a/src/util/virutil.c b/src/util/virutil.c index 4bc0aef35f..ad05ef5fc1 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -44,7 +44,6 @@ # include #endif =20 -#include #ifdef HAVE_GETPWUID_R # include # include @@ -54,18 +53,6 @@ # include #endif =20 -#ifdef WIN32 -# ifdef HAVE_WINSOCK2_H -# include -# endif -# include -# include -#endif - -#ifdef HAVE_SYS_UN_H -# include -#endif - #include "virerror.h" #include "virlog.h" #include "virbuffer.h" diff --git a/src/vbox/vbox_MSCOMGlue.c b/src/vbox/vbox_MSCOMGlue.c index 5cc3f5c7c8..18dbb0ffe1 100644 --- a/src/vbox/vbox_MSCOMGlue.c +++ b/src/vbox/vbox_MSCOMGlue.c @@ -22,11 +22,6 @@ =20 #include =20 -#ifdef HAVE_WINSOCK2_H -# include -#endif -#include - #define nsCID CLSID =20 #include "internal.h" @@ -35,6 +30,7 @@ #include "virerror.h" #include "virstring.h" #include "virutil.h" +#include "virsocket.h" #include "vbox_MSCOMGlue.h" =20 #define VIR_FROM_THIS VIR_FROM_VBOX diff --git a/tests/libxlmock.c b/tests/libxlmock.c index 38302b2ae8..b995b34cc5 100644 --- a/tests/libxlmock.c +++ b/tests/libxlmock.c @@ -27,9 +27,9 @@ # include # include # include -# include =20 # include "virfile.h" +# include "virsocket.h" =20 VIR_MOCK_IMPL_RET_VOID(xs_daemon_open, struct xs_handle *) diff --git a/tests/nsstest.c b/tests/nsstest.c index d146100747..514b4f7195 100644 --- a/tests/nsstest.c +++ b/tests/nsstest.c @@ -22,9 +22,8 @@ =20 #ifdef NSS =20 -# include # include "libvirt_nss.h" -# include "virsocketaddr.h" +# include "virsocket.h" =20 # define VIR_FROM_THIS VIR_FROM_NONE =20 diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index 42a3971d41..af11a0f6e8 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -22,7 +22,6 @@ #ifdef HAVE_IFADDRS_H # include #endif -#include =20 #include "testutils.h" #include "virutil.h" diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c index 8013f9eda8..328b1340d6 100644 --- a/tests/virnettlscontexttest.c +++ b/tests/virnettlscontexttest.c @@ -19,7 +19,6 @@ #include =20 #include -#include =20 #include "testutils.h" #include "virnettlshelpers.h" @@ -29,7 +28,7 @@ #include "virlog.h" #include "virfile.h" #include "vircommand.h" -#include "virsocketaddr.h" +#include "virsocket.h" =20 #if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >=3D 0x0= 20600 =20 diff --git a/tests/virnettlshelpers.c b/tests/virnettlshelpers.c index a6aacf4cc3..5aaf98e345 100644 --- a/tests/virnettlshelpers.c +++ b/tests/virnettlshelpers.c @@ -19,7 +19,6 @@ #include =20 #include -#include =20 #include "virnettlshelpers.h" #include "viralloc.h" diff --git a/tests/virnettlssessiontest.c b/tests/virnettlssessiontest.c index 4f1b2aa8d2..6807581d70 100644 --- a/tests/virnettlssessiontest.c +++ b/tests/virnettlssessiontest.c @@ -19,7 +19,6 @@ #include =20 #include -#include =20 #include "testutils.h" #include "virnettlshelpers.h" @@ -29,7 +28,7 @@ #include "virlog.h" #include "virfile.h" #include "vircommand.h" -#include "virsocketaddr.h" +#include "virsocket.h" =20 #if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >=3D 0x0= 20600 =20 diff --git a/tests/virportallocatormock.c b/tests/virportallocatormock.c index e715f34e04..28fe89200e 100644 --- a/tests/virportallocatormock.c +++ b/tests/virportallocatormock.c @@ -23,10 +23,7 @@ #endif =20 #if defined(__linux__) && defined(RTLD_NEXT) -# include "internal.h" -# include -# include -# include +# include "virsocket.h" # include =20 static bool host_has_ipv6; diff --git a/tests/virtestmock.c b/tests/virtestmock.c index 046898dbe1..e5dccae2a8 100644 --- a/tests/virtestmock.c +++ b/tests/virtestmock.c @@ -20,16 +20,11 @@ =20 #include "virmock.h" #include -#include #include #include #include -#include -#ifdef HAVE_SYS_UN_H -# include -#endif =20 -#include "internal.h" +#include "virsocket.h" #include "configmake.h" #include "virstring.h" #include "viralloc.h" @@ -202,7 +197,7 @@ int connect(int sockfd, const struct sockaddr *addr, so= cklen_t addrlen) { init_syms(); =20 -#ifdef HAVE_SYS_UN_H +#ifndef WIN32 if (addrlen =3D=3D sizeof(struct sockaddr_un)) { struct sockaddr_un *tmp =3D (struct sockaddr_un *) addr; if (tmp->sun_family =3D=3D AF_UNIX) --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779880; cv=none; d=zohomail.com; s=zohoarc; b=g4zs77TqXxLjccU5zwQlSUTn2meGHMsNU/NDa5czZOdLyvU+f+NReAG3VGsm54+gwxa9xszPyr73dh4ZRxx9M6EuR50+uMRVafvMZZOayw6cLZxLLAllPBFyvAZuCXa8rqZU4BWoJYUzzIiKmRFwUIabdGmnayyF1H37h9RrGos= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779880; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=76gtJZwq8F4pOzjpYHN15rxxBfLHphdzAFGb626I270=; b=fPZlkIh4gdoznPbMAeGi/rHJhjZ+xGjrUwb8mcyFhKef6NqoOsFyZmV9cLuNl2TYi7pkKWDiqjQdh8uFAf6QwBeyhmyRprPMAemy0TUJ3yaAVZz/YdcgpdWpzfZEKZKUEfkMR6xSRtIc6Z1d2aXQZENySjjSbZZu6hDDrUUhs/c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1579779880848747.2421467200902; Thu, 23 Jan 2020 03:44:40 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-260-BulnoGOFPrm_yYQGMhXIvA-1; Thu, 23 Jan 2020 06:44:34 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 65E82100550E; Thu, 23 Jan 2020 11:44:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B069B86452; Thu, 23 Jan 2020 11:44:28 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6BBBC18034FF; Thu, 23 Jan 2020 11:44:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBiGsh025608 for ; Thu, 23 Jan 2020 06:44:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 68A698575C; Thu, 23 Jan 2020 11:44:16 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA3EC85750; Thu, 23 Jan 2020 11:44:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779879; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=76gtJZwq8F4pOzjpYHN15rxxBfLHphdzAFGb626I270=; b=Sh6XnAPvvcBJ3jcTmn8GYpyy61DESGRlAnm5XSBlL1eEDv2fXg0dRIaOoEMo1+Y7I/0w37 6avey9e0EM8ptfjXM76mD1ec6U6fymDUp/8ljM2dmPQX2J8048iY4b6ODNOIjYONDvlEBS TW4XRA5T5lE39hfpxGZNH+cY2fda+fc= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 30/32] tests: conditionalize use of SIGPIPE Date: Thu, 23 Jan 2020 11:43:23 +0000 Message-Id: <20200123114325.3860881-31-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: BulnoGOFPrm_yYQGMhXIvA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" SIGPIPE is not available on the Windows platform. Signed-off-by: Daniel P. Berrang=C3=A9 --- tests/virauthconfigtest.c | 2 ++ tests/virkeyfiletest.c | 2 ++ tests/virlockspacetest.c | 2 ++ tests/virnetmessagetest.c | 2 ++ tests/virnetsockettest.c | 2 ++ tests/virtimetest.c | 2 ++ tests/viruritest.c | 2 ++ 7 files changed, 14 insertions(+) diff --git a/tests/virauthconfigtest.c b/tests/virauthconfigtest.c index e3bd927dcb..20855f004e 100644 --- a/tests/virauthconfigtest.c +++ b/tests/virauthconfigtest.c @@ -84,7 +84,9 @@ mymain(void) =20 virAuthConfigPtr config; =20 +#ifndef WIN32 signal(SIGPIPE, SIG_IGN); +#endif /* WIN32 */ =20 #define TEST_LOOKUP(config, hostname, service, credname, expect) \ do { \ diff --git a/tests/virkeyfiletest.c b/tests/virkeyfiletest.c index b1236a47e1..abdf06c4a7 100644 --- a/tests/virkeyfiletest.c +++ b/tests/virkeyfiletest.c @@ -109,7 +109,9 @@ mymain(void) { int ret =3D 0; =20 +#ifndef WIN32 signal(SIGPIPE, SIG_IGN); +#endif /* WIN32 */ =20 if (virTestRun("Test parse", testParse, NULL) < 0) ret =3D -1; diff --git a/tests/virlockspacetest.c b/tests/virlockspacetest.c index 40395e8c72..3afedb4c46 100644 --- a/tests/virlockspacetest.c +++ b/tests/virlockspacetest.c @@ -342,7 +342,9 @@ mymain(void) { int ret =3D 0; =20 +#ifndef WIN32 signal(SIGPIPE, SIG_IGN); +#endif /* WIN32 */ =20 if (virTestRun("Lockspace creation", testLockSpaceCreate, NULL) < 0) ret =3D -1; diff --git a/tests/virnetmessagetest.c b/tests/virnetmessagetest.c index b0a01e8b9d..a207f2d85f 100644 --- a/tests/virnetmessagetest.c +++ b/tests/virnetmessagetest.c @@ -525,7 +525,9 @@ mymain(void) { int ret =3D 0; =20 +#ifndef WIN32 signal(SIGPIPE, SIG_IGN); +#endif /* WIN32 */ =20 if (virTestRun("Message Header Encode", testMessageHeaderEncode, NULL)= < 0) ret =3D -1; diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index af11a0f6e8..9dfc707c90 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -522,7 +522,9 @@ mymain(void) int freePort; #endif =20 +#ifndef WIN32 signal(SIGPIPE, SIG_IGN); +#endif /* WIN32 */ =20 virEventRegisterDefaultImpl(); =20 diff --git a/tests/virtimetest.c b/tests/virtimetest.c index f9ac55192d..5736245722 100644 --- a/tests/virtimetest.c +++ b/tests/virtimetest.c @@ -115,7 +115,9 @@ mymain(void) { int ret =3D 0; =20 +#ifndef WIN32 signal(SIGPIPE, SIG_IGN); +#endif /* WIN32 */ =20 #define TEST_FIELDS(ts, year, mon, day, hour, min, sec) \ do { \ diff --git a/tests/viruritest.c b/tests/viruritest.c index 07cf7261d1..0edf3e5522 100644 --- a/tests/viruritest.c +++ b/tests/viruritest.c @@ -145,7 +145,9 @@ mymain(void) { int ret =3D 0; =20 +#ifndef WIN32 signal(SIGPIPE, SIG_IGN); +#endif /* WIN32 */ =20 #define TEST_FULL(uri, uri_out, scheme, server, port, path, query, \ fragment, user, params) \ --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779907; cv=none; d=zohomail.com; s=zohoarc; b=nd9WFdwvziyikyB+tg+BWkGqCNRVmiWnKozxZa7tgjTmHrPHNgHyjyaRhWKfb4saMPgBOPgdT/DEgJO8Ivp2nkV8CfT5xBsozZgbI82cICxRHtkjslq4FvdHlwVisBhgLKGQCQ3/ovvgku/gQPkGI2RqD4/PY24FenKHiMxMAd8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779907; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=s32+XaHpsjQdFPB3kop4TdDqnyfGOaNdNQaUxGl9ivY=; b=fRc0DA04rarPd1ufgC4PzTVLHCqRyYNRdCtTRTbc3t04UJK1o8xcPDQDJlZyV1Dbs1Qi2Bet/Euw+FEodHGBSYc5/rv7uTfooEeoSEWBUtEfQaqedp0pUcfRiqHdsQNOyQq7TW/P82EdJuo6OpQQ4uao9ej4WlGm5opnLxXFZRc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1579779907392468.7620927486646; Thu, 23 Jan 2020 03:45:07 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-372-FNom3nEfMgSxrkMSocjofA-1; Thu, 23 Jan 2020 06:44:38 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1B29C190D34A; Thu, 23 Jan 2020 11:44:33 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E560B8CCE6; Thu, 23 Jan 2020 11:44:32 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9CFDB85923; Thu, 23 Jan 2020 11:44:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBiHLs025615 for ; Thu, 23 Jan 2020 06:44:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4E00785750; Thu, 23 Jan 2020 11:44:17 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id AE21D8575E; Thu, 23 Jan 2020 11:44:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779906; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=s32+XaHpsjQdFPB3kop4TdDqnyfGOaNdNQaUxGl9ivY=; b=bBjHz+u9/h4SoVuonjX5usW4wZp1I4jmPSOwiqlFcEOyo4ju4wzpQL7tiEqlCGApEISNyA RO7CXp4cpQiTM9DjIxamkeP7oTKlJz+WxFUq7loDOmhjKMgQqKdnk6HI/Zo1dhGjldZERH XTsfKyBkBLof7n5NuDJ5PkO6FuDCraM= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 31/32] src: conditionalize EAI_ADDRFAMILY Date: Thu, 23 Jan 2020 11:43:24 +0000 Message-Id: <20200123114325.3860881-32-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: FNom3nEfMgSxrkMSocjofA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The EAI_ADDRFAMILY constant has been removed from FreeBSD headers, supposedly because it is deprecated by new RFC drafts. Previously GNULIB was providing a replacement because MinGW lacked it too. The replacement provided for MinGW was thus being used on FreeBSD too, but with a completely bogus integer value. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/rpc/virnetsocket.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index 8f3833e2ff..f7d71dea9e 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -180,8 +180,10 @@ int virNetSocketCheckProtocols(bool *hasIPv4, hints.ai_socktype =3D SOCK_STREAM; =20 if ((gaierr =3D getaddrinfo("::1", NULL, &hints, &ai)) !=3D 0) { - if (gaierr =3D=3D EAI_ADDRFAMILY || - gaierr =3D=3D EAI_FAMILY || + if (gaierr =3D=3D EAI_FAMILY || +#ifdef EAI_ADDRFAMILY + gaierr =3D=3D EAI_ADDRFAMILY || +#endif gaierr =3D=3D EAI_NONAME) { *hasIPv6 =3D false; } else { --=20 2.24.1 From nobody Thu May 9 01:23:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579779885; cv=none; d=zohomail.com; s=zohoarc; b=MJYlrg2RNDdZlCic9NrkIodMyD9mi4PmPrD4htaiyHYTuNedWYBOHxt2FOt82SjhH7xdJRATGQjBwEdvJ1RrxFgVKIuh+inB2xDYk4NGkvxhxLl32D3B3OPwWRmGDIlOFsqBndwBTwBj7U9trd7GWke40lWsZCxwhR3RV64ckkE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579779885; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QCMYKYL/riMuYWDunIvGm3Wz4SiCWCZuO+7Vi6tbyfA=; b=YUyZ3dEa+y8WB9u6GHTjA99geMQ6nBdKvJKv8jqitNy+BO1F0dCNzTYzWVxZnOKrXuMFOvc+kavyleFpwCUxIe5N2qxz/AqfUEaBB5R+4JRB0/pYGuT97+2gn/Q4fwNwnQIozl5AGbEb3X8dRQLQ0c3NV0BZtHORZsz3UaRukko= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1579779885865907.5875175230384; Thu, 23 Jan 2020 03:44:45 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-407-QoXvvaFxMsWCxwAKwVAXnQ-1; Thu, 23 Jan 2020 06:44:43 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2D3B0190D347; Thu, 23 Jan 2020 11:44:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F195F60BE1; Thu, 23 Jan 2020 11:44:36 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A64EF85927; Thu, 23 Jan 2020 11:44:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NBiIHb025632 for ; Thu, 23 Jan 2020 06:44:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3509285754; Thu, 23 Jan 2020 11:44:18 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9600A8575E; Thu, 23 Jan 2020 11:44:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779884; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=QCMYKYL/riMuYWDunIvGm3Wz4SiCWCZuO+7Vi6tbyfA=; b=XOoF5jLNJESMFq0ogHYjI9+gDUeT6M0zga5JkSGPwfk6wGNqq0ARfL1/xIm9o5MUyM2WFY pl/vs3zjiVwFv42G8A9le3u2aidW0Jx6MXJhTCEwGoCeodwM2q9v7t2rgoXtha2s/wFQsw bqEI0y6yYWHdiXg5rn6mygtebcflDI8= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 32/32] bootstrap: remove 18 more gnulib modules Date: Thu, 23 Jan 2020 11:43:25 +0000 Message-Id: <20200123114325.3860881-33-berrange@redhat.com> In-Reply-To: <20200123114325.3860881-1-berrange@redhat.com> References: <20200123114325.3860881-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: QoXvvaFxMsWCxwAKwVAXnQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" * chown: use is conditionally compiled * configmake: functionality imported to Makefile.am * getaddrinfo: we have no portability problems with Windows impl * getpass: simplified impl is imported * mgetgroups: getgrouplist is used directly * net_if: header includes are conditionalized * netdb: header includes are conditionalized * passfd: simplified impl is imported * posix-shell: functionality was unused & removed * sigaction: usage is conditionalized * sigpipe: usage is conditionalized * stat-time: struct stat is used directly * strchrnul: usage is eliminated * strtok_r: usage is not a portability problem * sys_stat: usage is conditionalized * uname: rewritten to use native Win32 function to get host arch * waitpid: usage is conditionalized * wcwidth: rewritten using g_unichar APIs Signed-off-by: Daniel P. Berrang=C3=A9 --- bootstrap.conf | 36 ------------------------------------ po/POTFILES.in | 1 - src/rpc/virnetsocket.c | 5 +++++ 3 files changed, 5 insertions(+), 37 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 4159199d08..7e1412093f 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -24,56 +24,20 @@ # turning it into a FD, since closing an FD also closes # the original HANDLE. =20 -# -> conditional build to avoid Win32 -gnulib_modules=3D"$gnulib_modules chown" -# -> Meson -gnulib_modules=3D"$gnulib_modules configmake" -# -> GSocket -gnulib_modules=3D"$gnulib_modules getaddrinfo" -# -> copy gnuliub win32 impl -gnulib_modules=3D"$gnulib_modules getpass" # -> Meson gnulib_modules=3D"$gnulib_modules largefile" # -> custom configure check gnulib_modules=3D"$gnulib_modules localeconv" -# -> painful copy gnulib -gnulib_modules=3D"$gnulib_modules mgetgroups" -# -> GSocket -gnulib_modules=3D"$gnulib_modules net_if" -# -> GSocket -gnulib_modules=3D"$gnulib_modules netdb" -# -> GSocket -gnulib_modules=3D"$gnulib_modules passfd" # -> open code / conditional comp gnulib_modules=3D"$gnulib_modules pipe-posix" # -> open code / conditional comp gnulib_modules=3D"$gnulib_modules pipe2" # -> GMainLoop gnulib_modules=3D"$gnulib_modules poll" -# -> Meson -gnulib_modules=3D"$gnulib_modules posix-shell" -# -> open code conditional logic -gnulib_modules=3D"$gnulib_modules sigaction" -# -> open code conditional logic -gnulib_modules=3D"$gnulib_modules sigpipe" -# -> open code conditional or use GIO GFileInfo -gnulib_modules=3D"$gnulib_modules stat-time" # -> GThread gnulib_modules=3D"$gnulib_modules threadlib" -# -> remove use or open-code it. possibly add to glib -gnulib_modules=3D"$gnulib_modules strchrnul" -# -> g_strsplit -gnulib_modules=3D"$gnulib_modules strtok_r" -# -> remove sys/stat.h include from any win32 code paths -gnulib_modules=3D"$gnulib_modules sys_stat" # -> remove sys/wait.h include from any win32 code paths gnulib_modules=3D"$gnulib_modules sys_wait" -# -> g_get_os_info in GLib 2.64 but can't use that yet -gnulib_modules=3D"$gnulib_modules uname" -# -> remove from Win32 code paths -gnulib_modules=3D"$gnulib_modules waitpid" -# -> open code impl -gnulib_modules=3D"$gnulib_modules wcwidth" =20 SKIP_PO=3Dtrue =20 diff --git a/po/POTFILES.in b/po/POTFILES.in index e266871907..c18e21615f 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -5,7 +5,6 @@ @BUILDDIR@/src/admin/admin_server_dispatch_stubs.h @BUILDDIR@/src/remote/remote_client_bodies.h @BUILDDIR@/src/remote/remote_daemon_dispatch_stubs.h -@SRCDIR@/gnulib/lib/gai_strerror.c @SRCDIR@/src/access/viraccessdriverpolkit.c @SRCDIR@/src/access/viraccessmanager.c @SRCDIR@/src/admin/admin_server.c diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index f7d71dea9e..c77310d3f2 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -1394,6 +1394,11 @@ int virNetSocketGetFD(virNetSocketPtr sock) return fd; } =20 +/* Temp hack - we're still pulling in gnulib + * fcntl-h indirectly, but not fcntl */ +#ifdef WIN32 +# undef F_DUPFD_CLOEXEC +#endif =20 int virNetSocketDupFD(virNetSocketPtr sock, bool cloexec) { --=20 2.24.1