Received: from eggs.gnu.org ([2001:4830:134:3::10]:45809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4PYH-0002qm-9g for qemu-devel@nongnu.org; Sat, 18 Jan 2014 01:38:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W4PYB-00074K-8S for qemu-devel@nongnu.org; Sat, 18 Jan 2014 01:38:41 -0500 Received: from cantor2.suse.de ([195.135.220.15]:59520 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4PYB-00073o-1t for qemu-devel@nongnu.org; Sat, 18 Jan 2014 01:38:35 -0500 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sat, 18 Jan 2014 07:38:30 +0100 Message-Id: <1390027110-30688-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] linux-user: Implement BLKPG ioctl List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Riku Voipio , agraf@suse.de, =?UTF-8?q?Andreas=20F=C3=A4rber?= Signed-off-by: Andreas F=C3=A4rber --- My first such patch, so take with care! linux-user/ioctls.h | 1 + linux-user/syscall.c | 1 + linux-user/syscall_defs.h | 1 + linux-user/syscall_types.h | 13 +++++++++++++ 4 files changed, 16 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 7381012..309fb21 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -77,6 +77,7 @@ IOCTL(BLKRAGET, IOC_R, MK_PTR(TYPE_LONG)) IOCTL(BLKSSZGET, IOC_R, MK_PTR(TYPE_LONG)) IOCTL(BLKBSZGET, IOC_R, MK_PTR(TYPE_INT)) + IOCTL(BLKPG, IOC_W, MK_PTR(MK_STRUCT(STRUCT_blkpg_ioctl_arg))) #ifdef FIBMAP IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG)) #endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 0ac05b8..942d67e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -107,6 +107,7 @@ int __clone2(int (*fn)(void *), void *child_stack_bas= e, #include #include #include +#include #include "linux_loop.h" #include "cpu-uname.h" =20 diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index ae30476..3c8869e 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -901,6 +901,7 @@ struct target_pollfd { #define TARGET_BLKSECTSET TARGET_IO(0x12,102)/* set max sectors per requ= est (ll_rw_blk.c) */ #define TARGET_BLKSECTGET TARGET_IO(0x12,103)/* get max sectors per requ= est (ll_rw_blk.c) */ #define TARGET_BLKSSZGET TARGET_IO(0x12,104)/* get block device sector = size */ +#define TARGET_BLKPG TARGET_IO(0x12,105)/* Partition table and disk= geometry handling */ /* A jump here: 108-111 have been used for various private purposes. */ #define TARGET_BLKBSZGET TARGET_IOR(0x12, 112, abi_ulong) #define TARGET_BLKBSZSET TARGET_IOW(0x12, 113, abi_ulong) diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h index 44b6a58..9d0c92d 100644 --- a/linux-user/syscall_types.h +++ b/linux-user/syscall_types.h @@ -240,3 +240,16 @@ STRUCT(fiemap, TYPE_INT, /* fm_mapped_extents */ TYPE_INT, /* fm_extent_count */ TYPE_INT) /* fm_reserved */ + +STRUCT(blkpg_partition, + TYPE_LONGLONG, /* start */ + TYPE_LONGLONG, /* length */ + TYPE_INT, /* pno */ + MK_ARRAY(TYPE_CHAR, BLKPG_DEVNAMELTH), /* devname */ + MK_ARRAY(TYPE_CHAR, BLKPG_VOLNAMELTH)) /* volname */ + +STRUCT(blkpg_ioctl_arg, + TYPE_INT, /* op */ + TYPE_INT, /* flags */ + TYPE_INT, /* datalen */ + MK_PTR(MK_STRUCT(STRUCT_blkpg_partition))) /* data */ --=20 1.8.4