From nobody Sun Feb 8 19:48:40 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1490647328748826.9462915305173; Mon, 27 Mar 2017 13:42:08 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 38953C05492F; Mon, 27 Mar 2017 20:42:07 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 091B61710F; Mon, 27 Mar 2017 20:42:07 +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 65A0C5EC6B; Mon, 27 Mar 2017 20:42:06 +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 v2RKe120020088 for ; Mon, 27 Mar 2017 16:40:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8B5BC18992; Mon, 27 Mar 2017 20:40:01 +0000 (UTC) Received: from wheatley.cock.kentus.net (ovpn-116-142.ams2.redhat.com [10.36.116.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id EEA3218984 for ; Mon, 27 Mar 2017 20:40:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 38953C05492F Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 38953C05492F From: Martin Kletzander To: libvir-list@redhat.com Date: Mon, 27 Mar 2017 22:39:52 +0200 Message-Id: <0fc454cec0e453630a384190a9313d5216acf737.1490647165.git.mkletzan@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] Use stub for virNetDevGetName on mingw 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 27 Mar 2017 20:42:08 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" If if_indextoname is not defined, the whole function using it should not be defined either. Add stub to fix build on mingw. Caused by 5dd607059d8a98e04024305ae4afbd038aadbdcd Signed-off-by: Martin Kletzander --- configure.ac | 7 ++++--- src/util/virnetdev.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index cf50422d5dab..08051d53aa0a 100644 --- a/configure.ac +++ b/configure.ac @@ -319,9 +319,10 @@ AC_CHECK_SIZEOF([long]) dnl Availability of various common functions (non-fatal if missing), dnl and various less common threadsafe functions AC_CHECK_FUNCS_ONCE([cfmakeraw fallocate geteuid getgid getgrnam_r \ - getmntent_r getpwuid_r getrlimit getuid kill mmap newlocale posix_falloc= ate \ - posix_memalign prlimit regexec sched_getaffinity setgroups setns \ - setrlimit symlink sysctlbyname getifaddrs sched_setscheduler unshare]) + getmntent_r getpwuid_r getrlimit getuid if_indextoname kill mmap \ + newlocale posix_fallocate posix_memalign prlimit regexec \ + sched_getaffinity setgroups setns setrlimit symlink sysctlbyname \ + getifaddrs sched_setscheduler unshare]) dnl Availability of various common headers (non-fatal if missing). AC_CHECK_HEADERS([pwd.h regex.h sys/un.h \ diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 47e2b20d56a1..170e34827f12 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -852,6 +852,7 @@ virNetDevGetRcvAllMulti(const char *ifname, return virNetDevGetIFFlag(ifname, VIR_IFF_ALLMULTI, receive); } +#if defined(HAVE_IF_INDEXTONAME) char *virNetDevGetName(int ifindex) { char name[IFNAMSIZ]; @@ -871,6 +872,15 @@ char *virNetDevGetName(int ifindex) cleanup: return ifname; } +#else +char *virNetDevGetName(int ifindex) +{ + virReportSystemError(ENOSYS, + _("Cannot get interface name for index '%i'"), + ifindex); + return NULL; +} +#endif /** * virNetDevGetIndex: --=20 2.12.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list