From nobody Fri Dec 19 04:15:30 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1741782489; cv=none; d=zohomail.com; s=zohoarc; b=gB13XpP6fh7q4Q8WPNWUlBJM5F80GssQ8tquIcRNxsEs3VDtqHFk23A5aU7CHaFGMn/Oq3HNSo4ZO58RK1YIDrL58IWzetPyemNR8mCQO6s6c7k6buij+uLPgHYyI1fOFMv2JGz6h5WD5PKZOGAnrSo+/EBDWI4lVdPoVPcv0dM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741782489; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=kQ/R8u8saROZC5QW+PNtpKPX+o+eZbxVzMePQUxDalI=; b=H4M6Fx41hml/cGQMSp43BaBlWcKbxfMceqRv+EYyFFZd2ZiV356F9mQdTMoBrCfBEGNlqYkTGlxvofGcsZsiqJZS/Lh3M8lwtAOsCLOw+9Or+IhUxf/QPoJGJPOooyF31tSsytCexOxZIDn/CCP74JUTEJRvzciCW42paDtiY7A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1741782489334241.34922228370908; Wed, 12 Mar 2025 05:28:09 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id A44FE1DC0; Wed, 12 Mar 2025 08:28:08 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id E5B8C1DB6; Wed, 12 Mar 2025 08:26:44 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 0316B1375; Wed, 12 Mar 2025 08:26:40 -0400 (EDT) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 760D017EA for ; Wed, 12 Mar 2025 08:26:31 -0400 (EDT) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-223a7065ff8so34566765ad.0 for ; Wed, 12 Mar 2025 05:26:31 -0700 (PDT) Received: from localhost ([157.82.205.237]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-3011824d0fdsm1608810a91.29.2025.03.12.05.26.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Mar 2025 05:26:30 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1741782390; x=1742387190; darn=lists.libvirt.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=kQ/R8u8saROZC5QW+PNtpKPX+o+eZbxVzMePQUxDalI=; b=rMJwbI8xpPntDAbctKcpxjWrrigodGJctdhlqqv70tLpfL56AaYkSYkpVRm756k7is /+h7qdY7mTx9t56jvSgmjUvOZgHNOcchGM1MypDaW9JJWhMhCmWMg05smZY15J8OBscu v97vmqTQuwE8hY7fuEVjzoRxzBUBYNBBW5wDhpfW+7WrTOkdrOzhMuseNgfLPxjvt5WL v93VKLor0AKNhrprYv+50PhoZEpGmmkG259MWgmYqaylKhcxoLYIF7pGpggHlmpar7FQ a8Zw/R05tV5riHQji0N5+b2YChhMkhl9VpGrB0nMv2Hw7CYMBUqJyAnbV5UPDM9/Gexb G7AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741782390; x=1742387190; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kQ/R8u8saROZC5QW+PNtpKPX+o+eZbxVzMePQUxDalI=; b=lX84P+RhX1j/mhbW6BNoBzbxvW2lhH7XyfKvlE/tqTINpz9iyhtf+/dSMBBzgNd/AU KuWPwDMzqdaN7o5Oqs3iTdko+yP8HIS3AvsrAuHq4cVp/NsWaxP74MDgsc/3JHhNKKou 65hWoZDhqJAwtrmVxafQdC0rY6m5qM/nWF1SEsnEGtmdNZknGcB+EHNbxpKD2wSJ/C3i xbR/Lz0mjhTjynuNCg0iLrJ408CbZZw/648hn0s5Ql9Ysh6YsyTmN9fPYoxqPnuDJNPm JG95aYMAXhTztg4gyhkI+10UBK+a4LKxxIWT+7VKucIndW84jIXf2LofprZcw97YlImn pZJA== X-Forwarded-Encrypted: i=1; AJvYcCXuXrl85tSwNVenpUHEHed1HxddA+GL49KqrPlIYeb89Dm8dM6P1ymq2HCGIaa2+inRBa1EKQ==@lists.libvirt.org X-Gm-Message-State: AOJu0Yx4ttoDJZxL0WxfjEohaVc2gB18mQ4Pj1y23Fk4fz2EZ0CwiRGs iBzyGYkxSsay11XbpyWkb4kKAwFWEOK0maAGO65X9AUX+44CLG/0bYgovpeV0rC+Ij7vqMKs97I J/gA= X-Gm-Gg: ASbGncuiyiQk+ik8iyvPI5wXIf2g2L+JHr1WUM0acWavnQIPDteCcySKcgJxVxl3xal +haYti/nZ6lORXCLGAShiJhCyju9q44oQHkAgKK+qnPdcRhqy8/XyQafwGvwZC9GtvJNHbCiR55 yQU9TsGWcZ/Z4RdGdClmPHhw/CcJndS45jatLLR+ZBVvv40Ek49CGZzMxbfV44RB1tycKSTYbaV lRAxc4TP0RnDikifbxXya4lfUxpMjp+tqu1MOXodOEVLOqkBP9L/XttsBwe68++jAK828Lywp2O 3JJtU6bokx/+rbovbFvvlOp4+uDSmV7IeZ9Wr7kjZyxbidUQ X-Google-Smtp-Source: AGHT+IFhEOYsKoHPobFdfViUX+C4OMSPIezoGol5yw02zOW+CEThRStrpcNhZdPLLV2eLOnpPpVt3w== X-Received: by 2002:a17:903:189:b0:21f:564:80a4 with SMTP id d9443c01a7336-22428ab796fmr266948635ad.33.1741782390373; Wed, 12 Mar 2025 05:26:30 -0700 (PDT) From: Akihiko Odaki Date: Wed, 12 Mar 2025 21:26:20 +0900 Subject: [PATCH 2/2] virnetlink: Remove stub functions MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250312-linux-v1-2-e5531bbe9708@daynix.com> References: <20250312-linux-v1-0-e5531bbe9708@daynix.com> In-Reply-To: <20250312-linux-v1-0-e5531bbe9708@daynix.com> To: Laine Stump , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , devel@lists.libvirt.org X-Mailer: b4 0.15-dev-edae6 Message-ID-Hash: T2LRUGCPUVETEMMUO3CUHYY2CC7J4XPP X-Message-ID-Hash: T2LRUGCPUVETEMMUO3CUHYY2CC7J4XPP X-MailFrom: akihiko.odaki@daynix.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 CC: devel@daynix.com, Akihiko Odaki X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1741782491355019000 virnetlink provides stub functions when libnl is not available, but this approach caused a few problems: - Commit 582f0966f9b9e2148d8887d072364e2a91aed000 broke builds without libnl for Linux because virNetlinkBridgeVlanFilterSet() lacked a stub. - A call to virNetlinkEventServiceStopAll() stub in src/remote/remote_daemon.c resulted in extra debug logs. Instead of providing stub functions, let callers check the availability of libnl. Callers are also replaced with stub functions in most cases so this approach requires less code and less error-prone. Signed-off-by: Akihiko Odaki --- src/libvirt_libnl.syms | 23 ++++++ src/libvirt_private.syms | 19 ----- src/meson.build | 6 ++ src/remote/remote_daemon.c | 10 ++- src/util/meson.build | 5 +- src/util/virarptable.c | 2 +- src/util/virnetlink.c | 196 +++--------------------------------------= ---- src/util/virnetlink.h | 11 +-- 8 files changed, 55 insertions(+), 217 deletions(-) diff --git a/src/libvirt_libnl.syms b/src/libvirt_libnl.syms new file mode 100644 index 0000000000..091169416b --- /dev/null +++ b/src/libvirt_libnl.syms @@ -0,0 +1,23 @@ +# util/virnetlink.h +virNetlinkCommand; +virNetlinkDelLink; +virNetlinkDumpCommand; +virNetlinkDumpLink; +virNetlinkEventAddClient; +virNetlinkEventRemoveClient; +virNetlinkEventServiceIsRunning; +virNetlinkEventServiceLocalPid; +virNetlinkEventServiceStart; +virNetlinkEventServiceStop; +virNetlinkEventServiceStopAll; +virNetlinkGetErrorCode; +virNetlinkGetNeighbor; +virNetlinkNewLink; +virNetlinkShutdown; +virNetlinkStartup; + + +# Let emacs know we want case-insensitive sorting +# Local Variables: +# sort-fold-case: t +# End: diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 30a9f806f0..0ce20291df 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3022,25 +3022,6 @@ virNetDevVPortProfileOpTypeFromString; virNetDevVPortProfileOpTypeToString; =20 =20 -# util/virnetlink.h -virNetlinkCommand; -virNetlinkDelLink; -virNetlinkDumpCommand; -virNetlinkDumpLink; -virNetlinkEventAddClient; -virNetlinkEventRemoveClient; -virNetlinkEventServiceIsRunning; -virNetlinkEventServiceLocalPid; -virNetlinkEventServiceStart; -virNetlinkEventServiceStop; -virNetlinkEventServiceStopAll; -virNetlinkGetErrorCode; -virNetlinkGetNeighbor; -virNetlinkNewLink; -virNetlinkShutdown; -virNetlinkStartup; - - # util/virnodesuspend.h virNodeSuspend; virNodeSuspendGetTargetMask; diff --git a/src/meson.build b/src/meson.build index 9413192a55..989d3113d9 100644 --- a/src/meson.build +++ b/src/meson.build @@ -131,6 +131,12 @@ else sym_files +=3D 'libvirt_hyperv.syms' endif =20 +if conf.has('WITH_LIBNL') + used_sym_files +=3D 'libvirt_libnl.syms' +else + sym_files +=3D 'libvirt_libnl.syms' +endif + # variables filled by subdirectories =20 libvirt_libs =3D [] diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c index d90355c0d2..f62dc0a837 100644 --- a/src/remote/remote_daemon.c +++ b/src/remote/remote_daemon.c @@ -1021,10 +1021,12 @@ int main(int argc, char **argv) { } umask(old_umask); =20 +#ifdef WITH_LIBNL if (virNetlinkStartup() < 0) { ret =3D VIR_DAEMON_ERR_INIT; goto cleanup; } +#endif =20 if (!(dmn =3D virNetDaemonNew())) { ret =3D VIR_DAEMON_ERR_DRIVER; @@ -1188,7 +1190,7 @@ int main(int argc, char **argv) { goto cleanup; } =20 -#if defined(__linux__) && defined(NETLINK_ROUTE) +#if defined(WITH_LIBNL) && defined(NETLINK_ROUTE) /* Register the netlink event service for NETLINK_ROUTE */ if (virNetlinkEventServiceStart(NETLINK_ROUTE, 0) < 0) { ret =3D VIR_DAEMON_ERR_NETWORK; @@ -1196,7 +1198,7 @@ int main(int argc, char **argv) { } #endif =20 -#if defined(__linux__) && defined(NETLINK_KOBJECT_UEVENT) +#if defined(WITH_LIBNL) && defined(NETLINK_KOBJECT_UEVENT) /* Register the netlink event service for NETLINK_KOBJECT_UEVENT */ if (virNetlinkEventServiceStart(NETLINK_KOBJECT_UEVENT, 1) < 0) { ret =3D VIR_DAEMON_ERR_NETWORK; @@ -1213,7 +1215,9 @@ int main(int argc, char **argv) { 0, "shutdown", NULL, NULL); =20 cleanup: +#ifdef WITH_LIBNL virNetlinkEventServiceStopAll(); +#endif =20 if (g_atomic_int_compare_and_exchange(&driversInitialized, 1, 0)) { /* NB: Possible issue with timing window between driversInitialized @@ -1229,7 +1233,9 @@ int main(int argc, char **argv) { virObjectUnref(srv); virObjectUnref(dmn); =20 +#ifdef WITH_LIBNL virNetlinkShutdown(); +#endif =20 if (pid_file_fd !=3D -1) virPidFileReleasePath(pid_file, pid_file_fd); diff --git a/src/util/meson.build b/src/util/meson.build index 69ef49139a..992b0441c9 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -69,7 +69,6 @@ util_sources =3D [ 'virnetdevveth.c', 'virnetdevvlan.c', 'virnetdevvportprofile.c', - 'virnetlink.c', 'virnodesuspend.c', 'virnuma.c', 'virnvme.c', @@ -112,6 +111,10 @@ util_sources =3D [ 'virxml.c', ] =20 +if conf.has('WITH_LIBNL') + util_sources +=3D 'virnetlink.c' +endif + util_public_sources =3D files( 'virerror.c', 'virevent.c', diff --git a/src/util/virarptable.c b/src/util/virarptable.c index 20d11f97b0..9c132ea0b6 100644 --- a/src/util/virarptable.c +++ b/src/util/virarptable.c @@ -35,7 +35,7 @@ =20 VIR_LOG_INIT("util.arptable"); =20 -#ifdef __linux__ +#ifdef WITH_LIBNL =20 # define NDA_RTA(r) \ ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg)))) diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c index 206646d9d7..d944bdbce1 100644 --- a/src/util/virnetlink.c +++ b/src/util/virnetlink.c @@ -37,11 +37,9 @@ VIR_LOG_INIT("util.netlink"); =20 #define NETLINK_ACK_TIMEOUT_S (2*1000) =20 -#if defined(WITH_LIBNL) +#include =20 -# include - -# define NETLINK_MSG_NEST_START(msg, container, attrtype) \ +#define NETLINK_MSG_NEST_START(msg, container, attrtype) \ do { \ container =3D nla_nest_start(msg, attrtype); \ if (!container) { \ @@ -51,7 +49,7 @@ do { \ } \ } while (0) =20 -# define NETLINK_MSG_NEST_END(msg, container) \ +#define NETLINK_MSG_NEST_END(msg, container) \ do { nla_nest_end(msg, container); } while (0) =20 /* @@ -59,7 +57,7 @@ do { nla_nest_end(msg, container); } while (0) * complain about @data not being a pointer type: * error: the address of 'foo' will always evaluate as 'true' [-Werror=3Da= ddress] */ -# define NETLINK_MSG_PUT(msg, attrtype, datalen, data) \ +#define NETLINK_MSG_PUT(msg, attrtype, datalen, data) \ do { \ const void *dataptr =3D data; \ if (dataptr && nla_put(msg, attrtype, datalen, dataptr) < 0) { \ @@ -69,7 +67,7 @@ do { \ } \ } while (0) =20 -# define NETLINK_MSG_APPEND(msg, datalen, dataptr) \ +#define NETLINK_MSG_APPEND(msg, datalen, dataptr) \ do { \ if (nlmsg_append(msg, dataptr, datalen, NLMSG_ALIGNTO) < 0) { \ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", \ @@ -89,9 +87,9 @@ struct virNetlinkEventHandle { int deleted; }; =20 -# define virNetlinkAlloc nl_socket_alloc -# define virNetlinkSetBufferSize nl_socket_set_buffer_size -# define virNetlinkFree nl_socket_free +#define virNetlinkAlloc nl_socket_alloc +#define virNetlinkSetBufferSize nl_socket_set_buffer_size +#define virNetlinkFree nl_socket_free typedef struct nl_sock virNetlinkHandle; =20 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetlinkHandle, virNetlinkFree); @@ -120,7 +118,7 @@ static int nextWatch =3D 1; =20 /* Allocate extra slots for virEventPollHandle/virEventPollTimeout records in this multiple */ -# define NETLINK_EVENT_ALLOC_EXTENT 10 +#define NETLINK_EVENT_ALLOC_EXTENT 10 =20 /* Linux kernel supports up to MAX_LINKS (32 at the time) individual * netlink protocols. */ @@ -519,7 +517,7 @@ virNetlinkDumpLink(const char *ifname, int ifindex, if (ifname) NETLINK_MSG_PUT(nl_msg, IFLA_IFNAME, (strlen(ifname) + 1), ifname); =20 -# ifdef RTEXT_FILTER_VF +#ifdef RTEXT_FILTER_VF /* if this filter exists in the kernel's netlink implementation, * we need to set it, otherwise the response message will not * contain the IFLA_VFINFO_LIST that we're looking for. @@ -530,7 +528,7 @@ virNetlinkDumpLink(const char *ifname, int ifindex, NETLINK_MSG_PUT(nl_msg, IFLA_EXT_MASK, sizeof(ifla_ext_mask), &ifla_ext_mask); } -# endif +#endif =20 if (virNetlinkTalk(ifname, nl_msg, src_pid, dst_pid, &resp, &resp_len, &error, NULL) < 0) { @@ -1264,175 +1262,3 @@ virNetlinkEventRemoveClient(int watch, const virMac= Addr *macaddr, =20 return -1; } - -#else - -# if defined(__linux__) -static const char *unsupported =3D N_("libnl was not available at build ti= me"); -# else -static const char *unsupported =3D N_("not supported on non-linux platform= s"); -# endif - -int -virNetlinkStartup(void) -{ - return 0; -} - -void -virNetlinkShutdown(void) -{ - return; -} - -int virNetlinkCommand(struct nl_msg *nl_msg G_GNUC_UNUSED, - struct nlmsghdr **resp G_GNUC_UNUSED, - unsigned int *respbuflen G_GNUC_UNUSED, - uint32_t src_pid G_GNUC_UNUSED, - uint32_t dst_pid G_GNUC_UNUSED, - unsigned int protocol G_GNUC_UNUSED, - unsigned int groups G_GNUC_UNUSED) -{ - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported)); - return -1; -} - -int -virNetlinkDumpCommand(struct nl_msg *nl_msg G_GNUC_UNUSED, - virNetlinkDumpCallback callback G_GNUC_UNUSED, - uint32_t src_pid G_GNUC_UNUSED, - uint32_t dst_pid G_GNUC_UNUSED, - unsigned int protocol G_GNUC_UNUSED, - unsigned int groups G_GNUC_UNUSED, - void *opaque G_GNUC_UNUSED) -{ - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported)); - return -1; -} - -int -virNetlinkDumpLink(const char *ifname G_GNUC_UNUSED, - int ifindex G_GNUC_UNUSED, - void **nlData G_GNUC_UNUSED, - struct nlattr **tb G_GNUC_UNUSED, - uint32_t src_pid G_GNUC_UNUSED, - uint32_t dst_pid G_GNUC_UNUSED) -{ - virReportSystemError(ENOSYS, "%s", - _("Unable to dump link info on this platform")); - return -1; -} - - -int -virNetlinkDelLink(const char *ifname G_GNUC_UNUSED, - virNetlinkTalkFallback fallback G_GNUC_UNUSED) -{ - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported)); - return -1; -} - - -int -virNetlinkNewLink(const char *ifname G_GNUC_UNUSED, - const char *type G_GNUC_UNUSED, - virNetlinkNewLinkData *extra_args G_GNUC_UNUSED, - int *error G_GNUC_UNUSED) -{ - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported)); - return -1; -} - - -int -virNetlinkGetNeighbor(void **nlData G_GNUC_UNUSED, - uint32_t src_pid G_GNUC_UNUSED, - uint32_t dst_pid G_GNUC_UNUSED) -{ - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported)); - return -1; -} - - -/** - * stopNetlinkEventServer: stop the monitor to receive netlink - * messages for libvirtd - */ -int virNetlinkEventServiceStop(unsigned int protocol G_GNUC_UNUSED) -{ - VIR_DEBUG("%s", unsupported); - return 0; -} - -/** - * stopNetlinkEventServerAll: stop all the monitors to receive netlink - * messages for libvirtd - */ -int virNetlinkEventServiceStopAll(void) -{ - VIR_DEBUG("%s", unsupported); - return 0; -} - -/** - * startNetlinkEventServer: start a monitor to receive netlink - * messages for libvirtd - */ -int virNetlinkEventServiceStart(unsigned int protocol G_GNUC_UNUSED, - unsigned int groups G_GNUC_UNUSED) -{ - VIR_DEBUG("%s", unsupported); - return 0; -} - -/** - * virNetlinkEventServiceIsRunning: returns if the netlink event - * service is running. - */ -bool virNetlinkEventServiceIsRunning(unsigned int protocol G_GNUC_UNUSED) -{ - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported)); - return false; -} - -int virNetlinkEventServiceLocalPid(unsigned int protocol G_GNUC_UNUSED) -{ - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported)); - return -1; -} - -/** - * virNetlinkEventAddClient: register a callback for handling of - * netlink messages - */ -int virNetlinkEventAddClient(virNetlinkEventHandleCallback handleCB G_GNUC= _UNUSED, - virNetlinkEventRemoveCallback removeCB G_GNUC= _UNUSED, - void *opaque G_GNUC_UNUSED, - const virMacAddr *macaddr G_GNUC_UNUSED, - unsigned int protocol G_GNUC_UNUSED) -{ - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported)); - return -1; -} - -/** - * virNetlinkEventRemoveClient: unregister a callback from a netlink monit= or - */ -int virNetlinkEventRemoveClient(int watch G_GNUC_UNUSED, - const virMacAddr *macaddr G_GNUC_UNUSED, - unsigned int protocol G_GNUC_UNUSED) -{ - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported)); - return -1; -} - - -int -virNetlinkGetErrorCode(struct nlmsghdr *resp G_GNUC_UNUSED, - unsigned int recvbuflen G_GNUC_UNUSED) -{ - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported)); - return -EINVAL; -} - -#endif /* WITH_LIBNL */ diff --git a/src/util/virnetlink.h b/src/util/virnetlink.h index 327fb426a1..1a1bdebaed 100644 --- a/src/util/virnetlink.h +++ b/src/util/virnetlink.h @@ -34,15 +34,6 @@ struct nl_msg * virNetlinkMsgNew(int nlmsgtype, int nlmsgflags); =20 -#else - -struct nl_msg; -struct sockaddr_nl; -struct nlattr; -struct nlmsghdr; - -#endif /* WITH_LIBNL */ - int virNetlinkStartup(void); void virNetlinkShutdown(void); =20 @@ -140,3 +131,5 @@ int virNetlinkEventAddClient(virNetlinkEventHandleCallb= ack handleCB, */ int virNetlinkEventRemoveClient(int watch, const virMacAddr *macaddr, unsigned int protocol); + +#endif /* WITH_LIBNL */ --=20 2.48.1