From patchwork Tue Sep 10 16:35:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1160487 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46SW8409w3z9sNf for ; Wed, 11 Sep 2019 02:44:04 +1000 (AEST) Received: from localhost ([::1]:43154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7jFJ-00042F-AH for incoming@patchwork.ozlabs.org; Tue, 10 Sep 2019 12:44:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53392) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7j85-0004tJ-04 for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7j83-0002Gu-VU for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:32 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:59871) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7j83-0002GU-Mt for qemu-devel@nongnu.org; Tue, 10 Sep 2019 12:36:31 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MuDLZ-1iPxOx41KH-00uXui; Tue, 10 Sep 2019 18:36:19 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2019 18:35:58 +0200 Message-Id: <20190910163600.19971-14-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190910163600.19971-1-laurent@vivier.eu> References: <20190910163600.19971-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:7qgUg+r2PreMjPeylXr3/hm5lIOx0wzUU6m4vf3hYTDBv5XZR5w l8hPg709p8ShakQ88AxFXbBOgr79r9NWhKflz+gKceELbd1LOkqaTSfrbTiy3NGoJZJ7qLD JvGG2s5yy7kGDfZRQsohxvFfMcQSIL47df3nZ6r/B7cS5lj5Gxo+dfqLvQiJ2K9RNTxcOie Wj1fJzow5X3tLkEvP5NyQ== X-UI-Out-Filterresults: notjunk:1; V03:K0:4EE97/bQTxE=:v7bq8KfBkigv07lY2vMXIx EShrgXZ4kWOglB5rytzhxOeGOOpJQBibKyp/pwUZZHY64T4VgmrX9ljJ6QTlmdV8RJKVSxCVv owvIVASw5VmGcVL00PiqRzdQIs7WOWynQ4dbKrtGYXEoeFx2KX1mch9AcVCPx9fVu9C8hiVmg BT/trd9o8KrRCdsZHNRnyiq4iSK+d47HEKg/Fp3aQTex2p4T9LZ1n0LQEyNDipud2H+wQWPML fGGBTQxqZ6lnMVadCzZTAtlPc9tmBs2f4vihnTzT+Iuic5XJXqcHQTpkDGUxUPO3nKqWExDJC LYA5RaBrK4EfAYJC7ZC69ybkQW9Y5Ru3PPM9JWieRn+/66MFSaKNc1NeXxYt3QqECwUTdqmTs alUqPF3kI1Zwf/eVSe5wfvQT9crOLzvE5MR0D6Ynw3AJ0inT9RWiEOxPPtMX/VV9ETLCdfV32 kb/NL+Uais5bPHSToxFelgjZXYGN8d5tAzVejTc55oNNC52YeHBsuMwx5NWVy1uFyR6BvVKkC wR17qcyRAA5o03Pa8oV2M4Y7kTI7rj8tbemPbMpAE+iP2QR2zlevKyv2JTeotCHTJRLBT2k1A VG5Amq/D58rtETNMrYR64YNhOq08tc672L9CsiH8luJx09fD3Ti9MAad7+1YHb0mhNU3/3C8X UZXLEpGevSgzinVfzrhEQRG17gUMRgAuWEARWqzzKkE01Lo2rg7HRqp299gUqp+2O98MPnoyG AJQRY0F0C46RK3VUt05FZyvZMUG4um3upCdYW/vUT+/5AQd/3LVTBoncqNbQCplipxP4YnPXV G4yLRE96cYwuyw8S3EErsYK+aexWwQSitlvSVjyQ9P2KsKivS8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.135 Subject: [Qemu-devel] [PULL 13/15] linux-user: Add support for FDFLUSH ioctl X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Riku Voipio , Yunqiang Su , Laurent Vivier , Aleksandar Markovic Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Yunqiang Su FDFLUSH is used for flushing buffers of floppy drives. Support in QEMU is needed because some of Debian packages use this ioctl while running post-build tests. One such example is 'tar' package. Signed-off-by: Yunqiang Su Signed-off-by: Aleksandar Markovic Reviewed-by: Laurent Vivier Message-Id: <1567601968-26946-5-git-send-email-aleksandar.markovic@rt-rk.com> Signed-off-by: Laurent Vivier --- linux-user/ioctls.h | 2 ++ linux-user/syscall.c | 1 + linux-user/syscall_defs.h | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 1830de96e12b..bc1944804220 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -112,6 +112,8 @@ IOCTL(BLKZEROOUT, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2))) #endif + IOCTL(FDFLUSH, 0, TYPE_NULL) + #ifdef FIBMAP IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG)) #endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 6928f654ced3..e2af3c1494fa 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -89,6 +89,7 @@ #include #include #include +#include #if defined(CONFIG_FIEMAP) #include #endif diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 498223b77787..917202a2035d 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -888,6 +888,10 @@ struct target_pollfd { #define TARGET_BLKROTATIONAL TARGET_IO(0x12, 126) #define TARGET_BLKZEROOUT TARGET_IO(0x12, 127) +/* From */ + +#define TARGET_FDFLUSH TARGET_IO(2, 0x4b) + #define TARGET_FIBMAP TARGET_IO(0x00,1) /* bmap access */ #define TARGET_FIGETBSZ TARGET_IO(0x00,2) /* get the block size used for bmap */