From nobody Sun Dec 14 12:13:27 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1637596611; cv=none; d=zohomail.com; s=zohoarc; b=VXwPDSTajogGu2w0Jjg9yx0Hnw1jvijIBT8jbAaTyk64n7pOMfx5vYAsHg7lrsvEPue84v6c5OhOb1ErkzGyf4pIC9AFFqeNVRRJEiW+/5167v5/KJ04fipJ70Lw/T7plyTNm/+pCCg1ybXTaO0RHwyJ6wyJkbz52k5qhlzem7A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637596611; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LPVv38RPJOrLaJcEzWn2rWOPMMn1r0Z47oyfxWVS3fs=; b=cP8Vvq2WZeYjrWCZWATLlTflSpuvbmFw1U62VXSydpC05i+0jr/qcqTw09ghWHbspGmMXZYQK7HK5r9OO/1gUHl7iUX9/mhmmXy4AlcXZrcEfFh3eRE2KHCSViPK/SKJBNdhuabL8PpWPvQKRAGkWqBcSDX2ZvxmwfHHMR6hJPo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1637596611154799.7582662453652; Mon, 22 Nov 2021 07:56:51 -0800 (PST) Received: from localhost ([::1]:60334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mpBgW-0004O9-IT for importer@patchew.org; Mon, 22 Nov 2021 10:56:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpBfq-0003i6-Jk for qemu-devel@nongnu.org; Mon, 22 Nov 2021 10:56:06 -0500 Received: from smtp-out2.suse.de ([195.135.220.29]:42192) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mpBfo-0008KK-V7 for qemu-devel@nongnu.org; Mon, 22 Nov 2021 10:56:06 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id E94891FD58; Mon, 22 Nov 2021 15:56:02 +0000 (UTC) Received: from hawking.suse.de (hawking.suse.de [10.160.4.0]) by relay2.suse.de (Postfix) with ESMTP id E37BEA3B84; Mon, 22 Nov 2021 15:56:02 +0000 (UTC) Received: by hawking.suse.de (Postfix, from userid 17005) id C0226446B26; Mon, 22 Nov 2021 16:56:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1637596562; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LPVv38RPJOrLaJcEzWn2rWOPMMn1r0Z47oyfxWVS3fs=; b=VA2VwF3ys9WjrT21FPxQ2Kw3Qol2OsZYF3eknsJMDcQch6GS0y9ddt8PPWuBaWC/vHB5Wh Y1ikWRJjUzrMIl5Bl5T8+qNBORvXfd4K6C7xH34yb59+aUqLOAemnh3iplO1PFJ1uVDbEk Q2/NN51FTvGJ5+NJPudKS63m0DdANBw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1637596562; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LPVv38RPJOrLaJcEzWn2rWOPMMn1r0Z47oyfxWVS3fs=; b=APU8lVG9NZ85loQm9RTZ14eJe9CswUfpK4rb7f7X+7T5PL+FETP8TZO8+eJkbXvbuJVd8O 9rct2sfQ1XaI22CA== From: Andreas Schwab To: Laurent Vivier Subject: [PATCH v2] linux-user: implement more loop ioctls References: <290f4df5-fe4a-6665-89f8-69f958cf452c@vivier.eu> X-Yow: HELLO KITTY gang terrorizes town, family STICKERED to death! Date: Mon, 22 Nov 2021 16:56:02 +0100 In-Reply-To: <290f4df5-fe4a-6665-89f8-69f958cf452c@vivier.eu> (Laurent Vivier's message of "Mon, 22 Nov 2021 16:21:29 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=195.135.220.29; envelope-from=schwab@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1637596613441100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" LOOP_CONFIGURE is now used by losetup, and it cannot cope with ENOSYS. Signed-off-by: Andreas Schwab Reviewed-by: Laurent Vivier --- v2: fix s/loop_configure/loop_config/ typo linux-user/ioctls.h | 4 ++++ linux-user/linux_loop.h | 2 ++ linux-user/syscall_defs.h | 4 ++++ linux-user/syscall_types.h | 6 ++++++ 4 files changed, 16 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 7193c3b226..f182d40190 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -637,6 +637,10 @@ IOCTL(LOOP_SET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64))) IOCTL(LOOP_GET_STATUS64, IOC_R, MK_PTR(MK_STRUCT(STRUCT_loop_info64))) IOCTL(LOOP_CHANGE_FD, 0, TYPE_INT) + IOCTL(LOOP_SET_CAPACITY, 0, TYPE_INT) + IOCTL(LOOP_SET_DIRECT_IO, 0, TYPE_INT) + IOCTL(LOOP_SET_BLOCK_SIZE, 0, TYPE_INT) + IOCTL(LOOP_CONFIGURE, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_config))) =20 IOCTL(LOOP_CTL_ADD, 0, TYPE_INT) IOCTL(LOOP_CTL_REMOVE, 0, TYPE_INT) diff --git a/linux-user/linux_loop.h b/linux-user/linux_loop.h index c69fea11e4..f80b96f1ff 100644 --- a/linux-user/linux_loop.h +++ b/linux-user/linux_loop.h @@ -96,6 +96,8 @@ struct loop_info64 { #define LOOP_CHANGE_FD 0x4C06 #define LOOP_SET_CAPACITY 0x4C07 #define LOOP_SET_DIRECT_IO 0x4C08 +#define LOOP_SET_BLOCK_SIZE 0x4C09 +#define LOOP_CONFIGURE 0x4C0A =20 /* /dev/loop-control interface */ #define LOOP_CTL_ADD 0x4C80 diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index a5ce487dcc..560a29afd8 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -1219,6 +1219,10 @@ struct target_rtc_pll_info { #define TARGET_LOOP_SET_STATUS64 0x4C04 #define TARGET_LOOP_GET_STATUS64 0x4C05 #define TARGET_LOOP_CHANGE_FD 0x4C06 +#define TARGET_LOOP_SET_CAPACITY 0x4C07 +#define TARGET_LOOP_SET_DIRECT_IO 0x4C08 +#define TARGET_LOOP_SET_BLOCK_SIZE 0x4C09 +#define TARGET_LOOP_CONFIGURE 0x4C0A =20 #define TARGET_LOOP_CTL_ADD 0x4C80 #define TARGET_LOOP_CTL_REMOVE 0x4C81 diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h index ba2c1518eb..c3b43f8022 100644 --- a/linux-user/syscall_types.h +++ b/linux-user/syscall_types.h @@ -201,6 +201,12 @@ STRUCT(loop_info64, MK_ARRAY(TYPE_CHAR, 32), /* lo_encrypt_key */ MK_ARRAY(TYPE_ULONGLONG, 2)) /* lo_init */ =20 +STRUCT(loop_config, + TYPE_INT, /* fd */ + TYPE_INT, /* block_size */ + MK_STRUCT(STRUCT_loop_info64), /* info */ + MK_ARRAY(TYPE_ULONGLONG, 8)) /* __reserved */ + /* mag tape ioctls */ STRUCT(mtop, TYPE_SHORT, TYPE_INT) STRUCT(mtget, TYPE_LONG, TYPE_LONG, TYPE_LONG, TYPE_LONG, TYPE_LONG, --=20 2.34.0