From nobody Sun Feb 8 07:08:03 2026 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=1577977071; cv=none; d=zohomail.com; s=zohoarc; b=KMH5+F4IkcdJcA3GrUWWaC3gbGZo0Qf5F+RV4lzIk2dv1GKQt91h8GuZEgqVTorsEznpCr7L9RSDpfozj7zA5xdW17Nxn++j9sLQi9YQ50J+FSC770F4EDILnwdWqnQfxBDD8WtMaQ1OGqSqamh9XVy3aV724FPu8r2ALHsY3rY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1577977071; 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=ev164FGD5d6Kl+ZjF6xdzdtcg102aFYqA1zaDhFz0Ek=; b=KySTAim3yS2Wr0fu/F04RbTtXTmqYLA7wHdyaaHpr9ucxnDiIkeTwdGyFop9yXPPq/nvblmZQw2egeDyvYAC35iFEHAiL9iGL7Skqd0aaYVQJc95WN7GrXlN2XD5ZUj61QFLOYGS52TWLIOVK2DJXP42id+iA/VVLgFsBHfKVyc= 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 1577977071392785.4917769835546; Thu, 2 Jan 2020 06:57: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-61-aUh5Kyn6MRSfIHrM5JKyqg-1; Thu, 02 Jan 2020 09:57:48 -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 EE95219057A5; Thu, 2 Jan 2020 14:57:42 +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 C686B60FC1; Thu, 2 Jan 2020 14:57:42 +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 80D8081E3E; Thu, 2 Jan 2020 14:57:42 +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 002Evfl4005258 for ; Thu, 2 Jan 2020 09:57:41 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6608460C87; Thu, 2 Jan 2020 14:57:41 +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 174CA6106C; Thu, 2 Jan 2020 14:57:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1577977070; 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=ev164FGD5d6Kl+ZjF6xdzdtcg102aFYqA1zaDhFz0Ek=; b=TiNS7z2JnRY32nFrMye7mNf2ZyvA+INydGgF9k+gEMazExUS+Sv9S5IhMAgAEzhiBFRgvx mvEZLZhFLMutjzMlhmjY4JPNjT/cmLI4dDTysm+u9wF7tjODQjne/372puiVGrCS/i54xE cFOutIeAvk8zSRAHSbwH1ybpod1P7ZQ= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 2 Jan 2020 14:53:54 +0000 Message-Id: <20200102145357.6724-21-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 20/23] src: replace WSAStartup with g_networking_init() 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: aUh5Kyn6MRSfIHrM5JKyqg-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_networking_init() does the same as our custom code. Signed-off-by: Daniel P. Berrang=C3=A9 --- m4/virt-glib.m4 | 2 +- src/libvirt.c | 25 ++----------------------- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/m4/virt-glib.m4 b/m4/virt-glib.m4 index eb2c77b25b..03e51711c0 100644 --- a/m4/virt-glib.m4 +++ b/m4/virt-glib.m4 @@ -24,7 +24,7 @@ AC_DEFUN([LIBVIRT_ARG_GLIB], [ AC_DEFUN([LIBVIRT_CHECK_GLIB],[ GLIB_REQUIRED=3D2.48.0 =20 - LIBVIRT_CHECK_PKG([GLIB], [glib-2.0 gobject-2.0], [$GLIB_REQUIRED]) + LIBVIRT_CHECK_PKG([GLIB], [glib-2.0 gobject-2.0 gio-2.0], [$GLIB_REQUIRE= D]) =20 if test "$with_glib" =3D "no" ; then AC_MSG_ERROR([glib-2.0, gobject-2.0 >=3D $GLIB_REQUIRED are required f= or libvirt]) diff --git a/src/libvirt.c b/src/libvirt.c index c741ebe311..f1ffc97261 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -26,15 +26,12 @@ #include #include #include +#include =20 #include #include #include "getpass.h" =20 -#ifdef HAVE_WINSOCK2_H -# include -#endif - #ifdef WITH_CURL # include #endif @@ -211,21 +208,6 @@ static virConnectAuth virConnectAuthDefault =3D { */ virConnectAuthPtr virConnectAuthPtrDefault =3D &virConnectAuthDefault; =20 -#if HAVE_WINSOCK2_H -static int -virWinsockInit(void) -{ - WORD winsock_version, err; - WSADATA winsock_data; - - /* http://msdn2.microsoft.com/en-us/library/ms742213.aspx */ - winsock_version =3D MAKEWORD(2, 2); - err =3D WSAStartup(winsock_version, &winsock_data); - return err =3D=3D 0 ? 0 : -1; -} -#endif - - static bool virGlobalError; static virOnceControl virGlobalOnce =3D VIR_ONCE_CONTROL_INITIALIZER; =20 @@ -261,10 +243,7 @@ virGlobalInit(void) =20 VIR_DEBUG("register drivers"); =20 -#if HAVE_WINSOCK2_H - if (virWinsockInit() =3D=3D -1) - goto error; -#endif + g_networking_init(); =20 #ifdef HAVE_LIBINTL_H if (!bindtextdomain(PACKAGE, LOCALEDIR)) --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list