From nobody Mon Feb 9 13:58:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1556110885; cv=none; d=zoho.com; s=zohoarc; b=k4zlmoC0VqhmIz8fEoJOSZAmih+X2t8Vo409VAxjJl8pCshQDf6quNszxZGmA56BXUqlwN/npPNrtlb8CSn6zvVn9+65A8YICtrze99jnLYs/yJBLDw3ZXiOkjb8IMTYRbOMc6Jjc59SYkODqz+65DRPuF4lJKhxt8y0EPerJhE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556110885; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Mi8E/WCwf90uQvVZ6ATWD/CCPIJtQpt/AGyuQY1cXQk=; b=LYxEDMr4twQXf4ZojtxEG3tOH6xPymqhMLEUcjDrT/wNlOUQHZ0bOXRZ7KRgsJnynU+Tam63lCW4bxeRfIalOpUO4JZrmQEY4LlvnK6JOdru3yFUV0rTgO4UXuq5xrPFM2bF+abktbMDD/3YZ4GNEaQ1sXNyZEmEKk9xuq3xRmM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1556110885111887.9421698562617; Wed, 24 Apr 2019 06:01:25 -0700 (PDT) Received: from localhost ([127.0.0.1]:41354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJHWW-0003eV-5K for importer@patchew.org; Wed, 24 Apr 2019 09:01:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJHUq-0002au-AQ for qemu-devel@nongnu.org; Wed, 24 Apr 2019 08:59:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJHUU-0000iI-S0 for qemu-devel@nongnu.org; Wed, 24 Apr 2019 08:59:27 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:54822 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hJHUU-0007nu-GJ for qemu-devel@nongnu.org; Wed, 24 Apr 2019 08:59:10 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id DB9681A413D; Wed, 24 Apr 2019 14:58:08 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 792171A23E6; Wed, 24 Apr 2019 14:58:08 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Wed, 24 Apr 2019 14:57:01 +0200 Message-Id: <1556110623-655-4-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556110623-655-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1556110623-655-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH v2 3/5] linux-user: Add support the SIOCSIFPFLAGS and SIOCGIFPFLAGS ioctls 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: lvivier@redhat.com, thuth@redhat.com, jcmvbkbc@gmail.com, arikalo@wavecomp.com, daniel.santos@pobox.com, amarkovic@wavecomp.com, Neng Chen , philmd@redhat.com, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Neng Chen Add support for setting and getting extended (private) flags of a network device via SIOCSIFPFLAGS and SIOCGIFPFLAGS ioctls. The ioctl numeric value is platform-independent and determined by the file include/uapi/linux/sockios.h in Linux kernel source code: #define SIOCSIFPFLAGS 0x8934 The ioctls set and get field ifr_flags of type short in the structure ifreq. Such functionality in QEMU is achieved using MK_STRUCT() and MK_PTR() macros with an appropriate argument. Signed-off-by: Neng Chen Signed-off-by: Aleksandar Markovic Message-Id: <1554839486-3527-1-git-send-email-aleksandar.markovic@rt-rk.com> --- linux-user/ioctls.h | 2 ++ linux-user/syscall_defs.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index c37adc5..76375df 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -206,6 +206,8 @@ IOCTL(SIOCADDMULTI, IOC_W, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq))) IOCTL(SIOCDELMULTI, IOC_W, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq))) IOCTL(SIOCGIFINDEX, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_int_ifreq))) + IOCTL(SIOCSIFPFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq))) + IOCTL(SIOCGIFPFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)= )) IOCTL(SIOCSIFLINK, 0, TYPE_NULL) IOCTL_SPECIAL(SIOCGIFCONF, IOC_W | IOC_R, do_ioctl_ifconf, MK_PTR(MK_STRUCT(STRUCT_ifconf))) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 2941231..8904d35 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -781,6 +781,8 @@ struct target_pollfd { #define TARGET_SIOCADDMULTI 0x8931 /* Multicast address lists = */ #define TARGET_SIOCDELMULTI 0x8932 #define TARGET_SIOCGIFINDEX 0x8933 +#define TARGET_SIOCSIFPFLAGS 0x8934 /* set extended flags = */ +#define TARGET_SIOCGIFPFLAGS 0x8935 /* get extended flags = */ =20 /* Bridging control calls */ #define TARGET_SIOCGIFBR 0x8940 /* Bridging support = */ --=20 2.7.4