From patchwork Tue Jul 19 12:54:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 72313 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp75083qga; Tue, 19 Jul 2016 06:17:15 -0700 (PDT) X-Received: by 10.55.21.97 with SMTP id f94mr51634437qkh.8.1468933810765; Tue, 19 Jul 2016 06:10:10 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id z68si19523868qka.194.2016.07.19.06.10.10 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 19 Jul 2016 06:10:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:55765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPUmo-0007Y5-6G for patch@linaro.org; Tue, 19 Jul 2016 09:10:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPUXj-0007fH-1P for qemu-devel@nongnu.org; Tue, 19 Jul 2016 08:54:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPUXh-0003PC-UO for qemu-devel@nongnu.org; Tue, 19 Jul 2016 08:54:35 -0400 Received: from mail-lf0-x230.google.com ([2a00:1450:4010:c07::230]:33690) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPUXh-0003P5-6v for qemu-devel@nongnu.org; Tue, 19 Jul 2016 08:54:33 -0400 Received: by mail-lf0-x230.google.com with SMTP id b199so13474298lfe.0 for ; Tue, 19 Jul 2016 05:54:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/wSUVsT/hIHfqefH/vM7mnuXnJpAaHBVXsZyXuT2O/g=; b=UGUl3FGX867CO7v1D9PZQJRPsKUI8gNMhEdwzMRvCVIncc9ipYXDI55lhxb/oV+4Wn FFFOjpJMlvm+d6dR6kAHkIbtPnakeXJYujoNE5EIp5iG8QRLaGL3P3RLNHdGcqbsy1D/ XH0/sPixO+vFQjDcnpPKSWnyXsKFbFEw5cck4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/wSUVsT/hIHfqefH/vM7mnuXnJpAaHBVXsZyXuT2O/g=; b=JaLhvMo9JYpJnBrHtlbGqIhzl495OiL6M7rz0/j9ru0pfbOnQaiWyUSkcmAt+5ISjM YWV55vhYz/lyUSBJe/D3pJCfuKn6/ctJ5p5XdWLOBBdEOk2WA3TZ0aEzjsnFHP8KrTB4 RymfDNBmEMCQnpCLFW6k6+uakb9bBpUvFbVOFevKi70Ohb+GoVfdWmoLVhPxokjXEtKm urjnrAmSnN7SNpL2enRqgAkdYvPjPC28PSFEwOC6QbJG6JekNodBXv0ocZv/NN/BaW2C brTydetf25+gOJrkjMJAxlTwZoa90J98/KSwErRilJBD5YMegEcqOmB4XUZ9Zmt426Ad kIrQ== X-Gm-Message-State: ALyK8tK2UAYFaoa7HkSSo2gXI0T3xx3BEEQjMXE38Xq6CTi1NUN1xGXu9OCD7EFuAWI/c+Rz X-Received: by 10.25.209.195 with SMTP id i186mr19113207lfg.230.1468932872141; Tue, 19 Jul 2016 05:54:32 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id g3sm2248898lfe.14.2016.07.19.05.54.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jul 2016 05:54:30 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 19 Jul 2016 15:54:10 +0300 Message-Id: <4715856a68b3bf868aca05f34f8f9edde64d7d6f.1468932683.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::230 Subject: [Qemu-devel] [PULL 12/16] linux-user: Add some new blk 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Add some new blk ioctls (these are 0x12,119 through to 0x12,127). Several of these are used by mke2fs; this silences the warnings: mke2fs 1.42.12 (29-Aug-2014) Unsupported ioctl: cmd=0x127b Unsupported ioctl: cmd=0x127a warning: Unable to get device geometry for /dev/loop5 Unsupported ioctl: cmd=0x127c Unsupported ioctl: cmd=0x127c Unsupported ioctl: cmd=0x1277 Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/ioctls.h | 29 +++++++++++++++++++++++++++++ linux-user/syscall_defs.h | 11 +++++++++++ 2 files changed, 40 insertions(+) -- 2.1.4 diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 33ede9c..4b36baa 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -80,6 +80,35 @@ IOCTL(BLKBSZGET, IOC_R, MK_PTR(TYPE_INT)) IOCTL_SPECIAL(BLKPG, IOC_W, do_ioctl_blkpg, MK_PTR(MK_STRUCT(STRUCT_blkpg_ioctl_arg))) + +#ifdef BLKDISCARD + IOCTL(BLKDISCARD, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2))) +#endif +#ifdef BLKIOMIN + IOCTL(BLKIOMIN, IOC_R, MK_PTR(TYPE_INT)) +#endif +#ifdef BLKIOOPT + IOCTL(BLKIOOPT, IOC_R, MK_PTR(TYPE_INT)) +#endif +#ifdef BLKALIGNOFF + IOCTL(BLKALIGNOFF, IOC_R, MK_PTR(TYPE_INT)) +#endif +#ifdef BLKPBSZGET + IOCTL(BLKPBSZGET, IOC_R, MK_PTR(TYPE_INT)) +#endif +#ifdef BLKDISCARDZEROES + IOCTL(BLKDISCARDZEROES, IOC_R, MK_PTR(TYPE_INT)) +#endif +#ifdef BLKSECDISCARD + IOCTL(BLKSECDISCARD, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2))) +#endif +#ifdef BLKROTATIONAL + IOCTL(BLKROTATIONAL, IOC_R, MK_PTR(TYPE_SHORT)) +#endif +#ifdef BLKZEROOUT + IOCTL(BLKZEROOUT, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2))) +#endif + #ifdef FIBMAP IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG)) #endif diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 096f91c..7835654 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -985,6 +985,17 @@ struct target_pollfd { #define TARGET_BLKGETSIZE64 TARGET_IOR(0x12,114,abi_ulong) /* return device size in bytes (u64 *arg) */ + +#define TARGET_BLKDISCARD TARGET_IO(0x12, 119) +#define TARGET_BLKIOMIN TARGET_IO(0x12, 120) +#define TARGET_BLKIOOPT TARGET_IO(0x12, 121) +#define TARGET_BLKALIGNOFF TARGET_IO(0x12, 122) +#define TARGET_BLKPBSZGET TARGET_IO(0x12, 123) +#define TARGET_BLKDISCARDZEROES TARGET_IO(0x12, 124) +#define TARGET_BLKSECDISCARD TARGET_IO(0x12, 125) +#define TARGET_BLKROTATIONAL TARGET_IO(0x12, 126) +#define TARGET_BLKZEROOUT TARGET_IO(0x12, 127) + #define TARGET_FIBMAP TARGET_IO(0x00,1) /* bmap access */ #define TARGET_FIGETBSZ TARGET_IO(0x00,2) /* get the block size used for bmap */ #define TARGET_FS_IOC_FIEMAP TARGET_IOWR('f',11,struct fiemap)