aboutsummaryrefslogtreecommitdiff
path: root/linux-user/fd-trans.c
diff options
context:
space:
mode:
authorJosh Kunz <jkz@google.com>2020-02-03 18:54:13 -0800
committerLaurent Vivier <laurent@vivier.eu>2020-02-19 11:17:40 +0100
commit39be535008f120452d3bda2a50798774a5f1f963 (patch)
tree68d2f8f211e24c608601f454e7d91ebfb864e3f6 /linux-user/fd-trans.c
parente10ee3f567c098929217458fb47a5a2d147331bd (diff)
linux-user: Use `qemu_log' for non-strace logging
Since most calls to `gemu_log` are actually logging unimplemented features, this change replaces most non-strace calls to `gemu_log` with calls to `qemu_log_mask(LOG_UNIMP, ...)`. This allows the user to easily log to a file, and to mask out these log messages if they desire. Note: This change is slightly backwards incompatible, since now these "unimplemented" log messages will not be logged by default. Signed-off-by: Josh Kunz <jkz@google.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20200204025416.111409-2-jkz@google.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user/fd-trans.c')
-rw-r--r--linux-user/fd-trans.c55
1 files changed, 35 insertions, 20 deletions
diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c
index 9b92386abf..c0687c52e6 100644
--- a/linux-user/fd-trans.c
+++ b/linux-user/fd-trans.c
@@ -514,7 +514,8 @@ static abi_long host_to_target_data_bridge_nlattr(struct nlattr *nlattr,
u32[1] = tswap32(u32[1]); /* optmask */
break;
default:
- gemu_log("Unknown QEMU_IFLA_BR type %d\n", nlattr->nla_type);
+ qemu_log_mask(LOG_UNIMP, "Unknown QEMU_IFLA_BR type %d\n",
+ nlattr->nla_type);
break;
}
return 0;
@@ -577,7 +578,8 @@ static abi_long host_to_target_slave_data_bridge_nlattr(struct nlattr *nlattr,
case QEMU_IFLA_BRPORT_BRIDGE_ID:
break;
default:
- gemu_log("Unknown QEMU_IFLA_BRPORT type %d\n", nlattr->nla_type);
+ qemu_log_mask(LOG_UNIMP, "Unknown QEMU_IFLA_BRPORT type %d\n",
+ nlattr->nla_type);
break;
}
return 0;
@@ -605,7 +607,8 @@ static abi_long host_to_target_data_tun_nlattr(struct nlattr *nlattr,
*u32 = tswap32(*u32);
break;
default:
- gemu_log("Unknown QEMU_IFLA_TUN type %d\n", nlattr->nla_type);
+ qemu_log_mask(LOG_UNIMP, "Unknown QEMU_IFLA_TUN type %d\n",
+ nlattr->nla_type);
break;
}
return 0;
@@ -652,7 +655,8 @@ static abi_long host_to_target_data_linkinfo_nlattr(struct nlattr *nlattr,
NULL,
host_to_target_data_tun_nlattr);
} else {
- gemu_log("Unknown QEMU_IFLA_INFO_KIND %s\n", li_context->name);
+ qemu_log_mask(LOG_UNIMP, "Unknown QEMU_IFLA_INFO_KIND %s\n",
+ li_context->name);
}
break;
case QEMU_IFLA_INFO_SLAVE_DATA:
@@ -663,12 +667,13 @@ static abi_long host_to_target_data_linkinfo_nlattr(struct nlattr *nlattr,
NULL,
host_to_target_slave_data_bridge_nlattr);
} else {
- gemu_log("Unknown QEMU_IFLA_INFO_SLAVE_KIND %s\n",
+ qemu_log_mask(LOG_UNIMP, "Unknown QEMU_IFLA_INFO_SLAVE_KIND %s\n",
li_context->slave_name);
}
break;
default:
- gemu_log("Unknown host QEMU_IFLA_INFO type: %d\n", nlattr->nla_type);
+ qemu_log_mask(LOG_UNIMP, "Unknown host QEMU_IFLA_INFO type: %d\n",
+ nlattr->nla_type);
break;
}
@@ -690,7 +695,8 @@ static abi_long host_to_target_data_inet_nlattr(struct nlattr *nlattr,
}
break;
default:
- gemu_log("Unknown host AF_INET type: %d\n", nlattr->nla_type);
+ qemu_log_mask(LOG_UNIMP, "Unknown host AF_INET type: %d\n",
+ nlattr->nla_type);
}
return 0;
}
@@ -741,7 +747,8 @@ static abi_long host_to_target_data_inet6_nlattr(struct nlattr *nlattr,
}
break;
default:
- gemu_log("Unknown host AF_INET6 type: %d\n", nlattr->nla_type);
+ qemu_log_mask(LOG_UNIMP, "Unknown host AF_INET6 type: %d\n",
+ nlattr->nla_type);
}
return 0;
}
@@ -759,7 +766,8 @@ static abi_long host_to_target_data_spec_nlattr(struct nlattr *nlattr,
NULL,
host_to_target_data_inet6_nlattr);
default:
- gemu_log("Unknown host AF_SPEC type: %d\n", nlattr->nla_type);
+ qemu_log_mask(LOG_UNIMP, "Unknown host AF_SPEC type: %d\n",
+ nlattr->nla_type);
break;
}
return 0;
@@ -780,7 +788,8 @@ static abi_long host_to_target_data_xdp_nlattr(struct nlattr *nlattr,
*u32 = tswap32(*u32);
break;
default:
- gemu_log("Unknown host XDP type: %d\n", nlattr->nla_type);
+ qemu_log_mask(
+ LOG_UNIMP, "Unknown host XDP type: %d\n", nlattr->nla_type);
break;
}
return 0;
@@ -920,7 +929,8 @@ static abi_long host_to_target_data_link_rtattr(struct rtattr *rtattr)
NULL,
host_to_target_data_xdp_nlattr);
default:
- gemu_log("Unknown host QEMU_IFLA type: %d\n", rtattr->rta_type);
+ qemu_log_mask(LOG_UNIMP, "Unknown host QEMU_IFLA type: %d\n",
+ rtattr->rta_type);
break;
}
return 0;
@@ -954,7 +964,8 @@ static abi_long host_to_target_data_addr_rtattr(struct rtattr *rtattr)
ci->tstamp = tswap32(ci->tstamp);
break;
default:
- gemu_log("Unknown host IFA type: %d\n", rtattr->rta_type);
+ qemu_log_mask(
+ LOG_UNIMP, "Unknown host IFA type: %d\n", rtattr->rta_type);
break;
}
return 0;
@@ -996,7 +1007,8 @@ static abi_long host_to_target_data_route_rtattr(struct rtattr *rtattr)
#endif
break;
default:
- gemu_log("Unknown host RTA type: %d\n", rtattr->rta_type);
+ qemu_log_mask(
+ LOG_UNIMP, "Unknown host RTA type: %d\n", rtattr->rta_type);
break;
}
return 0;
@@ -1111,7 +1123,8 @@ static abi_long target_to_host_data_link_rtattr(struct rtattr *rtattr)
{
switch (rtattr->rta_type) {
default:
- gemu_log("Unknown target QEMU_IFLA type: %d\n", rtattr->rta_type);
+ qemu_log_mask(LOG_UNIMP, "Unknown target QEMU_IFLA type: %d\n",
+ rtattr->rta_type);
break;
}
return 0;
@@ -1125,7 +1138,8 @@ static abi_long target_to_host_data_addr_rtattr(struct rtattr *rtattr)
case IFA_ADDRESS:
break;
default:
- gemu_log("Unknown target IFA type: %d\n", rtattr->rta_type);
+ qemu_log_mask(LOG_UNIMP, "Unknown target IFA type: %d\n",
+ rtattr->rta_type);
break;
}
return 0;
@@ -1147,7 +1161,8 @@ static abi_long target_to_host_data_route_rtattr(struct rtattr *rtattr)
*u32 = tswap32(*u32);
break;
default:
- gemu_log("Unknown target RTA type: %d\n", rtattr->rta_type);
+ qemu_log_mask(LOG_UNIMP, "Unknown target RTA type: %d\n",
+ rtattr->rta_type);
break;
}
return 0;
@@ -1232,8 +1247,8 @@ static abi_long host_to_target_data_audit(struct nlmsghdr *nlh)
{
switch (nlh->nlmsg_type) {
default:
- gemu_log("Unknown host audit message type %d\n",
- nlh->nlmsg_type);
+ qemu_log_mask(LOG_UNIMP, "Unknown host audit message type %d\n",
+ nlh->nlmsg_type);
return -TARGET_EINVAL;
}
return 0;
@@ -1253,8 +1268,8 @@ static abi_long target_to_host_data_audit(struct nlmsghdr *nlh)
case AUDIT_FIRST_USER_MSG2 ... AUDIT_LAST_USER_MSG2:
break;
default:
- gemu_log("Unknown target audit message type %d\n",
- nlh->nlmsg_type);
+ qemu_log_mask(LOG_UNIMP, "Unknown target audit message type %d\n",
+ nlh->nlmsg_type);
return -TARGET_EINVAL;
}