[PATCH v4 7/7] linux-user: netlink: Use QEMU_IFA_XXX values instead of IFA_XXX

deller@kernel.org posted 7 patches 2 months, 2 weeks ago
[PATCH v4 7/7] linux-user: netlink: Use QEMU_IFA_XXX values instead of IFA_XXX
Posted by deller@kernel.org 2 months, 2 weeks ago
From: Helge Deller <deller@gmx.de>

Convert existing places to use QEMU_IFA_XXX values.

Signed-off-by: Helge Deller <deller@gmx.de>
---
 linux-user/fd-trans.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c
index 105b1f0713..f83d1f79d5 100644
--- a/linux-user/fd-trans.c
+++ b/linux-user/fd-trans.c
@@ -1192,21 +1192,21 @@ static abi_long host_to_target_data_addr_rtattr(struct rtattr *rtattr)
 
     switch (rtattr->rta_type) {
     /* binary: depends on family type */
-    case IFA_ADDRESS:
-    case IFA_LOCAL:
+    case QEMU_IFA_ADDRESS:
+    case QEMU_IFA_LOCAL:
     case QEMU_IFA_PROTO:
         break;
     /* string */
-    case IFA_LABEL:
+    case QEMU_IFA_LABEL:
         break;
     /* u32 */
-    case IFA_FLAGS:
-    case IFA_BROADCAST:
+    case QEMU_IFA_FLAGS:
+    case QEMU_IFA_BROADCAST:
         u32 = RTA_DATA(rtattr);
         *u32 = tswap32(*u32);
         break;
     /* struct ifa_cacheinfo */
-    case IFA_CACHEINFO:
+    case QEMU_IFA_CACHEINFO:
         ci = RTA_DATA(rtattr);
         ci->ifa_prefered = tswap32(ci->ifa_prefered);
         ci->ifa_valid = tswap32(ci->ifa_valid);
@@ -1501,8 +1501,8 @@ static abi_long target_to_host_data_addr_rtattr(struct rtattr *rtattr)
 {
     switch (rtattr->rta_type) {
     /* binary: depends on family type */
-    case IFA_LOCAL:
-    case IFA_ADDRESS:
+    case QEMU_IFA_LOCAL:
+    case QEMU_IFA_ADDRESS:
         break;
     default:
         qemu_log_mask(LOG_UNIMP, "Unknown target IFA type: %d\n",
-- 
2.47.0
Re: [PATCH v4 7/7] linux-user: netlink: Use QEMU_IFA_XXX values instead of IFA_XXX
Posted by Laurent Vivier 2 months, 1 week ago
Le 20/01/2025 à 22:33, deller@kernel.org a écrit :
> From: Helge Deller <deller@gmx.de>
> 
> Convert existing places to use QEMU_IFA_XXX values.
> 
> Signed-off-by: Helge Deller <deller@gmx.de>
> ---
>   linux-user/fd-trans.c | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c
> index 105b1f0713..f83d1f79d5 100644
> --- a/linux-user/fd-trans.c
> +++ b/linux-user/fd-trans.c
> @@ -1192,21 +1192,21 @@ static abi_long host_to_target_data_addr_rtattr(struct rtattr *rtattr)
>   
>       switch (rtattr->rta_type) {
>       /* binary: depends on family type */
> -    case IFA_ADDRESS:
> -    case IFA_LOCAL:
> +    case QEMU_IFA_ADDRESS:
> +    case QEMU_IFA_LOCAL:
>       case QEMU_IFA_PROTO:
>           break;
>       /* string */
> -    case IFA_LABEL:
> +    case QEMU_IFA_LABEL:
>           break;
>       /* u32 */
> -    case IFA_FLAGS:
> -    case IFA_BROADCAST:
> +    case QEMU_IFA_FLAGS:
> +    case QEMU_IFA_BROADCAST:
>           u32 = RTA_DATA(rtattr);
>           *u32 = tswap32(*u32);
>           break;
>       /* struct ifa_cacheinfo */
> -    case IFA_CACHEINFO:
> +    case QEMU_IFA_CACHEINFO:
>           ci = RTA_DATA(rtattr);
>           ci->ifa_prefered = tswap32(ci->ifa_prefered);
>           ci->ifa_valid = tswap32(ci->ifa_valid);
> @@ -1501,8 +1501,8 @@ static abi_long target_to_host_data_addr_rtattr(struct rtattr *rtattr)
>   {
>       switch (rtattr->rta_type) {
>       /* binary: depends on family type */
> -    case IFA_LOCAL:
> -    case IFA_ADDRESS:
> +    case QEMU_IFA_LOCAL:
> +    case QEMU_IFA_ADDRESS:
>           break;
>       default:
>           qemu_log_mask(LOG_UNIMP, "Unknown target IFA type: %d\n",

I would put this as patch one and adding the QEMU_IFA_XXX enum in this one.

Otherwise both patches (1 and 7) look good.

Thanks,
Laurent