Accepting request 214315 from home:a_faerber:branches:Virtualization

Attempt to implement BLKPG ioctl 0x1269 to fix KIWI builds

OBS-URL: https://build.opensuse.org/request/show/214315
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=177
This commit is contained in:
Andreas Färber 2014-01-18 01:33:15 +00:00 committed by Git OBS Bridge
parent 1d0af77f71
commit 10c5410313
4 changed files with 83 additions and 0 deletions

View File

@ -0,0 +1,73 @@
From bcbf3e6efa6b8fd95f2eee2194f40781c952f7b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
Date: Sat, 18 Jan 2014 02:15:05 +0100
Subject: [PATCH] linux-user: Implement BLKPG ioctl
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
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 a96a419..ffd6d09 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -95,6 +95,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 4f7327a..ef82a0e 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -107,6 +107,7 @@ int __clone2(int (*fn)(void *), void *child_stack_base,
#include <linux/reboot.h>
#include <linux/route.h>
#include <linux/filter.h>
+#include <linux/blkpg.h>
#include "linux_loop.h"
#include "cpu-uname.h"
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 2d41202..3cdd471 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -895,6 +895,7 @@ struct target_pollfd {
#define TARGET_BLKSECTSET TARGET_IO(0x12,102)/* set max sectors per request (ll_rw_blk.c) */
#define TARGET_BLKSECTGET TARGET_IO(0x12,103)/* get max sectors per request (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 dd78619..56e344c 100644
--- a/linux-user/syscall_types.h
+++ b/linux-user/syscall_types.h
@@ -248,3 +248,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 */

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sat Jan 18 01:19:27 UTC 2014 - afaerber@suse.de
- Added patch to implement BLKPG ioctl that broke kiwi image builds
0040-linux-user-Implement-BLKPG-ioctl.pa.patch
-------------------------------------------------------------------
Fri Jan 17 17:40:21 UTC 2014 - afaerber@suse.de

View File

@ -64,6 +64,7 @@ Patch0036: 0036-linux-user-lseek-explicitly-cast-no.patch
Patch0037: 0037-virtfs-proxy-helper-Provide-__u64-f.patch
Patch0038: 0038-roms-Build-vgabios.bin.patch.patch
Patch0039: 0039-configure-Enable-PIE-for-ppc-and-pp.patch
Patch0040: 0040-linux-user-Implement-BLKPG-ioctl.pa.patch
# Please do not add patches manually here, run update_git.sh.
# this is to make lint happy
Source300: rpmlintrc
@ -155,6 +156,7 @@ run cross-architecture builds.
%patch0037 -p1
%patch0038 -p1
%patch0039 -p1
%patch0040 -p1
%build
./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \

View File

@ -71,6 +71,7 @@ Patch0036: 0036-linux-user-lseek-explicitly-cast-no.patch
Patch0037: 0037-virtfs-proxy-helper-Provide-__u64-f.patch
Patch0038: 0038-roms-Build-vgabios.bin.patch.patch
Patch0039: 0039-configure-Enable-PIE-for-ppc-and-pp.patch
Patch0040: 0040-linux-user-Implement-BLKPG-ioctl.pa.patch
# Please do not add patches manually here, run update_git.sh.
# roms/ipxe patches
@ -303,6 +304,7 @@ This sub-package contains the guest agent.
%patch0037 -p1
%patch0038 -p1
%patch0039 -p1
%patch0040 -p1
%patch1000 -p1
%patch1001 -p1