SHA256
1
0
forked from pool/qemu

Accepting request 132610 from home:a_faerber:branches:Virtualization

Update to v1.2.0-rc3 and pick up two patches from kvm package for SUSE Studio ppc

OBS-URL: https://build.opensuse.org/request/show/132610
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=105
This commit is contained in:
Andreas Färber 2012-09-05 11:51:25 +00:00 committed by Git OBS Bridge
parent a453b81de2
commit 27ed06ba44
40 changed files with 338 additions and 126 deletions

View File

@ -1,4 +1,4 @@
From 066d4a227a3f0a46c390cad24f4d2fc02b1868e2 Mon Sep 17 00:00:00 2001
From b86973fedcaf5dc9d63e0eb3e6cc14053233ec63 Mon Sep 17 00:00:00 2001
From: Peter Maydell <peter.maydell@linaro.org>
Date: Wed, 5 Oct 2011 10:04:02 +0100
Subject: [PATCH] Handle CPU interrupts by inline checking of a flag
@ -134,7 +134,7 @@ index 430cb44..65a75d9 100644
*icount_arg = num_insns;
gen_set_label(icount_label);
diff --git a/linux-user/main.c b/linux-user/main.c
index 7dea084..d9814bc4 100644
index 1a1c661..b7687c5 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -64,6 +64,7 @@ unsigned long reserved_va;
@ -157,7 +157,7 @@ index 7dea084..d9814bc4 100644
static void handle_arg_singlestep(const char *arg)
{
singlestep = 1;
@@ -3251,6 +3257,8 @@ struct qemu_argument arg_table[] = {
@@ -3251,6 +3257,8 @@ static const struct qemu_argument arg_table[] = {
"options", "activate log"},
{"D", "QEMU_LOG_FILENAME", true, handle_arg_log_filename,
"logfile", "override default logfile location"},

View File

@ -1,4 +1,4 @@
From bc44bc4ec5dd49776e5bdf89f3ec4712d286a221 Mon Sep 17 00:00:00 2001
From fcb651f1c440e8ddd08d4b648f9e133f5192ce22 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Mon, 21 Nov 2011 23:50:36 +0100
Subject: [PATCH] XXX dont dump core on sigabort

View File

@ -1,4 +1,4 @@
From ce3dd80bae810b1c3a5a327928a32ec92dd082c6 Mon Sep 17 00:00:00 2001
From 4de56c28e769d5cd0ee76994a0df31192ed1d7a1 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Thu, 1 Dec 2011 19:00:01 +0100
Subject: [PATCH] XXX work around SA_RESTART race with boehm-gc (ARM only)
@ -12,7 +12,7 @@ Subject: [PATCH] XXX work around SA_RESTART race with boehm-gc (ARM only)
4 files changed, 130 insertions(+), 10 deletions(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index d9814bc4..587f421 100644
index b7687c5..8002c77 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -847,15 +847,22 @@ void cpu_loop(CPUARMState *env)
@ -118,7 +118,7 @@ index 0078b32..4a637f4 100644
ignore state to avoid getting unexpected interrupted
syscalls */
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1174306..066bc54 100644
index 6257a04..10ea39f 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5086,6 +5086,87 @@ static int do_open(void *cpu_env, const char *pathname, int flags, mode_t mode)
@ -222,7 +222,7 @@ index 1174306..066bc54 100644
#ifdef DEBUG
gemu_log("syscall %d", num);
@@ -8095,7 +8182,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
@@ -8094,7 +8181,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
cmd = target_to_host_fcntl_cmd(arg2);
if (cmd == -TARGET_EINVAL) {
ret = cmd;
@ -231,7 +231,7 @@ index 1174306..066bc54 100644
}
switch(arg2) {
@@ -8840,6 +8927,7 @@ fail:
@@ -8839,6 +8926,7 @@ fail:
#endif
if(do_strace)
print_syscall_ret(num, ret);

View File

@ -1,4 +1,4 @@
From 73eb91b6c3900fd479240f8c2e8d2c52fbd784ee Mon Sep 17 00:00:00 2001
From 9256544290b6bb2cb0f103ab6e3ccb1f8d2ba8c3 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:18:44 +0200
Subject: [PATCH] qemu-0.9.0.cvs-binfmt

View File

@ -1,4 +1,4 @@
From 6e4a1a38e639ade0f184a74058fd22ec577925a8 Mon Sep 17 00:00:00 2001
From aac0fcf1caa161c2252199bf7adbb5ed133793a5 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Tue, 14 Apr 2009 16:20:50 +0200
Subject: [PATCH] qemu-cvs-alsa_bitfield

View File

@ -1,4 +1,4 @@
From 89629ceaf475b0caa0767a82a8b7715983b4e2f9 Mon Sep 17 00:00:00 2001
From 70d857bf30544f31a4fced198a7dc7dd7ac9e1fe Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Tue, 14 Apr 2009 16:23:27 +0200
Subject: [PATCH] qemu-cvs-alsa_ioctl
@ -2255,7 +2255,7 @@ index 0000000..e09a30d
+ unsigned char *code;
+};
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 2cfda5a..0af219a 100644
index a98cbf7..8644f87 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -2425,3 +2425,5 @@ struct target_ucred {

View File

@ -1,4 +1,4 @@
From 18f6f4e256d44ce09a5b6368ca9b57b6b201070d Mon Sep 17 00:00:00 2001
From 414a5cb3b7f83dbba5800ff761a78a72e6c81de2 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Tue, 14 Apr 2009 16:24:15 +0200
Subject: [PATCH] qemu-cvs-alsa_mmap

View File

@ -1,4 +1,4 @@
From de4bd22f7b65380399cafb4ffac771c0edf6f8ac Mon Sep 17 00:00:00 2001
From 04dfbd49b4b4a31138327793bcf079c01d07d53a Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:25:41 +0200
Subject: [PATCH] qemu-cvs-gettimeofday
@ -9,7 +9,7 @@ No clue what this is for.
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 066bc54..20bff30 100644
index 10ea39f..fbdba83 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6237,6 +6237,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,

View File

@ -1,4 +1,4 @@
From 9dfc4531a07971bcc2636491f1520bc60f1c167c Mon Sep 17 00:00:00 2001
From 1b36768d9012c5045cf44448c40618ea99bcc676 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Tue, 14 Apr 2009 16:26:33 +0200
Subject: [PATCH] qemu-cvs-ioctl_debug
@ -12,7 +12,7 @@ Signed-off-by: Ulrich Hecht <uli@suse.de>
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 20bff30..0d295c1 100644
index fbdba83..6bfe718 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3657,7 +3657,12 @@ static abi_long do_ioctl(int fd, abi_long cmd, abi_long arg)

View File

@ -1,4 +1,4 @@
From 20b1adf1ffd1bc0eb82a01be2eea32608f4ddc39 Mon Sep 17 00:00:00 2001
From e8fac1a0088a3dc35bf87ba01e5d7b79441a7519 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Tue, 14 Apr 2009 16:27:36 +0200
Subject: [PATCH] qemu-cvs-ioctl_nodirection
@ -15,7 +15,7 @@ Signed-off-by: Ulrich Hecht <uli@suse.de>
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 0d295c1..ae3ebd9 100644
index 6bfe718..46fc3df 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3691,6 +3691,11 @@ static abi_long do_ioctl(int fd, abi_long cmd, abi_long arg)

View File

@ -1,4 +1,4 @@
From 4ad8ed2cfa124ed9473a8491f13f9ac01260468a Mon Sep 17 00:00:00 2001
From d009c84ae2dfa94b4d6257a80153970b4d0f1e3b Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:37:42 +0200
Subject: [PATCH] block/vmdk: Support creation of SCSI VMDK images in qemu-img

View File

@ -1,4 +1,4 @@
From 327813b988fa491123f744214323b7b7d2c17ce0 Mon Sep 17 00:00:00 2001
From 4d6b5adbac7c86e1f4491a1c9c80ad0fe7fb8684 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Wed, 25 Aug 2010 14:23:43 +0200
Subject: [PATCH] configure: Enable mipsn32*-linux-user builds

View File

@ -1,4 +1,4 @@
From 666785d46bae0df3b504b68bc9098178f6840aaa Mon Sep 17 00:00:00 2001
From fe2e852651db0905c24d2c9f8f67b1f117d6cc49 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Fri, 30 Sep 2011 19:40:36 +0200
Subject: [PATCH] linux-user: add binfmt wrapper for argv[0] handling

View File

@ -1,4 +1,4 @@
From 505342557ab0e7e27a86b3ff91f851168ed14a36 Mon Sep 17 00:00:00 2001
From 134ee32b68ff8d6c36fe57ba61ed71b8b6afb9b3 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Sun, 11 Dec 2011 01:19:24 +0100
Subject: [PATCH] linux-user: Ignore timer_create syscall
@ -12,10 +12,10 @@ Signed-off-by: Alexander Graf <agraf@suse.de>
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index ae3ebd9..537a7d3 100644
index 46fc3df..0da4cce 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8556,6 +8556,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
@@ -8555,6 +8555,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
break;
#endif

View File

@ -1,4 +1,4 @@
From 4b5cbc5af6b70ed333d5e6d32a538a3ffbfdf55d Mon Sep 17 00:00:00 2001
From 2f3a0dcdbeb25946e1a5b3ee99a149d5b9a65d91 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Sun, 11 Dec 2011 01:21:51 +0100
Subject: [PATCH] linux-user: be silent about capget failures
@ -13,10 +13,10 @@ Signed-off-by: Alexander Graf <agraf@suse.de>
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 537a7d3..2a151b8 100644
index 0da4cce..46331c7 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7537,7 +7537,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
@@ -7536,7 +7536,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
unlock_user(p, arg1, ret);
break;
case TARGET_NR_capget:

View File

@ -1,4 +1,4 @@
From 3ba205e2e55ac10e22d71d7a806d3bbb1e3f307f Mon Sep 17 00:00:00 2001
From 63b00ae3e995042b79461eda870bdb0280edf348 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Fri, 6 Jan 2012 01:05:55 +0100
Subject: [PATCH] PPC: KVM: Disable mmu notifier check

View File

@ -1,4 +1,4 @@
From 98c931994104612bf6408cb7a1d7f782592953a8 Mon Sep 17 00:00:00 2001
From c45fab93fd75e8e2e1e468e1c1e1400923a57d04 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Fri, 13 Jan 2012 17:05:41 +0100
Subject: [PATCH] linux-user: fix segfault deadlock

View File

@ -1,4 +1,4 @@
From 698c855c6a60151974de79a1c8fff71180d18279 Mon Sep 17 00:00:00 2001
From 7cc9578f1c652d52dd2917cd9fdeb8cacaeb5d58 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Thu, 2 Feb 2012 18:02:33 +0100
Subject: [PATCH] linux-user: binfmt: support host binaries

View File

@ -1,4 +1,4 @@
From 68d4c332e5b0be0fb2dd52c92ed39f160113b585 Mon Sep 17 00:00:00 2001
From 773935ea25dcd118931d6dbbd0b78be28a983a3f Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Tue, 29 May 2012 15:30:01 +0200
Subject: [PATCH] linux-user: arm: no tb_flush on reset

View File

@ -1,4 +1,4 @@
From 15c3c89300471761bd901ecb2f1df28827d23b63 Mon Sep 17 00:00:00 2001
From 6eedf1bd672636c89aa13ec72dc22f60775100bf Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Wed, 30 May 2012 14:40:47 +0200
Subject: [PATCH] linux-user: fix multi-threaded /proc/self/maps
@ -16,7 +16,7 @@ Signed-off-by: Alexander Graf <agraf@suse.de>
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 2a151b8..b3d8bd8 100644
index 46331c7..946f5fb 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4975,8 +4975,8 @@ static int open_self_maps(void *cpu_env, int fd)

View File

@ -1,4 +1,4 @@
From b8d72040c53f4d087bce85bec90fe801f09d6685 Mon Sep 17 00:00:00 2001
From f4a56321bd920f280dd05aaf34cc8890b584b7ba Mon Sep 17 00:00:00 2001
From: Michael Tokarev <mjt@tls.msk.ru>
Date: Thu, 7 Jun 2012 01:11:00 +0400
Subject: [PATCH] use --libexecdir instead of ignoring it first and

View File

@ -1,4 +1,4 @@
From d174cebc94c91edd45d8a26d47ea4af99154a295 Mon Sep 17 00:00:00 2001
From 4eb267d12db35359655f6661733536daa3e329e7 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Tue, 12 Jun 2012 04:41:10 +0200
Subject: [PATCH] linux-user: Ignore broken loop ioctl
@ -41,7 +41,7 @@ index 8974caa..810ae61 100644
#endif
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index b3d8bd8..0c27d31 100644
index 946f5fb..ed87c54 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3634,6 +3634,13 @@ out:
@ -59,7 +59,7 @@ index b3d8bd8..0c27d31 100644
#define IOCTL(cmd, access, ...) \
{ TARGET_ ## cmd, cmd, #cmd, access, 0, { __VA_ARGS__ } },
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 0af219a..3b7b1c3 100644
index 8644f87..d708131 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -1016,6 +1016,7 @@ struct target_pollfd {

View File

@ -1,4 +1,4 @@
From e145868d65d5c6c1b6b0e11435cc830a07f4fac2 Mon Sep 17 00:00:00 2001
From 5b5da5874c68710642aa30496e1552baa40368dd Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Mon, 25 Jun 2012 19:02:32 +0200
Subject: [PATCH] linux-user: fix segmentation fault passing with g2h(x) != x

View File

@ -1,4 +1,4 @@
From 4d144a57e91d135c505b47adb50e66f2e2ed13b9 Mon Sep 17 00:00:00 2001
From a9476084ee13b6e263c734d7d7412f4a0f0b05be Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Thu, 5 Jul 2012 17:31:39 +0200
Subject: [PATCH] linux-user: lock tcg

View File

@ -1,4 +1,4 @@
From ee625c9596666237f0366f7b9a91f49bf21fb7ae Mon Sep 17 00:00:00 2001
From c1e14f5765b50d0b0a2067a5b034dbccc90bf1ca Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Tue, 10 Jul 2012 20:40:55 +0200
Subject: [PATCH] linux-user: Run multi-threaded code on a single core
@ -19,7 +19,7 @@ Signed-off-by: Alexander Graf <agraf@suse.de>
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 0c27d31..a2dc038 100644
index ed87c54..9f689da 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4352,6 +4352,15 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp,

View File

@ -1,4 +1,4 @@
From 9f46f8faf593f97d0432bce644dae05b77870d0b Mon Sep 17 00:00:00 2001
From 257baa7a7d4c7ca84600f3214d7f5dc293d60ea4 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Wed, 11 Jul 2012 16:47:42 +0200
Subject: [PATCH] linux-user: lock tb flushing too

View File

@ -1,4 +1,4 @@
From 2f19b4fb6534d8b5bd17bf7f6f1290fb04cc3ea4 Mon Sep 17 00:00:00 2001
From 4d6a42dd97068641ad74212a9456b9c9a6a2f754 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Mon, 23 Jul 2012 10:24:14 +0200
Subject: [PATCH] linux-user: Fake /proc/cpuinfo
@ -17,7 +17,7 @@ Signed-off-by: Alexander Graf <agraf@suse.de>
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index a2dc038..b4ab1d9 100644
index 9f689da..fc27851 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5035,6 +5035,25 @@ static int open_self_stat(void *cpu_env, int fd)

View File

@ -1,4 +1,4 @@
From 3e610c449b5dceb84efe8fc7d1bde52428cd7479 Mon Sep 17 00:00:00 2001
From 4e8876da88b5749b7dd210676601f7217356e1b0 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Mon, 20 Aug 2012 00:02:52 +0200
Subject: [PATCH] linux-user: implement FS_IOC_GETFLAGS ioctl
@ -22,7 +22,7 @@ index bb76c56..1b798b3 100644
IOCTL(SIOCATMARK, 0, TYPE_NULL)
IOCTL(SIOCADDRT, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rtentry)))
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 3b7b1c3..67fbcab 100644
index d708131..15b171f 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -2344,6 +2344,8 @@ struct target_eabi_flock64 {

View File

@ -1,4 +1,4 @@
From cb09219f8b4f0d501dd794fb9b3c7d35d50dcb67 Mon Sep 17 00:00:00 2001
From 2948a837102e3167e1afbfe58a38c9ea2b1fbc22 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Mon, 20 Aug 2012 00:07:13 +0200
Subject: [PATCH] linux-user: implement FS_IOC_SETFLAGS ioctl
@ -22,7 +22,7 @@ index 1b798b3..5027c74 100644
IOCTL(SIOCATMARK, 0, TYPE_NULL)
IOCTL(SIOCADDRT, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rtentry)))
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 67fbcab..349229d 100644
index 15b171f..d618414 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -2345,6 +2345,7 @@ struct target_eabi_flock64 {

View File

@ -1,61 +0,0 @@
From d97740f5cc4e23c5b3fb328eddd2fe409c1dc986 Mon Sep 17 00:00:00 2001
From: "Dmitry V. Levin" <ldv@altlinux.org>
Date: Mon, 20 Aug 2012 12:13:12 +0000
Subject: [PATCH] linux-user: fix emulation of getdents
In case when TARGET_ABI_BITS == 32 && HOST_LONG_BITS == 64, the last
byte of the target dirent structure (aka d_type byte) was never copied
from the host dirent structure, thus breaking everything that relies
on valid d_type value, e.g. glob(3).
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
linux-user/syscall.c | 11 +++++------
linux-user/syscall_defs.h | 8 ++++----
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index b4ab1d9..fc27851 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7161,15 +7161,14 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
tde = target_dirp;
while (len > 0) {
reclen = de->d_reclen;
- treclen = reclen - (2 * (sizeof(long) - sizeof(abi_long)));
+ tnamelen = reclen - offsetof(struct linux_dirent, d_name);
+ assert(tnamelen >= 0);
+ treclen = tnamelen + offsetof(struct target_dirent, d_name);
+ assert(count1 + treclen <= count);
tde->d_reclen = tswap16(treclen);
tde->d_ino = tswapal(de->d_ino);
tde->d_off = tswapal(de->d_off);
- tnamelen = treclen - (2 * sizeof(abi_long) + 2);
- if (tnamelen > 256)
- tnamelen = 256;
- /* XXX: may not be correct */
- pstrcpy(tde->d_name, tnamelen, de->d_name);
+ memcpy(tde->d_name, de->d_name, tnamelen);
de = (struct linux_dirent *)((char *)de + reclen);
len -= reclen;
tde = (struct target_dirent *)((char *)tde + treclen);
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 349229d..d618414 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -255,10 +255,10 @@ struct kernel_statfs {
};
struct target_dirent {
- abi_long d_ino;
- abi_long d_off;
- unsigned short d_reclen;
- char d_name[256]; /* We must not include limits.h! */
+ abi_long d_ino;
+ abi_long d_off;
+ unsigned short d_reclen;
+ char d_name[];
};
struct target_dirent64 {

View File

@ -1,4 +1,4 @@
From 88b2e6ccf4e6e30b1368937f48fc7eeacaae5de5 Mon Sep 17 00:00:00 2001
From 097557f666be4d8c1a5080edf0a1b5fd075fda25 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Tue, 21 Aug 2012 11:16:06 +0200
Subject: [PATCH] linux-user: fix statfs

View File

@ -1,4 +1,4 @@
From d152363fe95b66c3f75e9d47c65e865a70672f8d Mon Sep 17 00:00:00 2001
From 8b7e8296ce618d49e6cc2341adb02870129aa1af Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Tue, 21 Aug 2012 14:20:40 +0200
Subject: [PATCH] linux-user: XXX disable fiemap

View File

@ -0,0 +1,135 @@
From d3d407c4b349278a76aa6e70e4eddd2f4d526d77 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
Date: Wed, 29 Aug 2012 18:42:56 +0200
Subject: [PATCH] slirp: -nooutgoing
TBD (from SUSE Studio team)
---
qemu-options.hx | 10 ++++++++++
slirp/socket.c | 8 ++++++++
slirp/tcp_subr.c | 16 ++++++++++++++++
vl.c | 9 +++++++++
4 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/qemu-options.hx b/qemu-options.hx
index af614bf..1368b2e 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2328,6 +2328,16 @@ Store the QEMU process PID in @var{file}. It is useful if you launch QEMU
from a script.
ETEXI
+DEF("nooutgoing", HAS_ARG, QEMU_OPTION_nooutgoing, \
+ "-nooutgoing <IP>\n" \
+ " incoming traffic only from IP, no outgoing\n", \
+ QEMU_ARCH_ALL)
+STEXI
+@item -nooutgoing
+Forbid userspace networking to make outgoing connections. Only accept incoming
+connections from ip address IP.
+ETEXI
+
DEF("singlestep", 0, QEMU_OPTION_singlestep, \
"-singlestep always run in singlestep mode\n", QEMU_ARCH_ALL)
STEXI
diff --git a/slirp/socket.c b/slirp/socket.c
index 77b0c98..94dcd9a 100644
--- a/slirp/socket.c
+++ b/slirp/socket.c
@@ -531,6 +531,8 @@ sorecvfrom(struct socket *so)
} /* if ping packet */
}
+extern int slirp_nooutgoing;
+
/*
* sendto() a socket
*/
@@ -561,6 +563,12 @@ sosendto(struct socket *so, struct mbuf *m)
DEBUG_MISC((dfd, " sendto()ing, addr.sin_port=%d, addr.sin_addr.s_addr=%.16s\n", ntohs(addr.sin_port), inet_ntoa(addr.sin_addr)));
+ /* Only allow DNS requests */
+ if (slirp_nooutgoing && ntohs(addr.sin_port) != 53) {
+ errno = EHOSTUNREACH;
+ return -1;
+ }
+
/* Don't care what port we get */
ret = sendto(so->s, m->m_data, m->m_len, 0,
(struct sockaddr *)&addr, sizeof (struct sockaddr));
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c
index 025b374..dee23a0 100644
--- a/slirp/tcp_subr.c
+++ b/slirp/tcp_subr.c
@@ -324,6 +324,9 @@ tcp_sockclosed(struct tcpcb *tp)
* nonblocking. Connect returns after the SYN is sent, and does
* not wait for ACK+SYN.
*/
+
+extern int slirp_nooutgoing;
+
int tcp_fconnect(struct socket *so)
{
Slirp *slirp = so->slirp;
@@ -332,6 +335,11 @@ int tcp_fconnect(struct socket *so)
DEBUG_CALL("tcp_fconnect");
DEBUG_ARG("so = %lx", (long )so);
+ if (slirp_nooutgoing) {
+ errno = EHOSTUNREACH;
+ return -1;
+ }
+
if( (ret = so->s = qemu_socket(AF_INET,SOCK_STREAM,0)) >= 0) {
int opt, s=so->s;
struct sockaddr_in addr;
@@ -424,6 +432,13 @@ tcp_connect(struct socket *inso)
tcp_close(sototcpcb(so)); /* This will sofree() as well */
return;
}
+
+ if (slirp_nooutgoing && addr.sin_addr.s_addr != slirp_nooutgoing) {
+ tcp_close(sototcpcb(so)); /* This will sofree() as well */
+ close(s);
+ return;
+ }
+
socket_set_nonblock(s);
opt = 1;
setsockopt(s,SOL_SOCKET,SO_REUSEADDR,(char *)&opt,sizeof(int));
@@ -434,6 +449,7 @@ tcp_connect(struct socket *inso)
so->so_fport = addr.sin_port;
so->so_faddr = addr.sin_addr;
+
/* Translate connections from localhost to the real hostname */
if (so->so_faddr.s_addr == 0 ||
(so->so_faddr.s_addr & loopback_mask) ==
diff --git a/vl.c b/vl.c
index fdf755f..153530b 100644
--- a/vl.c
+++ b/vl.c
@@ -217,6 +217,7 @@ const char *vnc_display;
int acpi_enabled = 1;
int no_hpet = 0;
int fd_bootchk = 1;
+int slirp_nooutgoing = 0;
int no_reboot = 0;
int no_shutdown = 0;
int cursor_hide = 1;
@@ -2782,6 +2783,14 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_singlestep:
singlestep = 1;
break;
+ case QEMU_OPTION_nooutgoing:
+ slirp_nooutgoing = inet_addr(optarg);
+ if (slirp_nooutgoing == INADDR_NONE) {
+ printf("Invalid address: %s.\nOnly addresses of the format "
+ "xxx.xxx.xxx.xxx are supported.\n", optarg);
+ exit(1);
+ }
+ break;
case QEMU_OPTION_S:
autostart = 0;
break;

View File

@ -0,0 +1,127 @@
From 7a34b5b68be85ba446ff715095e67fba0e80ee07 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
Date: Wed, 29 Aug 2012 20:06:01 +0200
Subject: [PATCH] vnc: password-file= and incoming-connections=
TBD (from SUSE Studio team)
---
ui/vnc.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 71 insertions(+), 0 deletions(-)
diff --git a/ui/vnc.c b/ui/vnc.c
index 385e345..df295a0 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -45,6 +45,7 @@ static const struct timeval VNC_REFRESH_LOSSY = { 2, 0 };
static VncDisplay *vnc_display; /* needed for info vnc */
static DisplayChangeListener *dcl;
+static int allowed_connections = 0;
static int vnc_cursor_define(VncState *vs);
static void vnc_release_modifiers(VncState *vs);
@@ -1018,6 +1019,7 @@ static void vnc_disconnect_start(VncState *vs)
static void vnc_disconnect_finish(VncState *vs)
{
int i;
+ static int num_disconnects = 0;
vnc_jobs_join(vs); /* Wait encoding jobs */
@@ -1063,6 +1065,13 @@ static void vnc_disconnect_finish(VncState *vs)
}
g_free(vs->lossy_rect);
g_free(vs);
+
+ num_disconnects++;
+ if (allowed_connections > 0 && allowed_connections <= num_disconnects) {
+ VNC_DEBUG("Maximum number of disconnects (%d) reached:"
+ " Session terminating\n", allowed_connections);
+ exit(0);
+ }
}
int vnc_client_io_error(VncState *vs, int ret, int last_errno)
@@ -2844,6 +2853,39 @@ char *vnc_display_local_addr(DisplayState *ds)
return vnc_socket_local_addr("%s:%s", vs->lsock);
}
+static void read_file_password(DisplayState *ds, char *filename)
+{
+ FILE *pfile = NULL;
+ char *passwd = NULL;
+ int start = 0, length = 0, rc = 0;
+
+ if(strlen(filename) == 0) {
+ printf("No file supplied\n");
+ return;
+ }
+
+ pfile = fopen(filename, "r");
+ if(pfile == NULL) {
+ printf("Could not read from %s\n", filename);
+ return;
+ }
+
+ start = ftell(pfile);
+ fseek(pfile, 0L, SEEK_END);
+ length = ftell(pfile);
+ fseek(pfile, 0L, start);
+
+ passwd = malloc(length+1);
+ rc = fread(passwd, 1, length, pfile);
+ fclose(pfile);
+
+ if(rc == length && rc > 0) {
+ vnc_display_password(ds, passwd);
+ }
+
+ free(passwd);
+}
+
int vnc_display_open(DisplayState *ds, const char *display)
{
VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
@@ -2876,6 +2918,9 @@ int vnc_display_open(DisplayState *ds, const char *display)
while ((options = strchr(options, ','))) {
options++;
if (strncmp(options, "password", 8) == 0) {
+ char *start, *end;
+ start = strchr(options, '=');
+ end = strchr(options, ',');
if (fips_get_state()) {
fprintf(stderr,
"VNC password auth disabled due to FIPS mode, "
@@ -2886,6 +2931,32 @@ int vnc_display_open(DisplayState *ds, const char *display)
return -1;
}
password = 1; /* Require password auth */
+ if (start && (!end || (start < end))) {
+ int len = end ? end-(start+1) : strlen(start+1);
+ char *text = g_malloc(len+1);
+ strncpy(text, start+1, len);
+ text[len] = '\0';
+
+ if (strncmp(options, "password-file=", 14) == 0) {
+ read_file_password(ds, text);
+ } else {
+ vnc_display_password(ds, text);
+ }
+
+ free(text);
+ }
+ } else if (strncmp(options, "allowed-connections=", 20) == 0) {
+ char *start, *end;
+ start = strchr(options, '=');
+ end = strchr(options, ',');
+ if (start && (!end || (start < end))) {
+ int len = end ? end-(start+1) : strlen(start+1);
+ char *text = g_malloc(len+1);
+ strncpy(text, start+1, len);
+ text[len] = '\0';
+ VNC_DEBUG("Maximum number of disconnects: %s\n", text);
+ allowed_connections = atoi(text);
+ }
} else if (strncmp(options, "reverse", 7) == 0) {
reverse = 1;
} else if (strncmp(options, "no-lock-key-sync", 16) == 0) {

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1d0d2a4ef8b32d1e7433302edd357351ad83d5798d3fddebc2aab249b463f317
size 9864774

3
qemu-1.2.0-rc3.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:53376f8661790a8b0c7de8af73add2e944e3ea56671488e16c782eaed46e24c9
size 9870152

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Sep 5 09:57:44 UTC 2012 - afaerber@suse.de
- update to v1.2.0-rc3: http://wiki.qemu.org/ChangeLog/1.2
* adapt update_git.sh script
- add two patches from kvm for SUSE Studio, forwarded by Dinar:
* add -nooutgoing option for slirp networking
* add allowed-connections= and password-file= options for VNC
-------------------------------------------------------------------
Tue Aug 28 15:58:56 UTC 2012 - afaerber@suse.de

View File

@ -21,9 +21,9 @@ Url: http://www.qemu.org/
Summary: Universal CPU emulator
License: BSD-3-Clause ; GPL-2.0+ ; LGPL-2.1+ ; MIT
Group: System/Emulators/PC
Version: 1.2.0rc1
Version: 1.2.0rc3
Release: 0
Source: %name-1.2.0-rc1.tar.bz2
Source: %name-1.2.0-rc3.tar.bz2
Patch0001: 0001-Handle-CPU-interrupts-by-inline-che.patch
Patch0002: 0002-XXX-dont-dump-core-on-sigabort.patc.patch
Patch0003: 0003-XXX-work-around-SA_RESTART-race-wit.patch
@ -53,9 +53,10 @@ Patch0026: 0026-linux-user-lock-tb-flushing-too.pat.patch
Patch0027: 0027-linux-user-Fake-proc-cpuinfo.patch.patch
Patch0028: 0028-linux-user-implement-FS_IOC_GETFLAG.patch
Patch0029: 0029-linux-user-implement-FS_IOC_SETFLAG.patch
Patch0030: 0030-linux-user-fix-emulation-of-getdent.patch
Patch0031: 0031-linux-user-fix-statfs.patch.patch
Patch0032: 0032-linux-user-XXX-disable-fiemap.patch.patch
Patch0030: 0030-linux-user-fix-statfs.patch.patch
Patch0031: 0031-linux-user-XXX-disable-fiemap.patch.patch
Patch0032: 0032-slirp-nooutgoing.patch.patch
Patch0033: 0033-vnc-password-file-and-incoming-conn.patch
# this is to make lint happy
Source300: rpmlintrc
Source302: bridge.conf
@ -166,7 +167,7 @@ emulations. This can be used together with the OBS build script to
run cross-architecture builds.
%prep
%setup -q -n qemu-1.2.0-rc1
%setup -q -n qemu-1.2.0-rc3
%patch0001 -p1
%patch0002 -p1
%patch0003 -p1
@ -199,6 +200,7 @@ run cross-architecture builds.
%patch0030 -p1
%patch0031 -p1
%patch0032 -p1
%patch0033 -p1
%build
# build QEMU

View File

@ -21,9 +21,9 @@ Url: http://www.qemu.org/
Summary: Universal CPU emulator
License: BSD-3-Clause ; GPL-2.0+ ; LGPL-2.1+ ; MIT
Group: System/Emulators/PC
Version: 1.2.0rc1
Version: 1.2.0rc3
Release: 0
Source: %name-1.2.0-rc1.tar.bz2
Source: %name-1.2.0-rc3.tar.bz2
PATCH_FILES
# this is to make lint happy
Source300: rpmlintrc
@ -135,7 +135,7 @@ emulations. This can be used together with the OBS build script to
run cross-architecture builds.
%prep
%setup -q -n qemu-1.2.0-rc1
%setup -q -n qemu-1.2.0-rc3
PATCH_EXEC
%build

View File

@ -13,7 +13,7 @@
GIT_TREE=git://repo.or.cz/qemu/agraf.git
GIT_LOCAL_TREE=/suse/agraf/git/qemu
GIT_BRANCH=suse-1.2
GIT_UPSTREAM_TAG=v1.2.0-rc1
GIT_UPSTREAM_TAG=v1.2.0-rc3
QEMU_TMP=/dev/shm/qemu-tmp
# clean up