From nobody Sun Dec 14 06:52:11 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=1637590796; cv=none; d=zohomail.com; s=zohoarc; b=G2biLiiamf7EwcA4Gs3IgHKl5kkXsleJM5fTr6OD7foowkjjbZttX1MsXi+bCcM3mdM4XSYRoKrjLedn6AooipqC9UpODt1EW3KMSUp4JlGvSpQpxg2JGE4KG3XzrKe4tGuctAWUJAQl7XYLZLB+30TWUN6LmlOM0Fcs+PKcLWA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637590796; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=2Uuw5cqvZjl38rwK4JcJH2l/oOs/NiqCxhHun0+xmkM=; b=K4bYyArZNBC3IV8niEuUC+af1JDBC5FralEujHGyTw2HwFL8aSl1T2Rfw6MlUGuxYaH2ppIq7IAhktBFotogxEdVMEM3DdhB7Xa+L6hdEE+nCnO1r3ZezTuHEbYs1m5DZdLBL915QW/QX124WSUznq0k3M6E18kT1KhbpxmDuEU= 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 1637590795767519.4653934174456; Mon, 22 Nov 2021 06:19:55 -0800 (PST) Received: from localhost ([::1]:37126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mpAAj-0002r8-Ix for importer@patchew.org; Mon, 22 Nov 2021 09:19:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpA9s-000294-Fu for qemu-devel@nongnu.org; Mon, 22 Nov 2021 09:19:00 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:43266) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mpA9q-000159-Ei for qemu-devel@nongnu.org; Mon, 22 Nov 2021 09:19:00 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 89EC4218E1; Mon, 22 Nov 2021 14:18:55 +0000 (UTC) Received: from hawking.suse.de (hawking.suse.de [10.160.4.0]) by relay2.suse.de (Postfix) with ESMTP id 839C6A3B8D; Mon, 22 Nov 2021 14:18:55 +0000 (UTC) Received: by hawking.suse.de (Postfix, from userid 17005) id 6D4E9446B2C; Mon, 22 Nov 2021 15:18:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1637590735; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=2Uuw5cqvZjl38rwK4JcJH2l/oOs/NiqCxhHun0+xmkM=; b=qUisFzKG9authrwuqrYG/M9dou0PgGlpqNUJCqKXrzwR73r3QXW8ZzLbnC9bke4Srt1mbm N8BtlPdqqg16iDYZ7CYYspB4BcFm6wN/HRRYsBBslUEejcputQUs/aXd49Xxn1C+fFqkE1 L266evFcU5M3rjUJYFiRHsZl2m9RyJM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1637590735; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=2Uuw5cqvZjl38rwK4JcJH2l/oOs/NiqCxhHun0+xmkM=; b=Me40jfsBo02RCmr2QCuF/BKHKb+qFz1V0zMYSRE+X3s33quhmqhm/XggE3mi52SGcb3mvx IBNRoCKVWvWE1kAg== From: Andreas Schwab To: Laurent Vivier Subject: [PATCH] linux-user: implement more loop ioctls X-Yow: What I want to find out is -- do parrots know much about Astro-Turf? Date: Mon, 22 Nov 2021 15:18:55 +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.28; envelope-from=schwab@suse.de; helo=smtp-out1.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: 1637590798400100001 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 --- 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..5ac5efc8aa 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_configure))) =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..7c46e4fb25 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_configure, + 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