From patchwork Mon Jul 4 16:06:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 9212943 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CCE5760572 for ; Mon, 4 Jul 2016 16:24:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE79B2873D for ; Mon, 4 Jul 2016 16:24:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B366228743; Mon, 4 Jul 2016 16:24:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3375828742 for ; Mon, 4 Jul 2016 16:24:57 +0000 (UTC) Received: from localhost ([::1]:49071 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK6g4-00020B-BT for patchwork-qemu-devel@patchwork.kernel.org; Mon, 04 Jul 2016 12:24:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK6fa-0001yE-P4 for qemu-devel@nongnu.org; Mon, 04 Jul 2016 12:24:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bK6fZ-0005sm-PG for qemu-devel@nongnu.org; Mon, 04 Jul 2016 12:24:26 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:58095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK6fZ-0005sX-H1 for qemu-devel@nongnu.org; Mon, 04 Jul 2016 12:24:25 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1bK6O3-0001H4-FF; Mon, 04 Jul 2016 17:06:19 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 4 Jul 2016 17:06:17 +0100 Message-Id: <1467648378-26630-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467648378-26630-1-git-send-email-peter.maydell@linaro.org> References: <1467648378-26630-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH 1/2] linux-user: Add loop control 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: Chanho Park , Riku Voipio , Chanho Park , patches@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add support for the /dev/loop-control ioctls: LOOP_CTL_ADD LOOP_CTL_REMOVE LOOP_CTL_GET_FREE Signed-off-by: Peter Maydell Reviewed-by: Laurent Vivier --- linux-user/ioctls.h | 4 ++++ linux-user/linux_loop.h | 11 ++++++++++- linux-user/syscall_defs.h | 4 ++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 804f099..72cd32a 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -356,6 +356,10 @@ IOCTL(LOOP_GET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64))) IOCTL(LOOP_CHANGE_FD, 0, TYPE_INT) + IOCTL(LOOP_CTL_ADD, 0, TYPE_INT) + IOCTL(LOOP_CTL_REMOVE, 0, TYPE_INT) + IOCTL(LOOP_CTL_GET_FREE, 0, TYPE_NULL) + IOCTL(MTIOCTOP, IOC_W, MK_PTR(MK_STRUCT(STRUCT_mtop))) IOCTL(MTIOCGET, IOC_R, MK_PTR(MK_STRUCT(STRUCT_mtget))) IOCTL(MTIOCPOS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_mtpos))) diff --git a/linux-user/linux_loop.h b/linux-user/linux_loop.h index 8974caa..fd7608b 100644 --- a/linux-user/linux_loop.h +++ b/linux-user/linux_loop.h @@ -1,4 +1,6 @@ -/* Copied from 2.6.25 kernel headers to avoid problems on older hosts. */ +/* Copied from 2.6.25 kernel headers to avoid problems on older hosts, + * and subsequently updated to match newer additions to the API. + */ #ifndef _LINUX_LOOP_H #define _LINUX_LOOP_H @@ -91,5 +93,12 @@ struct loop_info64 { #define LOOP_SET_STATUS64 0x4C04 #define LOOP_GET_STATUS64 0x4C05 #define LOOP_CHANGE_FD 0x4C06 +#define LOOP_SET_CAPACITY 0x4C07 +#define LOOP_SET_DIRECT_IO 0x4C08 + +/* /dev/loop-control interface */ +#define LOOP_CTL_ADD 0x4C80 +#define LOOP_CTL_REMOVE 0x4C81 +#define LOOP_CTL_GET_FREE 0x4C82 #endif diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 6650e26..0591abc 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -1129,6 +1129,10 @@ struct target_pollfd { #define TARGET_LOOP_GET_STATUS64 0x4C05 #define TARGET_LOOP_CHANGE_FD 0x4C06 +#define TARGET_LOOP_CTL_ADD 0x4C80 +#define TARGET_LOOP_CTL_REMOVE 0x4C81 +#define TARGET_LOOP_CTL_GET_FREE 0x4C82 + /* fb ioctls */ #define TARGET_FBIOGET_VSCREENINFO 0x4600 #define TARGET_FBIOPUT_VSCREENINFO 0x4601