From patchwork Tue Jul 19 12:54:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 650176 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rv0d14bPKz9t0F for ; Tue, 19 Jul 2016 23:04:53 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=GD67G6rD; dkim-atps=neutral Received: from localhost ([::1]:55729 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPUhf-0001XN-Bh for incoming@patchwork.ozlabs.org; Tue, 19 Jul 2016 09:04:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPUXc-0007GT-LT for qemu-devel@nongnu.org; Tue, 19 Jul 2016 08:54:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPUXa-0003NC-Id for qemu-devel@nongnu.org; Tue, 19 Jul 2016 08:54:27 -0400 Received: from mail-lf0-x22e.google.com ([2a00:1450:4010:c07::22e]:35454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPUXa-0003Mq-BK for qemu-devel@nongnu.org; Tue, 19 Jul 2016 08:54:26 -0400 Received: by mail-lf0-x22e.google.com with SMTP id f93so13381771lfi.2 for ; Tue, 19 Jul 2016 05:54:26 -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=j0ZvaoYzbXtOYnP3ElWyqq/Xt45bTkWKtCR0hgfCu1Q=; b=GD67G6rDCtBv5NQoQ+voCrtN1P2OMn/zkR7NkAxxJBOO8RmtVKYThc9nYdWTU/ZEJ2 XE5jbvK5usB9lHhSlAW7QS9XZec5+E4tXIH8MYTirreJFuTtJ40nyWUW8uPT0daR+frW jI5zUJnNwNNlv5zDNj7E9arpx/R1jYio+zX5k= 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=j0ZvaoYzbXtOYnP3ElWyqq/Xt45bTkWKtCR0hgfCu1Q=; b=iKLGp57mA2DsuLB2QE7KxDET0v/WS1lyI4JI2dbJYjZBC3uu3o6txyT9zFYNxWD7pq LaJfUhkVU+jT645NE32VByapSK5Ycbs63YMnQu3NiSOdaQKxhHlg27BNGN3rIbMKmFyQ E9JEv537u9N7kjWXYUuPzR29D0SGNUC9oJjYHW/MCucCKhVXycLcZNvsM5xe1/BojpUD KzqNCjGF/VslzSXFLowRPc5cozVHR+foHJndZewTkG9z9lopFIt0d1Cqy8kxWHwg0Kfw tXVygkTOSKmUI6VEwRkHIGSGBJIVj6f1SI2YQVAN8k66hvnjMYXoPFKt7ZbmBP71o8UC NI7w== X-Gm-Message-State: ALyK8tKmd3iteeesVjZpl1i6oDYVEk0kXipiEl0ihHyilgX6aIkXOh2Px1+FfR/wlQ1Nk76a X-Received: by 10.46.71.19 with SMTP id u19mr11174216lja.23.1468932865487; Tue, 19 Jul 2016 05:54:25 -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.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jul 2016 05:54:24 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 19 Jul 2016 15:54:05 +0300 Message-Id: <884cdc48a98fca7d758a5934af526cd1fcedcc9e.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::22e Subject: [Qemu-devel] [PULL 07/16] 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: Peter Maydell Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Add support for the /dev/loop-control ioctls: LOOP_CTL_ADD LOOP_CTL_REMOVE LOOP_CTL_GET_FREE [RV: fixed to apply to new header guards] Signed-off-by: Peter Maydell Reviewed-by: Laurent Vivier Signed-off-by: Riku Voipio --- 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 e672655..abff6b6 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -327,6 +327,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 1f52403..c69fea1 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 @@ -92,5 +94,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 b43966e..096f91c 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -1117,6 +1117,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