From nobody Fri Mar 29 12:30:35 2024 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 From nobody Fri Mar 29 12:30:35 2024 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 1490647333399461.1383109154058; Mon, 27 Mar 2017 13:42:13 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 028A722BA13; Mon, 27 Mar 2017 20:42: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 C6E3F183BB; Mon, 27 Mar 2017 20:42:11 +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 7572618523CD; Mon, 27 Mar 2017 20:42:11 +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 v2RKe5TA020107 for ; Mon, 27 Mar 2017 16:40:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5EF5818988; Mon, 27 Mar 2017 20:40:05 +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 CE68018991 for ; Mon, 27 Mar 2017 20:40:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 028A722BA13 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.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 028A722BA13 From: Martin Kletzander To: libvir-list@redhat.com Date: Mon, 27 Mar 2017 22:39:53 +0200 Message-Id: <452f014abf3c34cbba5ec4008ed3f49120a2d2cc.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 2/2] Build vircaps2xmltest and requirements only on Linux 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 27 Mar 2017 20:42:12 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The mock, as well as the test, is only available on Linux. So skip building it everywhere else, especially when it fails on mingw. Signed-off-by: Martin Kletzander --- tests/Makefile.am | 17 ++++++++++------- tests/vircaps2xmltest.c | 16 ++-------------- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 076734feda70..67cf497b8b27 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -192,7 +192,6 @@ test_programs =3D virshtest sockettest \ domaincapstest \ domainconftest \ virhostdevtest \ - vircaps2xmltest \ virnetdevtest \ virtypedparamtest \ $(NULL) @@ -206,7 +205,6 @@ test_libraries =3D libshunload.la \ virnetdevmock.la \ virrandommock.la \ virhostcpumock.la \ - virnumamock.la \ domaincapsmock.la \ $(NULL) @@ -225,8 +223,10 @@ endif WITH_REMOTE if WITH_LINUX test_programs +=3D fchosttest test_programs +=3D scsihosttest +test_programs +=3D vircaps2xmltest test_libraries +=3D virusbmock.la \ virnetdevbandwidthmock.la \ + virnumamock.la \ virtestmock.la \ $(NULL) endif WITH_LINUX @@ -941,11 +941,6 @@ vircapstest_SOURCES +=3D testutilsxen.c testutilsxen.h endif WITH_XEN vircapstest_LDADD =3D $(qemu_LDADDS) $(LDADDS) -vircaps2xmltest_SOURCES =3D \ - vircaps2xmltest.c testutils.h testutils.c -vircaps2xmltest_LDADD =3D $(LDADDS) - - domaincapsmock_la_SOURCES =3D domaincapsmock.c domaincapsmock_la_CFLAGS =3D $(AM_CFLAGS) domaincapsmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) @@ -1125,11 +1120,19 @@ virhostcpumock_la_CFLAGS =3D $(AM_CFLAGS) virhostcpumock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) virhostcpumock_la_LIBADD =3D $(MOCKLIBS_LIBS) +if WITH_LINUX +vircaps2xmltest_SOURCES =3D \ + vircaps2xmltest.c testutils.h testutils.c +vircaps2xmltest_LDADD =3D $(LDADDS) + virnumamock_la_SOURCES =3D \ virnumamock.c virnumamock_la_CFLAGS =3D $(AM_CFLAGS) virnumamock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) virnumamock_la_LIBADD =3D $(MOCKLIBS_LIBS) +else ! WITH_LINUX +EXTRA_DIST +=3D vircaps2xmltest.c virnumamock.c +endif ! WITH_LINUX if WITH_NSS nsstest_SOURCES =3D \ diff --git a/tests/vircaps2xmltest.c b/tests/vircaps2xmltest.c index 4dccd452cc82..ffbe9a783811 100644 --- a/tests/vircaps2xmltest.c +++ b/tests/vircaps2xmltest.c @@ -30,8 +30,6 @@ #define VIR_FROM_THIS VIR_FROM_NONE -#ifdef __linux__ - struct virCapabilitiesData { const char *filename; virArch arch; @@ -90,7 +88,7 @@ mymain(void) { int ret =3D 0; -# define DO_TEST_FULL(filename, arch, offlineMigrate, liveMigrate) \ +#define DO_TEST_FULL(filename, arch, offlineMigrate, liveMigrate) \ do { \ struct virCapabilitiesData data =3D {filename, arch, \ offlineMigrate, \ @@ -99,7 +97,7 @@ mymain(void) ret =3D -1; \ } while (0) -# define DO_TEST(filename, arch) DO_TEST_FULL(filename, arch, true, true) +#define DO_TEST(filename, arch) DO_TEST_FULL(filename, arch, true, true) DO_TEST_FULL("basic", VIR_ARCH_X86_64, false, false); DO_TEST_FULL("basic", VIR_ARCH_AARCH64, true, false); @@ -110,13 +108,3 @@ mymain(void) } VIRT_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virnumamock.so") - -#else /* !__linux__ */ - -int -main(void) -{ - return EXIT_AM_SKIP; -} - -#endif /* !__linux__ */ --=20 2.12.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list