From patchwork Wed Aug 17 13:49:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Privoznik X-Patchwork-Id: 9285995 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1847260574 for ; Wed, 17 Aug 2016 13:50:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 021DE298C2 for ; Wed, 17 Aug 2016 13:50:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA65A298CC; Wed, 17 Aug 2016 13:50:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UPPERCASE_50_75 autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D42A3298C2 for ; Wed, 17 Aug 2016 13:50:21 +0000 (UTC) Received: from localhost ([::1]:47621 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ba1Ea-0000Oz-QQ for patchwork-qemu-devel@patchwork.kernel.org; Wed, 17 Aug 2016 09:50:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ba1Dw-0000Kr-OR for qemu-devel@nongnu.org; Wed, 17 Aug 2016 09:49:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ba1Dp-0006hD-Jh for qemu-devel@nongnu.org; Wed, 17 Aug 2016 09:49:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57994) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ba1Dp-0006h0-Az for qemu-devel@nongnu.org; Wed, 17 Aug 2016 09:49:33 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D7A2961E52; Wed, 17 Aug 2016 13:49:32 +0000 (UTC) Received: from lisa.redhat.com (vpn-229-198.phx2.redhat.com [10.3.229.198]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7HDnSgW013571; Wed, 17 Aug 2016 09:49:31 -0400 From: Michal Privoznik To: qemu-devel@nongnu.org Date: Wed, 17 Aug 2016 15:49:24 +0200 Message-Id: <168d4ef241a8846aa5dc0cd64c20e3a2e512cbef.1471441656.git.mprivozn@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 17 Aug 2016 13:49:32 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/2] syscall.c: Redefine IFLA_* enums X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP In 9c37146782 I've tried to fix a broken build with older linux-headers. However, I didn't do it properly. The solution implemented here is to grab the enums that caused the problem initially, and rename their values so that they are "QEMU_" prefixed. In order to guarantee matching values with actual enums from linux-headers, the enums are seeded with starting values from the original enums. Signed-off-by: Michal Privoznik Reviewed-by: Laurent Vivier --- linux-user/syscall.c | 373 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 264 insertions(+), 109 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 7425968..908cd6b 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -289,6 +289,161 @@ static bitmask_transtbl fcntl_flags_tbl[] = { { 0, 0, 0, 0 } }; +enum { + QEMU_IFLA_BR_UNSPEC = IFLA_BR_UNSPEC, + QEMU_IFLA_BR_FORWARD_DELAY, + QEMU_IFLA_BR_HELLO_TIME, + QEMU_IFLA_BR_MAX_AGE, + QEMU_IFLA_BR_AGEING_TIME, + QEMU_IFLA_BR_STP_STATE, + QEMU_IFLA_BR_PRIORITY, + QEMU_IFLA_BR_VLAN_FILTERING, + QEMU_IFLA_BR_VLAN_PROTOCOL, + QEMU_IFLA_BR_GROUP_FWD_MASK, + QEMU_IFLA_BR_ROOT_ID, + QEMU_IFLA_BR_BRIDGE_ID, + QEMU_IFLA_BR_ROOT_PORT, + QEMU_IFLA_BR_ROOT_PATH_COST, + QEMU_IFLA_BR_TOPOLOGY_CHANGE, + QEMU_IFLA_BR_TOPOLOGY_CHANGE_DETECTED, + QEMU_IFLA_BR_HELLO_TIMER, + QEMU_IFLA_BR_TCN_TIMER, + QEMU_IFLA_BR_TOPOLOGY_CHANGE_TIMER, + QEMU_IFLA_BR_GC_TIMER, + QEMU_IFLA_BR_GROUP_ADDR, + QEMU_IFLA_BR_FDB_FLUSH, + QEMU_IFLA_BR_MCAST_ROUTER, + QEMU_IFLA_BR_MCAST_SNOOPING, + QEMU_IFLA_BR_MCAST_QUERY_USE_IFADDR, + QEMU_IFLA_BR_MCAST_QUERIER, + QEMU_IFLA_BR_MCAST_HASH_ELASTICITY, + QEMU_IFLA_BR_MCAST_HASH_MAX, + QEMU_IFLA_BR_MCAST_LAST_MEMBER_CNT, + QEMU_IFLA_BR_MCAST_STARTUP_QUERY_CNT, + QEMU_IFLA_BR_MCAST_LAST_MEMBER_INTVL, + QEMU_IFLA_BR_MCAST_MEMBERSHIP_INTVL, + QEMU_IFLA_BR_MCAST_QUERIER_INTVL, + QEMU_IFLA_BR_MCAST_QUERY_INTVL, + QEMU_IFLA_BR_MCAST_QUERY_RESPONSE_INTVL, + QEMU_IFLA_BR_MCAST_STARTUP_QUERY_INTVL, + QEMU_IFLA_BR_NF_CALL_IPTABLES, + QEMU_IFLA_BR_NF_CALL_IP6TABLES, + QEMU_IFLA_BR_NF_CALL_ARPTABLES, + QEMU_IFLA_BR_VLAN_DEFAULT_PVID, + QEMU_IFLA_BR_PAD, + QEMU_IFLA_BR_VLAN_STATS_ENABLED, + QEMU_IFLA_BR_MCAST_STATS_ENABLED, + QEMU___IFLA_BR_MAX, +}; + +enum { + QEMU_IFLA_UNSPEC = IFLA_UNSPEC, + QEMU_IFLA_ADDRESS, + QEMU_IFLA_BROADCAST, + QEMU_IFLA_IFNAME, + QEMU_IFLA_MTU, + QEMU_IFLA_LINK, + QEMU_IFLA_QDISC, + QEMU_IFLA_STATS, + QEMU_IFLA_COST, + QEMU_IFLA_PRIORITY, + QEMU_IFLA_MASTER, + QEMU_IFLA_WIRELESS, + QEMU_IFLA_PROTINFO, + QEMU_IFLA_TXQLEN, + QEMU_IFLA_MAP, + QEMU_IFLA_WEIGHT, + QEMU_IFLA_OPERSTATE, + QEMU_IFLA_LINKMODE, + QEMU_IFLA_LINKINFO, + QEMU_IFLA_NET_NS_PID, + QEMU_IFLA_IFALIAS, + QEMU_IFLA_NUM_VF, + QEMU_IFLA_VFINFO_LIST, + QEMU_IFLA_STATS64, + QEMU_IFLA_VF_PORTS, + QEMU_IFLA_PORT_SELF, + QEMU_IFLA_AF_SPEC, + QEMU_IFLA_GROUP, + QEMU_IFLA_NET_NS_FD, + QEMU_IFLA_EXT_MASK, + QEMU_IFLA_PROMISCUITY, + QEMU_IFLA_NUM_TX_QUEUES, + QEMU_IFLA_NUM_RX_QUEUES, + QEMU_IFLA_CARRIER, + QEMU_IFLA_PHYS_PORT_ID, + QEMU_IFLA_CARRIER_CHANGES, + QEMU_IFLA_PHYS_SWITCH_ID, + QEMU_IFLA_LINK_NETNSID, + QEMU_IFLA_PHYS_PORT_NAME, + QEMU_IFLA_PROTO_DOWN, + QEMU_IFLA_GSO_MAX_SEGS, + QEMU_IFLA_GSO_MAX_SIZE, + QEMU_IFLA_PAD, + QEMU_IFLA_XDP, + QEMU___IFLA_MAX +}; + +enum { + QEMU_IFLA_BRPORT_UNSPEC = IFLA_BRPORT_UNSPEC, + QEMU_IFLA_BRPORT_STATE, + QEMU_IFLA_BRPORT_PRIORITY, + QEMU_IFLA_BRPORT_COST, + QEMU_IFLA_BRPORT_MODE, + QEMU_IFLA_BRPORT_GUARD, + QEMU_IFLA_BRPORT_PROTECT, + QEMU_IFLA_BRPORT_FAST_LEAVE, + QEMU_IFLA_BRPORT_LEARNING, + QEMU_IFLA_BRPORT_UNICAST_FLOOD, + QEMU_IFLA_BRPORT_PROXYARP, + QEMU_IFLA_BRPORT_LEARNING_SYNC, + QEMU_IFLA_BRPORT_PROXYARP_WIFI, + QEMU_IFLA_BRPORT_ROOT_ID, + QEMU_IFLA_BRPORT_BRIDGE_ID, + QEMU_IFLA_BRPORT_DESIGNATED_PORT, + QEMU_IFLA_BRPORT_DESIGNATED_COST, + QEMU_IFLA_BRPORT_ID, + QEMU_IFLA_BRPORT_NO, + QEMU_IFLA_BRPORT_TOPOLOGY_CHANGE_ACK, + QEMU_IFLA_BRPORT_CONFIG_PENDING, + QEMU_IFLA_BRPORT_MESSAGE_AGE_TIMER, + QEMU_IFLA_BRPORT_FORWARD_DELAY_TIMER, + QEMU_IFLA_BRPORT_HOLD_TIMER, + QEMU_IFLA_BRPORT_FLUSH, + QEMU_IFLA_BRPORT_MULTICAST_ROUTER, + QEMU_IFLA_BRPORT_PAD, + QEMU___IFLA_BRPORT_MAX +}; + +enum { + QEMU_IFLA_INFO_UNSPEC = IFLA_INFO_UNSPEC, + QEMU_IFLA_INFO_KIND, + QEMU_IFLA_INFO_DATA, + QEMU_IFLA_INFO_XSTATS, + QEMU_IFLA_INFO_SLAVE_KIND, + QEMU_IFLA_INFO_SLAVE_DATA, + QEMU___IFLA_INFO_MAX, +}; + +enum { + QEMU_IFLA_INET_UNSPEC = IFLA_INET_UNSPEC, + QEMU_IFLA_INET_CONF, + QEMU___IFLA_INET_MAX, +}; + +enum { + QEMU_IFLA_INET6_UNSPEC = IFLA_INET6_UNSPEC, + QEMU_IFLA_INET6_FLAGS, + QEMU_IFLA_INET6_CONF, + QEMU_IFLA_INET6_STATS, + QEMU_IFLA_INET6_MCAST, + QEMU_IFLA_INET6_CACHEINFO, + QEMU_IFLA_INET6_ICMP6STATS, + QEMU_IFLA_INET6_TOKEN, + QEMU_IFLA_INET6_ADDR_GEN_MODE, + QEMU___IFLA_INET6_MAX +}; + typedef abi_long (*TargetFdDataFunc)(void *, size_t); typedef abi_long (*TargetFdAddrFunc)(void *, abi_ulong, socklen_t); typedef struct TargetFdTrans { @@ -1784,66 +1939,66 @@ static abi_long host_to_target_data_bridge_nlattr(struct nlattr *nlattr, switch (nlattr->nla_type) { /* no data */ - case IFLA_BR_FDB_FLUSH: + case QEMU_IFLA_BR_FDB_FLUSH: break; /* binary */ - case IFLA_BR_GROUP_ADDR: + case QEMU_IFLA_BR_GROUP_ADDR: break; /* uint8_t */ - case IFLA_BR_VLAN_FILTERING: - case IFLA_BR_TOPOLOGY_CHANGE: - case IFLA_BR_TOPOLOGY_CHANGE_DETECTED: - case IFLA_BR_MCAST_ROUTER: - case IFLA_BR_MCAST_SNOOPING: - case IFLA_BR_MCAST_QUERY_USE_IFADDR: - case IFLA_BR_MCAST_QUERIER: - case IFLA_BR_NF_CALL_IPTABLES: - case IFLA_BR_NF_CALL_IP6TABLES: - case IFLA_BR_NF_CALL_ARPTABLES: + case QEMU_IFLA_BR_VLAN_FILTERING: + case QEMU_IFLA_BR_TOPOLOGY_CHANGE: + case QEMU_IFLA_BR_TOPOLOGY_CHANGE_DETECTED: + case QEMU_IFLA_BR_MCAST_ROUTER: + case QEMU_IFLA_BR_MCAST_SNOOPING: + case QEMU_IFLA_BR_MCAST_QUERY_USE_IFADDR: + case QEMU_IFLA_BR_MCAST_QUERIER: + case QEMU_IFLA_BR_NF_CALL_IPTABLES: + case QEMU_IFLA_BR_NF_CALL_IP6TABLES: + case QEMU_IFLA_BR_NF_CALL_ARPTABLES: break; /* uint16_t */ - case IFLA_BR_PRIORITY: - case IFLA_BR_VLAN_PROTOCOL: - case IFLA_BR_GROUP_FWD_MASK: - case IFLA_BR_ROOT_PORT: - case IFLA_BR_VLAN_DEFAULT_PVID: + case QEMU_IFLA_BR_PRIORITY: + case QEMU_IFLA_BR_VLAN_PROTOCOL: + case QEMU_IFLA_BR_GROUP_FWD_MASK: + case QEMU_IFLA_BR_ROOT_PORT: + case QEMU_IFLA_BR_VLAN_DEFAULT_PVID: u16 = NLA_DATA(nlattr); *u16 = tswap16(*u16); break; /* uint32_t */ - case IFLA_BR_FORWARD_DELAY: - case IFLA_BR_HELLO_TIME: - case IFLA_BR_MAX_AGE: - case IFLA_BR_AGEING_TIME: - case IFLA_BR_STP_STATE: - case IFLA_BR_ROOT_PATH_COST: - case IFLA_BR_MCAST_HASH_ELASTICITY: - case IFLA_BR_MCAST_HASH_MAX: - case IFLA_BR_MCAST_LAST_MEMBER_CNT: - case IFLA_BR_MCAST_STARTUP_QUERY_CNT: + case QEMU_IFLA_BR_FORWARD_DELAY: + case QEMU_IFLA_BR_HELLO_TIME: + case QEMU_IFLA_BR_MAX_AGE: + case QEMU_IFLA_BR_AGEING_TIME: + case QEMU_IFLA_BR_STP_STATE: + case QEMU_IFLA_BR_ROOT_PATH_COST: + case QEMU_IFLA_BR_MCAST_HASH_ELASTICITY: + case QEMU_IFLA_BR_MCAST_HASH_MAX: + case QEMU_IFLA_BR_MCAST_LAST_MEMBER_CNT: + case QEMU_IFLA_BR_MCAST_STARTUP_QUERY_CNT: u32 = NLA_DATA(nlattr); *u32 = tswap32(*u32); break; /* uint64_t */ - case IFLA_BR_HELLO_TIMER: - case IFLA_BR_TCN_TIMER: - case IFLA_BR_GC_TIMER: - case IFLA_BR_TOPOLOGY_CHANGE_TIMER: - case IFLA_BR_MCAST_LAST_MEMBER_INTVL: - case IFLA_BR_MCAST_MEMBERSHIP_INTVL: - case IFLA_BR_MCAST_QUERIER_INTVL: - case IFLA_BR_MCAST_QUERY_INTVL: - case IFLA_BR_MCAST_QUERY_RESPONSE_INTVL: - case IFLA_BR_MCAST_STARTUP_QUERY_INTVL: + case QEMU_IFLA_BR_HELLO_TIMER: + case QEMU_IFLA_BR_TCN_TIMER: + case QEMU_IFLA_BR_GC_TIMER: + case QEMU_IFLA_BR_TOPOLOGY_CHANGE_TIMER: + case QEMU_IFLA_BR_MCAST_LAST_MEMBER_INTVL: + case QEMU_IFLA_BR_MCAST_MEMBERSHIP_INTVL: + case QEMU_IFLA_BR_MCAST_QUERIER_INTVL: + case QEMU_IFLA_BR_MCAST_QUERY_INTVL: + case QEMU_IFLA_BR_MCAST_QUERY_RESPONSE_INTVL: + case QEMU_IFLA_BR_MCAST_STARTUP_QUERY_INTVL: u64 = NLA_DATA(nlattr); *u64 = tswap64(*u64); break; /* ifla_bridge_id: uin8_t[] */ - case IFLA_BR_ROOT_ID: - case IFLA_BR_BRIDGE_ID: + case QEMU_IFLA_BR_ROOT_ID: + case QEMU_IFLA_BR_BRIDGE_ID: break; default: - gemu_log("Unknown IFLA_BR type %d\n", nlattr->nla_type); + gemu_log("Unknown QEMU_IFLA_BR type %d\n", nlattr->nla_type); break; } return 0; @@ -1858,47 +2013,47 @@ static abi_long host_to_target_slave_data_bridge_nlattr(struct nlattr *nlattr, switch (nlattr->nla_type) { /* uint8_t */ - case IFLA_BRPORT_STATE: - case IFLA_BRPORT_MODE: - case IFLA_BRPORT_GUARD: - case IFLA_BRPORT_PROTECT: - case IFLA_BRPORT_FAST_LEAVE: - case IFLA_BRPORT_LEARNING: - case IFLA_BRPORT_UNICAST_FLOOD: - case IFLA_BRPORT_PROXYARP: - case IFLA_BRPORT_LEARNING_SYNC: - case IFLA_BRPORT_PROXYARP_WIFI: - case IFLA_BRPORT_TOPOLOGY_CHANGE_ACK: - case IFLA_BRPORT_CONFIG_PENDING: - case IFLA_BRPORT_MULTICAST_ROUTER: + case QEMU_IFLA_BRPORT_STATE: + case QEMU_IFLA_BRPORT_MODE: + case QEMU_IFLA_BRPORT_GUARD: + case QEMU_IFLA_BRPORT_PROTECT: + case QEMU_IFLA_BRPORT_FAST_LEAVE: + case QEMU_IFLA_BRPORT_LEARNING: + case QEMU_IFLA_BRPORT_UNICAST_FLOOD: + case QEMU_IFLA_BRPORT_PROXYARP: + case QEMU_IFLA_BRPORT_LEARNING_SYNC: + case QEMU_IFLA_BRPORT_PROXYARP_WIFI: + case QEMU_IFLA_BRPORT_TOPOLOGY_CHANGE_ACK: + case QEMU_IFLA_BRPORT_CONFIG_PENDING: + case QEMU_IFLA_BRPORT_MULTICAST_ROUTER: break; /* uint16_t */ - case IFLA_BRPORT_PRIORITY: - case IFLA_BRPORT_DESIGNATED_PORT: - case IFLA_BRPORT_DESIGNATED_COST: - case IFLA_BRPORT_ID: - case IFLA_BRPORT_NO: + case QEMU_IFLA_BRPORT_PRIORITY: + case QEMU_IFLA_BRPORT_DESIGNATED_PORT: + case QEMU_IFLA_BRPORT_DESIGNATED_COST: + case QEMU_IFLA_BRPORT_ID: + case QEMU_IFLA_BRPORT_NO: u16 = NLA_DATA(nlattr); *u16 = tswap16(*u16); break; /* uin32_t */ - case IFLA_BRPORT_COST: + case QEMU_IFLA_BRPORT_COST: u32 = NLA_DATA(nlattr); *u32 = tswap32(*u32); break; /* uint64_t */ - case IFLA_BRPORT_MESSAGE_AGE_TIMER: - case IFLA_BRPORT_FORWARD_DELAY_TIMER: - case IFLA_BRPORT_HOLD_TIMER: + case QEMU_IFLA_BRPORT_MESSAGE_AGE_TIMER: + case QEMU_IFLA_BRPORT_FORWARD_DELAY_TIMER: + case QEMU_IFLA_BRPORT_HOLD_TIMER: u64 = NLA_DATA(nlattr); *u64 = tswap64(*u64); break; /* ifla_bridge_id: uint8_t[] */ - case IFLA_BRPORT_ROOT_ID: - case IFLA_BRPORT_BRIDGE_ID: + case QEMU_IFLA_BRPORT_ROOT_ID: + case QEMU_IFLA_BRPORT_BRIDGE_ID: break; default: - gemu_log("Unknown IFLA_BRPORT type %d\n", nlattr->nla_type); + gemu_log("Unknown QEMU_IFLA_BRPORT type %d\n", nlattr->nla_type); break; } return 0; @@ -1918,20 +2073,20 @@ static abi_long host_to_target_data_linkinfo_nlattr(struct nlattr *nlattr, switch (nlattr->nla_type) { /* string */ - case IFLA_INFO_KIND: + case QEMU_IFLA_INFO_KIND: li_context->name = NLA_DATA(nlattr); li_context->len = nlattr->nla_len - NLA_HDRLEN; break; - case IFLA_INFO_SLAVE_KIND: + case QEMU_IFLA_INFO_SLAVE_KIND: li_context->slave_name = NLA_DATA(nlattr); li_context->slave_len = nlattr->nla_len - NLA_HDRLEN; break; /* stats */ - case IFLA_INFO_XSTATS: + case QEMU_IFLA_INFO_XSTATS: /* FIXME: only used by CAN */ break; /* nested */ - case IFLA_INFO_DATA: + case QEMU_IFLA_INFO_DATA: if (strncmp(li_context->name, "bridge", li_context->len) == 0) { return host_to_target_for_each_nlattr(NLA_DATA(nlattr), @@ -1939,10 +2094,10 @@ static abi_long host_to_target_data_linkinfo_nlattr(struct nlattr *nlattr, NULL, host_to_target_data_bridge_nlattr); } else { - gemu_log("Unknown IFLA_INFO_KIND %s\n", li_context->name); + gemu_log("Unknown QEMU_IFLA_INFO_KIND %s\n", li_context->name); } break; - case IFLA_INFO_SLAVE_DATA: + case QEMU_IFLA_INFO_SLAVE_DATA: if (strncmp(li_context->slave_name, "bridge", li_context->slave_len) == 0) { return host_to_target_for_each_nlattr(NLA_DATA(nlattr), @@ -1950,12 +2105,12 @@ static abi_long host_to_target_data_linkinfo_nlattr(struct nlattr *nlattr, NULL, host_to_target_slave_data_bridge_nlattr); } else { - gemu_log("Unknown IFLA_INFO_SLAVE_KIND %s\n", + gemu_log("Unknown QEMU_IFLA_INFO_SLAVE_KIND %s\n", li_context->slave_name); } break; default: - gemu_log("Unknown host IFLA_INFO type: %d\n", nlattr->nla_type); + gemu_log("Unknown host QEMU_IFLA_INFO type: %d\n", nlattr->nla_type); break; } @@ -1969,7 +2124,7 @@ static abi_long host_to_target_data_inet_nlattr(struct nlattr *nlattr, int i; switch (nlattr->nla_type) { - case IFLA_INET_CONF: + case QEMU_IFLA_INET_CONF: u32 = NLA_DATA(nlattr); for (i = 0; i < (nlattr->nla_len - NLA_HDRLEN) / sizeof(*u32); i++) { @@ -1992,18 +2147,18 @@ static abi_long host_to_target_data_inet6_nlattr(struct nlattr *nlattr, switch (nlattr->nla_type) { /* binaries */ - case IFLA_INET6_TOKEN: + case QEMU_IFLA_INET6_TOKEN: break; /* uint8_t */ - case IFLA_INET6_ADDR_GEN_MODE: + case QEMU_IFLA_INET6_ADDR_GEN_MODE: break; /* uint32_t */ - case IFLA_INET6_FLAGS: + case QEMU_IFLA_INET6_FLAGS: u32 = NLA_DATA(nlattr); *u32 = tswap32(*u32); break; /* uint32_t[] */ - case IFLA_INET6_CONF: + case QEMU_IFLA_INET6_CONF: u32 = NLA_DATA(nlattr); for (i = 0; i < (nlattr->nla_len - NLA_HDRLEN) / sizeof(*u32); i++) { @@ -2011,7 +2166,7 @@ static abi_long host_to_target_data_inet6_nlattr(struct nlattr *nlattr, } break; /* ifla_cacheinfo */ - case IFLA_INET6_CACHEINFO: + case QEMU_IFLA_INET6_CACHEINFO: ci = NLA_DATA(nlattr); ci->max_reasm_len = tswap32(ci->max_reasm_len); ci->tstamp = tswap32(ci->tstamp); @@ -2019,8 +2174,8 @@ static abi_long host_to_target_data_inet6_nlattr(struct nlattr *nlattr, ci->retrans_time = tswap32(ci->retrans_time); break; /* uint64_t[] */ - case IFLA_INET6_STATS: - case IFLA_INET6_ICMP6STATS: + case QEMU_IFLA_INET6_STATS: + case QEMU_IFLA_INET6_ICMP6STATS: u64 = NLA_DATA(nlattr); for (i = 0; i < (nlattr->nla_len - NLA_HDRLEN) / sizeof(*u64); i++) { @@ -2062,37 +2217,37 @@ static abi_long host_to_target_data_link_rtattr(struct rtattr *rtattr) switch (rtattr->rta_type) { /* binary stream */ - case IFLA_ADDRESS: - case IFLA_BROADCAST: + case QEMU_IFLA_ADDRESS: + case QEMU_IFLA_BROADCAST: /* string */ - case IFLA_IFNAME: - case IFLA_QDISC: + case QEMU_IFLA_IFNAME: + case QEMU_IFLA_QDISC: break; /* uin8_t */ - case IFLA_OPERSTATE: - case IFLA_LINKMODE: - case IFLA_CARRIER: - case IFLA_PROTO_DOWN: + case QEMU_IFLA_OPERSTATE: + case QEMU_IFLA_LINKMODE: + case QEMU_IFLA_CARRIER: + case QEMU_IFLA_PROTO_DOWN: break; /* uint32_t */ - case IFLA_MTU: - case IFLA_LINK: - case IFLA_WEIGHT: - case IFLA_TXQLEN: - case IFLA_CARRIER_CHANGES: - case IFLA_NUM_RX_QUEUES: - case IFLA_NUM_TX_QUEUES: - case IFLA_PROMISCUITY: - case IFLA_EXT_MASK: - case IFLA_LINK_NETNSID: - case IFLA_GROUP: - case IFLA_MASTER: - case IFLA_NUM_VF: + case QEMU_IFLA_MTU: + case QEMU_IFLA_LINK: + case QEMU_IFLA_WEIGHT: + case QEMU_IFLA_TXQLEN: + case QEMU_IFLA_CARRIER_CHANGES: + case QEMU_IFLA_NUM_RX_QUEUES: + case QEMU_IFLA_NUM_TX_QUEUES: + case QEMU_IFLA_PROMISCUITY: + case QEMU_IFLA_EXT_MASK: + case QEMU_IFLA_LINK_NETNSID: + case QEMU_IFLA_GROUP: + case QEMU_IFLA_MASTER: + case QEMU_IFLA_NUM_VF: u32 = RTA_DATA(rtattr); *u32 = tswap32(*u32); break; /* struct rtnl_link_stats */ - case IFLA_STATS: + case QEMU_IFLA_STATS: st = RTA_DATA(rtattr); st->rx_packets = tswap32(st->rx_packets); st->tx_packets = tswap32(st->tx_packets); @@ -2125,7 +2280,7 @@ static abi_long host_to_target_data_link_rtattr(struct rtattr *rtattr) st->tx_compressed = tswap32(st->tx_compressed); break; /* struct rtnl_link_stats64 */ - case IFLA_STATS64: + case QEMU_IFLA_STATS64: st64 = RTA_DATA(rtattr); st64->rx_packets = tswap64(st64->rx_packets); st64->tx_packets = tswap64(st64->tx_packets); @@ -2158,7 +2313,7 @@ static abi_long host_to_target_data_link_rtattr(struct rtattr *rtattr) st64->tx_compressed = tswap64(st64->tx_compressed); break; /* struct rtnl_link_ifmap */ - case IFLA_MAP: + case QEMU_IFLA_MAP: map = RTA_DATA(rtattr); map->mem_start = tswap64(map->mem_start); map->mem_end = tswap64(map->mem_end); @@ -2166,17 +2321,17 @@ static abi_long host_to_target_data_link_rtattr(struct rtattr *rtattr) map->irq = tswap16(map->irq); break; /* nested */ - case IFLA_LINKINFO: + case QEMU_IFLA_LINKINFO: memset(&li_context, 0, sizeof(li_context)); return host_to_target_for_each_nlattr(RTA_DATA(rtattr), rtattr->rta_len, &li_context, host_to_target_data_linkinfo_nlattr); - case IFLA_AF_SPEC: + case QEMU_IFLA_AF_SPEC: return host_to_target_for_each_nlattr(RTA_DATA(rtattr), rtattr->rta_len, NULL, host_to_target_data_spec_nlattr); default: - gemu_log("Unknown host IFLA type: %d\n", rtattr->rta_type); + gemu_log("Unknown host QEMU_IFLA type: %d\n", rtattr->rta_type); break; } return 0; @@ -2343,7 +2498,7 @@ static abi_long target_to_host_data_link_rtattr(struct rtattr *rtattr) { switch (rtattr->rta_type) { default: - gemu_log("Unknown target IFLA type: %d\n", rtattr->rta_type); + gemu_log("Unknown target QEMU_IFLA type: %d\n", rtattr->rta_type); break; } return 0;