From nobody Sun Feb 8 06:54:22 2026 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=1577977013; cv=none; d=zohomail.com; s=zohoarc; b=inmpHSROY1wWQzLmPCUyMIrFw1BwotAQJ392/ibhx7yiTeXJRoGd1nSb3GJmdrTmI1TL/SxDS4Dc01T2jP7u5Se7J/nV/MIM/fff87UhzdyuxAHtrGPiZT75mqqiv5a8cDFrzynW4lSzdQkBbwmrKEUrN5ji1BPYP3iJdzigzSE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1577977013; 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=4Js4jyGFoz8dchapul9bgNdp5m4a64PDClbnhFqKELM=; b=Jibw8mIblWUgOVgMXrjPLHsMJkl6BPh0J3zUrdemVsw0YSy535Rtk8kaa0Cb/77WdSjYgyne0qJ/ZqydOdUY42fZew1lZVjdXUp2hN38Qw/q8lH3NFwcWUfLz6B5IlI1rce2UPhDtCJaTYZdQeTHgNn9DR/BTP7K2P+M2Vd8XDY= 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 1577977013430961.2282785723298; Thu, 2 Jan 2020 06:56:53 -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-7pla9W_INwSyJK0X1sSR7g-1; Thu, 02 Jan 2020 09:56: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 07BAF911BD; Thu, 2 Jan 2020 14:56:39 +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 D3B1B19C5B; Thu, 2 Jan 2020 14:56:38 +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 8F57518089D8; Thu, 2 Jan 2020 14:56:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 002EuVZN004767 for ; Thu, 2 Jan 2020 09:56:31 -0500 Received: by smtp.corp.redhat.com (Postfix) id 10B2360C85; Thu, 2 Jan 2020 14:56:31 +0000 (UTC) Received: from catbus.gsslab.fab.redhat.com (dhcp-43.gsslab.fab.redhat.com [10.33.9.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74AF960BF4; Thu, 2 Jan 2020 14:56:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1577977012; 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=4Js4jyGFoz8dchapul9bgNdp5m4a64PDClbnhFqKELM=; b=GqW3Ju70xZSqm2gXE6DD9gT77bVYDAiGcAmI7th6zt0iQNvig8miqqKsXT2q8Vt+q93vHQ O5WPk2Z5AZJCmtT9s1/QqJaYaOVmVoQcjJWGRVHrwAP9JxYNIbEtkOtt3zM9KA7WVD9UPq iPFngSvQARPJ0s+nk068D8RkkNzPyN0= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 2 Jan 2020 14:53:41 +0000 Message-Id: <20200102145357.6724-8-berrange@redhat.com> In-Reply-To: <20200102145357.6724-1-berrange@redhat.com> References: <20200102145357.6724-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 07/23] util: add compat wrapper for g_fsync 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: 7pla9W_INwSyJK0X1sSR7g-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) g_fsync isn't available until 2.63 so we need a compat wrapper temporarily. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/libvirt_private.syms | 1 + src/util/glibcompat.c | 13 +++++++++++++ src/util/glibcompat.h | 5 +++++ 3 files changed, 19 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index a7b1ef23bc..d3184dbf5c 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1504,6 +1504,7 @@ virSecurityManagerVerify; =20 =20 # util/glibcompat.h +vir_g_fsync; vir_g_strdup_printf; vir_g_strdup_vprintf; =20 diff --git a/src/util/glibcompat.c b/src/util/glibcompat.c index 3f830840cf..4ebefb4478 100644 --- a/src/util/glibcompat.c +++ b/src/util/glibcompat.c @@ -19,11 +19,13 @@ #include =20 #include +#include =20 #include "glibcompat.h" =20 #undef g_strdup_printf #undef g_strdup_vprintf +#undef g_fsync =20 /* Due to a bug in glib, g_strdup_printf() nor g_strdup_vprintf() * abort on OOM. It's fixed in glib's upstream. Provide our own @@ -51,3 +53,14 @@ vir_g_strdup_vprintf(const char *msg, va_list args) abort(); return ret; } + + +gint +vir_g_fsync(gint fd) +{ +#ifdef G_OS_WIN32 + return _commit(fd); +#else + return fsync(fd); +#endif +} diff --git a/src/util/glibcompat.h b/src/util/glibcompat.h index 2bbbe57612..d6b83f4b93 100644 --- a/src/util/glibcompat.h +++ b/src/util/glibcompat.h @@ -25,8 +25,13 @@ char *vir_g_strdup_printf(const char *msg, ...) G_GNUC_PRINTF(1, 2); char *vir_g_strdup_vprintf(const char *msg, va_list args) G_GNUC_PRINTF(1, 0); +gint vir_g_fsync(gint fd); =20 #if !GLIB_CHECK_VERSION(2, 64, 0) # define g_strdup_printf vir_g_strdup_printf # define g_strdup_vprintf vir_g_strdup_vprintf #endif + +#if !GLIB_CHECK_VERSION(2, 63, 0) +# define g_fsync vir_g_fsync +#endif --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list