qemu: update to 3.0.0

This commit is contained in:
Leonid Pliushch 2018-10-26 16:19:03 +03:00 committed by Yaksh Bariya
parent 7a86a07452
commit ca3bcb742e
No known key found for this signature in database
GPG Key ID: F7486BA7D3D27581
35 changed files with 223 additions and 241 deletions

View File

@ -2,10 +2,9 @@ TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
TERMUX_PKG_HOMEPAGE=https://www.qemu.org
TERMUX_PKG_DESCRIPTION="A generic and open source machine emulator (x86_64)"
TERMUX_PKG_VERSION=2.12.1
TERMUX_PKG_REVISION=2
TERMUX_PKG_VERSION=3.0.0
TERMUX_PKG_SRCURL=https://download.qemu.org/qemu-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=33583800e0006cd00b78226b85be5a27c8e3b156bed2e60e83ecbeb7b9b8364f
TERMUX_PKG_SHA256=8d7af64fe8bd5ea5c3bdf17131a8b858491bcce1ee3839425a6d91fb821b5713
TERMUX_PKG_DEPENDS="glib, libandroid-shmem, libandroid-support, libbz2, libc++, libcurl, libgnutls, libjpeg-turbo, liblzo, libnettle, libpixman, libpng, libsasl, libssh2, libutil, ncurses, qemu-common, sdl2"
TERMUX_PKG_BUILD_IN_SRC=true

View File

@ -1,12 +0,0 @@
diff -uNr qemu-2.12.1/contrib/ivshmem-client/main.c qemu-2.12.1.mod/contrib/ivshmem-client/main.c
--- qemu-2.12.1/contrib/ivshmem-client/main.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/contrib/ivshmem-client/main.c 2018-09-17 16:27:46.974062341 +0300
@@ -12,7 +12,7 @@
#include "ivshmem-client.h"
#define IVSHMEM_CLIENT_DEFAULT_VERBOSE 0
-#define IVSHMEM_CLIENT_DEFAULT_UNIX_SOCK_PATH "/tmp/ivshmem_socket"
+#define IVSHMEM_CLIENT_DEFAULT_UNIX_SOCK_PATH "@TERMUX_PREFIX@/tmp/ivshmem_socket"
typedef struct IvshmemClientArgs {
bool verbose;

View File

@ -1,14 +0,0 @@
diff -uNr qemu-2.12.1/contrib/ivshmem-server/main.c qemu-2.12.1.mod/contrib/ivshmem-server/main.c
--- qemu-2.12.1/contrib/ivshmem-server/main.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/contrib/ivshmem-server/main.c 2018-09-17 16:27:46.974062341 +0300
@@ -14,8 +14,8 @@
#define IVSHMEM_SERVER_DEFAULT_VERBOSE 0
#define IVSHMEM_SERVER_DEFAULT_FOREGROUND 0
-#define IVSHMEM_SERVER_DEFAULT_PID_FILE "/var/run/ivshmem-server.pid"
-#define IVSHMEM_SERVER_DEFAULT_UNIX_SOCK_PATH "/tmp/ivshmem_socket"
+#define IVSHMEM_SERVER_DEFAULT_PID_FILE "@TERMUX_PREFIX@/var/run/ivshmem-server.pid"
+#define IVSHMEM_SERVER_DEFAULT_UNIX_SOCK_PATH "@TERMUX_PREFIX@/tmp/ivshmem_socket"
#define IVSHMEM_SERVER_DEFAULT_SHM_PATH "ivshmem"
#define IVSHMEM_SERVER_DEFAULT_SHM_SIZE (4*1024*1024)
#define IVSHMEM_SERVER_DEFAULT_N_VECTORS 1

View File

@ -1,12 +0,0 @@
diff -uNr qemu-2.12.1/hw/usb/ccid-card-emulated.c qemu-2.12.1.mod/hw/usb/ccid-card-emulated.c
--- qemu-2.12.1/hw/usb/ccid-card-emulated.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/hw/usb/ccid-card-emulated.c 2018-09-17 16:27:46.977395694 +0300
@@ -412,7 +412,7 @@
return 0;
}
-#define CERTIFICATES_DEFAULT_DB "/etc/pki/nssdb"
+#define CERTIFICATES_DEFAULT_DB "@TERMUX_PREFIX@/etc/pki/nssdb"
#define CERTIFICATES_ARGS_TEMPLATE\
"db=\"%s\" use_hw=no soft=(,Virtual Reader,CAC,,%s,%s,%s)"

View File

@ -1,12 +0,0 @@
diff -uNr qemu-2.12.1/hw/xenpv/xen_domainbuild.c qemu-2.12.1.mod/hw/xenpv/xen_domainbuild.c
--- qemu-2.12.1/hw/xenpv/xen_domainbuild.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/hw/xenpv/xen_domainbuild.c 2018-09-17 16:27:46.977395694 +0300
@@ -166,7 +166,7 @@
/* close all file handles, except stdio/out/err,
* our watch pipe and the xen interface handle */
- n = getdtablesize();
+ n = sysconf(_SC_OPEN_MAX);
for (i = 3; i < n; i++) {
if (i == fd[0])
continue;

View File

@ -1,48 +0,0 @@
diff -uNr qemu-2.12.1/linux-user/signal.c qemu-2.12.1.mod/linux-user/signal.c
--- qemu-2.12.1/linux-user/signal.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/linux-user/signal.c 2018-09-17 16:27:46.990729107 +0300
@@ -206,6 +206,26 @@
return atomic_xchg(&ts->signal_pending, 1);
}
+#ifdef _NSIG_WORDS
+static int sigorset(sigset_t *dest, const sigset_t *a, const sigset_t *b)
+{
+ int i;
+ if (!dest || !a || !b)
+ return -1;
+ for (i = 0; i < _NSIG_WORDS; i++)
+ dest->sig[i] = a->sig[i] | b->sig[i];
+ return 0;
+}
+#else
+static int sigorset(sigset_t *dest, const sigset_t *a, const sigset_t *b)
+{
+ int i;
+ if (!dest || !a || !b)
+ return -1;
+ *dest = *a | *b;
+ return 0;
+}
+#endif
/* Wrapper for sigprocmask function
* Emulates a sigprocmask in a safe way for the guest. Note that set and oldset
* are host signal set, not guest ones. Returns -TARGET_ERESTARTSYS if
@@ -1418,7 +1438,7 @@
target_stack_t tuc_stack;
target_sigset_t tuc_sigmask;
/* glibc uses a 1024-bit sigset_t */
- char __unused[1024 / 8 - sizeof(target_sigset_t)];
+ char __qemu_unused[1024 / 8 - sizeof(target_sigset_t)];
/* last for future expansion */
struct target_sigcontext tuc_mcontext;
};
@@ -2004,7 +2024,7 @@
target_stack_t tuc_stack;
struct target_sigcontext tuc_mcontext;
target_sigset_t tuc_sigmask; /* mask last for extensibility */
- char __unused[128 - sizeof(target_sigset_t)];
+ char __qemu_unused[128 - sizeof(target_sigset_t)];
abi_ulong tuc_regspace[128] __attribute__((__aligned__(8)));
};

View File

@ -1,12 +0,0 @@
diff -uNr qemu-2.12.1/linux-user/strace.c qemu-2.12.1.mod/linux-user/strace.c
--- qemu-2.12.1/linux-user/strace.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/linux-user/strace.c 2018-09-17 16:27:46.994062461 +0300
@@ -1,7 +1,7 @@
#include "qemu/osdep.h"
#include <sys/ipc.h>
#include <sys/msg.h>
-#include <sys/sem.h>
+#include <linux/sem.h>
#include <sys/shm.h>
#include <sys/select.h>
#include <sys/mount.h>

View File

@ -1,11 +0,0 @@
diff -uNr qemu-2.12.1/os-posix.c qemu-2.12.1.mod/os-posix.c
--- qemu-2.12.1/os-posix.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/os-posix.c 2018-09-17 16:27:47.014062580 +0300
@@ -36,6 +36,7 @@
#include "qemu/error-report.h"
#include "qemu/log.h"
#include "qemu/cutils.h"
+#include "lockf_implementation.h"
#ifdef CONFIG_LINUX
#include <sys/prctl.h>

View File

@ -1,12 +0,0 @@
diff -uNr qemu-2.12.1/scsi/qemu-pr-helper.c qemu-2.12.1.mod/scsi/qemu-pr-helper.c
--- qemu-2.12.1/scsi/qemu-pr-helper.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/scsi/qemu-pr-helper.c 2018-09-17 16:27:47.020729287 +0300
@@ -24,6 +24,8 @@
#include <linux/dm-ioctl.h>
#include <scsi/sg.h>
+#include "lockf_implementation.h"
+
#ifdef CONFIG_LIBCAP
#include <cap-ng.h>
#endif

View File

@ -1,12 +0,0 @@
diff -uNr qemu-2.12.1/slirp/misc.c qemu-2.12.1.mod/slirp/misc.c
--- qemu-2.12.1/slirp/misc.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/slirp/misc.c 2018-09-17 16:27:47.020729287 +0300
@@ -146,7 +146,7 @@
dup2(s, 0);
dup2(s, 1);
dup2(s, 2);
- for (s = getdtablesize() - 1; s >= 3; s--)
+ for (s = sysconf(_SC_OPEN_MAX) - 1; s >= 3; s--)
close(s);
i = 0;

View File

@ -1,6 +1,6 @@
diff -uNr qemu-2.12.1/audio/ossaudio.c qemu-2.12.1.mod/audio/ossaudio.c
--- qemu-2.12.1/audio/ossaudio.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/audio/ossaudio.c 2018-09-17 16:27:46.947395515 +0300
diff -uNr qemu-3.0.0/audio/ossaudio.c qemu-3.0.0.mod/audio/ossaudio.c
--- qemu-3.0.0/audio/ossaudio.c 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/audio/ossaudio.c 2018-10-26 15:33:11.243105139 +0300
@@ -23,7 +23,7 @@
*/
#include "qemu/osdep.h"

View File

@ -1,7 +1,7 @@
diff -uNr qemu-2.12.1/block.c qemu-2.12.1.mod/block.c
--- qemu-2.12.1/block.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/block.c 2018-09-17 16:27:46.960728928 +0300
@@ -544,7 +544,7 @@
diff -uNr qemu-3.0.0/block.c qemu-3.0.0.mod/block.c
--- qemu-3.0.0/block.c 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/block.c 2018-10-26 15:33:11.249771868 +0300
@@ -549,7 +549,7 @@
const char *tmpdir;
tmpdir = getenv("TMPDIR");
if (!tmpdir) {

View File

@ -1,6 +1,6 @@
diff -uNr qemu-2.12.1/block/cloop.c qemu-2.12.1.mod/block/cloop.c
--- qemu-2.12.1/block/cloop.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/block/cloop.c 2018-09-17 16:27:46.950728869 +0300
diff -uNr qemu-3.0.0/block/cloop.c qemu-3.0.0.mod/block/cloop.c
--- qemu-3.0.0/block/cloop.c 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/block/cloop.c 2018-10-26 15:33:11.246438503 +0300
@@ -47,7 +47,7 @@
static int cloop_probe(const uint8_t *buf, int buf_size, const char *filename)

View File

@ -1,7 +1,7 @@
diff -uNr qemu-2.12.1/configure qemu-2.12.1.mod/configure
--- qemu-2.12.1/configure 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/configure 2018-09-17 16:27:46.964062281 +0300
@@ -2081,23 +2081,10 @@
diff -uNr qemu-3.0.0/configure qemu-3.0.0.mod/configure
--- qemu-3.0.0/configure 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/configure 2018-10-26 15:33:11.256438597 +0300
@@ -2158,23 +2158,10 @@
LIBS="$LIBS -lz"
##########################################
@ -28,7 +28,7 @@ diff -uNr qemu-2.12.1/configure qemu-2.12.1.mod/configure
##########################################
# snappy check
@@ -2119,22 +2106,9 @@
@@ -2196,22 +2183,9 @@
fi
##########################################
@ -53,7 +53,7 @@ diff -uNr qemu-2.12.1/configure qemu-2.12.1.mod/configure
##########################################
# libseccomp check
@@ -2976,6 +2950,7 @@
@@ -3069,6 +3043,7 @@
# VNC SASL detection
if test "$vnc" = "yes" -a "$vnc_sasl" != "no" ; then
cat > $TMPC <<EOF
@ -61,7 +61,7 @@ diff -uNr qemu-2.12.1/configure qemu-2.12.1.mod/configure
#include <sasl/sasl.h>
#include <stdio.h>
int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
@@ -4037,16 +4012,6 @@
@@ -4126,16 +4101,6 @@
##########################################
# signalfd probe
signalfd="no"
@ -78,7 +78,7 @@ diff -uNr qemu-2.12.1/configure qemu-2.12.1.mod/configure
# check if eventfd is supported
eventfd=no
@@ -5492,7 +5457,7 @@
@@ -5622,7 +5587,7 @@
# We can only support ivshmem if we have eventfd
if [ "$eventfd" = "yes" ]; then

View File

@ -0,0 +1,12 @@
diff -uNr qemu-3.0.0/hw/usb/ccid-card-emulated.c qemu-3.0.0.mod/hw/usb/ccid-card-emulated.c
--- qemu-3.0.0/hw/usb/ccid-card-emulated.c 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/hw/usb/ccid-card-emulated.c 2018-10-26 15:33:11.259771962 +0300
@@ -409,7 +409,7 @@
return 0;
}
-#define CERTIFICATES_DEFAULT_DB "/etc/pki/nssdb"
+#define CERTIFICATES_DEFAULT_DB "@TERMUX_PREFIX@/etc/pki/nssdb"
#define CERTIFICATES_ARGS_TEMPLATE\
"db=\"%s\" use_hw=no soft=(,Virtual Reader,CAC,,%s,%s,%s)"

View File

@ -0,0 +1,12 @@
diff -uNr qemu-3.0.0/hw/xenpv/xen_domainbuild.c qemu-3.0.0.mod/hw/xenpv/xen_domainbuild.c
--- qemu-3.0.0/hw/xenpv/xen_domainbuild.c 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/hw/xenpv/xen_domainbuild.c 2018-10-26 15:33:11.259771962 +0300
@@ -167,7 +167,7 @@
/* close all file handles, except stdio/out/err,
* our watch pipe and the xen interface handle */
- n = getdtablesize();
+ n = sysconf(_SC_OPEN_MAX);
for (i = 3; i < n; i++) {
if (i == fd[0])
continue;

View File

@ -1,7 +1,7 @@
diff -uNr qemu-2.12.1/include/net/net.h qemu-2.12.1.mod/include/net/net.h
--- qemu-2.12.1/include/net/net.h 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/include/net/net.h 2018-09-17 16:27:46.984062401 +0300
@@ -217,8 +217,8 @@
diff -uNr qemu-3.0.0/include/net/net.h qemu-3.0.0.mod/include/net/net.h
--- qemu-3.0.0/include/net/net.h 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/include/net/net.h 2018-10-26 15:33:11.263105327 +0300
@@ -216,8 +216,8 @@
int net_hub_id_for_client(NetClientState *nc, int *id);
NetClientState *net_hub_port_find(int hub_id);

View File

@ -0,0 +1,12 @@
diff -uNr qemu-3.0.0/linux-user/aarch64/signal.c qemu-3.0.0.mod/linux-user/aarch64/signal.c
--- qemu-3.0.0/linux-user/aarch64/signal.c 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/linux-user/aarch64/signal.c 2018-10-26 15:33:35.159997747 +0300
@@ -38,7 +38,7 @@
target_stack_t tuc_stack;
target_sigset_t tuc_sigmask;
/* glibc uses a 1024-bit sigset_t */
- char __unused[1024 / 8 - sizeof(target_sigset_t)];
+ char __qemu_unused[1024 / 8 - sizeof(target_sigset_t)];
/* last for future expansion */
struct target_sigcontext tuc_mcontext;
};

View File

@ -0,0 +1,12 @@
diff -uNr qemu-3.0.0/linux-user/arm/signal.c qemu-3.0.0.mod/linux-user/arm/signal.c
--- qemu-3.0.0/linux-user/arm/signal.c 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/linux-user/arm/signal.c 2018-10-26 16:04:01.381418576 +0300
@@ -59,7 +59,7 @@
target_stack_t tuc_stack;
struct target_sigcontext tuc_mcontext;
target_sigset_t tuc_sigmask; /* mask last for extensibility */
- char __unused[128 - sizeof(target_sigset_t)];
+ char __qemu_unused[128 - sizeof(target_sigset_t)];
abi_ulong tuc_regspace[128] __attribute__((__aligned__(8)));
};

View File

@ -0,0 +1,31 @@
diff -uNr qemu-3.0.0/linux-user/signal.c qemu-3.0.0.mod/linux-user/signal.c
--- qemu-3.0.0/linux-user/signal.c 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/linux-user/signal.c 2018-10-26 15:33:11.266438691 +0300
@@ -189,6 +189,27 @@
return atomic_xchg(&ts->signal_pending, 1);
}
+#ifdef _NSIG_WORDS
+static int sigorset(sigset_t *dest, const sigset_t *a, const sigset_t *b)
+{
+ int i;
+ if (!dest || !a || !b)
+ return -1;
+ for (i = 0; i < _NSIG_WORDS; i++)
+ dest->sig[i] = a->sig[i] | b->sig[i];
+ return 0;
+}
+#else
+static int sigorset(sigset_t *dest, const sigset_t *a, const sigset_t *b)
+{
+ int i;
+ if (!dest || !a || !b)
+ return -1;
+ *dest = *a | *b;
+ return 0;
+}
+#endif
+
/* Wrapper for sigprocmask function
* Emulates a sigprocmask in a safe way for the guest. Note that set and oldset
* are host signal set, not guest ones. Returns -TARGET_ERESTARTSYS if

View File

@ -0,0 +1,12 @@
diff -uNr qemu-3.0.0/linux-user/strace.c qemu-3.0.0.mod/linux-user/strace.c
--- qemu-3.0.0/linux-user/strace.c 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/linux-user/strace.c 2018-10-26 15:33:11.269772056 +0300
@@ -1,7 +1,7 @@
#include "qemu/osdep.h"
#include <sys/ipc.h>
#include <sys/msg.h>
-#include <sys/sem.h>
+#include <linux/sem.h>
#include <sys/shm.h>
#include <sys/select.h>
#include <sys/mount.h>

View File

@ -1,6 +1,6 @@
diff -uNr qemu-2.12.1/linux-user/syscall.c qemu-2.12.1.mod/linux-user/syscall.c
--- qemu-2.12.1/linux-user/syscall.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/linux-user/syscall.c 2018-09-17 16:27:46.997395814 +0300
diff -uNr qemu-3.0.0/linux-user/syscall.c qemu-3.0.0.mod/linux-user/syscall.c
--- qemu-3.0.0/linux-user/syscall.c 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/linux-user/syscall.c 2018-10-26 15:33:11.273105420 +0300
@@ -42,7 +42,7 @@
#include <poll.h>
#include <sys/times.h>
@ -27,8 +27,8 @@ diff -uNr qemu-2.12.1/linux-user/syscall.c qemu-2.12.1.mod/linux-user/syscall.c
#include <linux/termios.h>
#include <linux/unistd.h>
#include <linux/cdrom.h>
@@ -250,6 +254,64 @@
#define TARGET_NR__llseek TARGET_NR_llseek
@@ -245,11 +249,67 @@
#define __NR__llseek __NR_lseek
#endif
+_syscall0(int, vhangup)
@ -38,21 +38,20 @@ diff -uNr qemu-2.12.1/linux-user/syscall.c qemu-2.12.1.mod/linux-user/syscall.c
+static int
+msgctl (int msqid, int cmd, struct msqid_ds *buf)
+{
+ return syscall (__NR_ipc, IPCOP_msgctl,
+ msqid, cmd | 0x100, 0, buf);
+ return syscall (__NR_ipc, IPCOP_msgctl, msqid, cmd | 0x100, 0, buf);
+}
+#endif
+
+#ifdef __NR_semget
+_syscall3(int, semget, key_t, key, int, nsems, int, semflg)
+#else
+static int
+semget (key_t key,
+ int nsems,
+ int semflg)
+semget (key_t key, int nsems, int semflg)
+{
+ return syscall (__NR_ipc, IPCOP_semget, key, nsems, semflg, NULL);
+}
+#endif
+
+_syscall1(int, adjtimex, struct timex *, buf)
+_syscall2(int, sethostname, const char *, name, size_t, len)
+_syscall2(int, setdomainname, const char *, name, size_t, len)
@ -60,8 +59,7 @@ diff -uNr qemu-2.12.1/linux-user/syscall.c qemu-2.12.1.mod/linux-user/syscall.c
+_syscall2(int, msgget, key_t, key, int, msgflg)
+#else
+static int
+msgget (key_t key,
+ int msgflg)
+msgget (key_t key, int msgflg)
+{
+ return syscall(__NR_ipc, 5, IPCOP_msgget, key, msgflg, 0, NULL);
+}
@ -88,19 +86,24 @@ diff -uNr qemu-2.12.1/linux-user/syscall.c qemu-2.12.1.mod/linux-user/syscall.c
+}
+#endif
+
/* Newer kernel ports have llseek() instead of _llseek() */
#if defined(TARGET_NR_llseek) && !defined(TARGET_NR__llseek)
#define TARGET_NR__llseek TARGET_NR_llseek
#endif
+#if 0
#ifdef __NR_gettid
_syscall0(int, gettid)
#else
@@ -259,6 +321,7 @@
@@ -259,6 +319,7 @@
return -ENOSYS;
}
#endif
+#endif
#if defined(TARGET_NR_getdents) && defined(__NR_getdents)
_syscall3(int, sys_getdents, uint, fd, struct linux_dirent *, dirp, uint, count);
#endif
@@ -1028,6 +1091,9 @@
/* For the 64-bit guest on 32-bit host case we must emulate
* getdents using getdents64, because otherwise the host
@@ -1058,6 +1119,9 @@
size_t, len, unsigned, prio, const struct timespec *, timeout)
safe_syscall5(int, mq_timedreceive, int, mqdes, char *, msg_ptr,
size_t, len, unsigned *, prio, const struct timespec *, timeout)
@ -110,7 +113,7 @@ diff -uNr qemu-2.12.1/linux-user/syscall.c qemu-2.12.1.mod/linux-user/syscall.c
#endif
/* We do ioctl like this rather than via safe_syscall3 to preserve the
* "third argument might be integer or pointer or not present" behaviour of
@@ -1406,7 +1472,7 @@
@@ -1436,7 +1500,7 @@
}
#if defined(TARGET_NR_mq_open) && defined(__NR_mq_open)
@ -119,7 +122,7 @@ diff -uNr qemu-2.12.1/linux-user/syscall.c qemu-2.12.1.mod/linux-user/syscall.c
static inline abi_long copy_from_user_mq_attr(struct mq_attr *attr,
abi_ulong target_mq_attr_addr)
@@ -4290,6 +4356,8 @@
@@ -4362,6 +4426,8 @@
return 0;
}
@ -128,7 +131,7 @@ diff -uNr qemu-2.12.1/linux-user/syscall.c qemu-2.12.1.mod/linux-user/syscall.c
static inline abi_long target_to_host_semid_ds(struct semid_ds *host_sd,
abi_ulong target_addr)
{
@@ -4369,6 +4437,16 @@
@@ -4441,6 +4507,16 @@
abi_ulong __buf;
};
@ -145,7 +148,7 @@ diff -uNr qemu-2.12.1/linux-user/syscall.c qemu-2.12.1.mod/linux-user/syscall.c
static inline abi_long target_to_host_semarray(int semid, unsigned short **host_array,
abi_ulong target_addr)
{
@@ -4499,7 +4577,7 @@
@@ -4571,7 +4647,7 @@
case GETPID:
case GETNCNT:
case GETZCNT:
@ -154,7 +157,7 @@ diff -uNr qemu-2.12.1/linux-user/syscall.c qemu-2.12.1.mod/linux-user/syscall.c
break;
}
@@ -4581,7 +4659,7 @@
@@ -4653,7 +4729,7 @@
host_md->msg_stime = tswapal(target_md->msg_stime);
host_md->msg_rtime = tswapal(target_md->msg_rtime);
host_md->msg_ctime = tswapal(target_md->msg_ctime);
@ -163,7 +166,7 @@ diff -uNr qemu-2.12.1/linux-user/syscall.c qemu-2.12.1.mod/linux-user/syscall.c
host_md->msg_qnum = tswapal(target_md->msg_qnum);
host_md->msg_qbytes = tswapal(target_md->msg_qbytes);
host_md->msg_lspid = tswapal(target_md->msg_lspid);
@@ -4602,7 +4680,7 @@
@@ -4674,7 +4750,7 @@
target_md->msg_stime = tswapal(host_md->msg_stime);
target_md->msg_rtime = tswapal(host_md->msg_rtime);
target_md->msg_ctime = tswapal(host_md->msg_ctime);
@ -172,7 +175,7 @@ diff -uNr qemu-2.12.1/linux-user/syscall.c qemu-2.12.1.mod/linux-user/syscall.c
target_md->msg_qnum = tswapal(host_md->msg_qnum);
target_md->msg_qbytes = tswapal(host_md->msg_qbytes);
target_md->msg_lspid = tswapal(host_md->msg_lspid);
@@ -5673,6 +5751,9 @@
@@ -5745,6 +5821,9 @@
}
#endif
@ -182,7 +185,7 @@ diff -uNr qemu-2.12.1/linux-user/syscall.c qemu-2.12.1.mod/linux-user/syscall.c
static IOCTLEntry ioctl_entries[] = {
#define IOCTL(cmd, access, ...) \
{ TARGET_ ## cmd, cmd, #cmd, access, 0, { __VA_ARGS__ } },
@@ -7691,7 +7772,7 @@
@@ -7827,7 +7906,7 @@
/* create temporary file to map stat to */
tmpdir = getenv("TMPDIR");
if (!tmpdir)
@ -191,7 +194,7 @@ diff -uNr qemu-2.12.1/linux-user/syscall.c qemu-2.12.1.mod/linux-user/syscall.c
snprintf(filename, sizeof(filename), "%s/qemu-open.XXXXXX", tmpdir);
fd = mkstemp(filename);
if (fd < 0) {
@@ -8310,7 +8391,7 @@
@@ -8443,7 +8522,7 @@
unlock_user(p, arg1, 0);
break;
#endif
@ -200,7 +203,7 @@ diff -uNr qemu-2.12.1/linux-user/syscall.c qemu-2.12.1.mod/linux-user/syscall.c
case TARGET_NR_stime:
{
time_t host_time;
@@ -8381,7 +8462,7 @@
@@ -8514,7 +8593,7 @@
}
break;
#endif
@ -209,16 +212,15 @@ diff -uNr qemu-2.12.1/linux-user/syscall.c qemu-2.12.1.mod/linux-user/syscall.c
case TARGET_NR_futimesat:
{
struct timeval *tvp, tv[2];
@@ -12125,7 +12206,7 @@
/* Not implemented for now... */
@@ -12257,6 +12336,7 @@
/* case TARGET_NR_mq_notify: */
/* break; */
-
+#if 0
case TARGET_NR_mq_getsetattr:
{
struct mq_attr posix_mq_attr_in, posix_mq_attr_out;
@@ -12143,6 +12224,7 @@
@@ -12274,6 +12354,7 @@
}
break;
#endif

View File

@ -1,7 +1,7 @@
diff -uNr qemu-2.12.1/linux-user/syscall_defs.h qemu-2.12.1.mod/linux-user/syscall_defs.h
--- qemu-2.12.1/linux-user/syscall_defs.h 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/linux-user/syscall_defs.h 2018-09-17 16:27:47.007395873 +0300
@@ -1967,7 +1967,7 @@
diff -uNr qemu-3.0.0/linux-user/syscall_defs.h qemu-3.0.0.mod/linux-user/syscall_defs.h
--- qemu-3.0.0/linux-user/syscall_defs.h 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/linux-user/syscall_defs.h 2018-10-26 15:33:11.276438785 +0300
@@ -1698,7 +1698,7 @@
abi_ulong target_st_mtime_nsec;
abi_ulong target_st_ctime;
abi_ulong target_st_ctime_nsec;
@ -10,7 +10,7 @@ diff -uNr qemu-2.12.1/linux-user/syscall_defs.h qemu-2.12.1.mod/linux-user/sysca
};
#elif defined(TARGET_SH4)
@@ -2052,7 +2052,7 @@
@@ -1783,7 +1783,7 @@
abi_ulong target_st_ctime;
abi_ulong target_st_ctime_nsec;
@ -19,7 +19,7 @@ diff -uNr qemu-2.12.1/linux-user/syscall_defs.h qemu-2.12.1.mod/linux-user/sysca
};
#elif defined(TARGET_S390X)
struct target_stat {
@@ -2073,7 +2073,7 @@
@@ -1804,7 +1804,7 @@
abi_ulong target_st_ctime_nsec;
abi_ulong st_blksize;
abi_long st_blocks;
@ -28,7 +28,7 @@ diff -uNr qemu-2.12.1/linux-user/syscall_defs.h qemu-2.12.1.mod/linux-user/sysca
};
#elif defined(TARGET_AARCH64)
struct target_stat {
@@ -2095,7 +2095,7 @@
@@ -1826,7 +1826,7 @@
abi_ulong target_st_mtime_nsec;
abi_long target_st_ctime;
abi_ulong target_st_ctime_nsec;

View File

@ -1,6 +1,6 @@
diff -uNr qemu-2.12.1/lockf_implementation.h qemu-2.12.1.mod/lockf_implementation.h
--- qemu-2.12.1/lockf_implementation.h 1970-01-01 03:00:00.000000000 +0300
+++ qemu-2.12.1.mod/lockf_implementation.h 2018-09-17 16:27:47.010729227 +0300
diff -uNr qemu-3.0.0/lockf_implementation.h qemu-3.0.0.mod/lockf_implementation.h
--- qemu-3.0.0/lockf_implementation.h 1970-01-01 03:00:00.000000000 +0300
+++ qemu-3.0.0.mod/lockf_implementation.h 2018-10-26 15:33:11.283105515 +0300
@@ -0,0 +1,56 @@
+#ifndef LOCKF_IMPLEMENTATION_H
+#define LOCKF_IMPLEMENTATION_H

View File

@ -1,7 +1,7 @@
diff -uNr qemu-2.12.1/migration/exec.c qemu-2.12.1.mod/migration/exec.c
--- qemu-2.12.1/migration/exec.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/migration/exec.c 2018-09-17 16:27:47.010729227 +0300
@@ -27,7 +27,7 @@
diff -uNr qemu-3.0.0/migration/exec.c qemu-3.0.0.mod/migration/exec.c
--- qemu-3.0.0/migration/exec.c 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/migration/exec.c 2018-10-26 15:33:11.283105515 +0300
@@ -28,7 +28,7 @@
void exec_start_outgoing_migration(MigrationState *s, const char *command, Error **errp)
{
QIOChannel *ioc;
@ -10,7 +10,7 @@ diff -uNr qemu-2.12.1/migration/exec.c qemu-2.12.1.mod/migration/exec.c
trace_migration_exec_outgoing(command);
ioc = QIO_CHANNEL(qio_channel_command_new_spawn(argv,
@@ -54,7 +54,7 @@
@@ -55,7 +55,7 @@
void exec_start_incoming_migration(const char *command, Error **errp)
{
QIOChannel *ioc;

View File

@ -1,6 +1,6 @@
diff -uNr qemu-2.12.1/net/tap.c qemu-2.12.1.mod/net/tap.c
--- qemu-2.12.1/net/tap.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/net/tap.c 2018-09-17 16:27:47.014062580 +0300
diff -uNr qemu-3.0.0/net/tap.c qemu-3.0.0.mod/net/tap.c
--- qemu-3.0.0/net/tap.c 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/net/tap.c 2018-10-26 15:33:11.286438879 +0300
@@ -526,7 +526,7 @@
*parg++ = helper_cmd;
*parg++ = NULL;

View File

@ -0,0 +1,11 @@
diff -uNr qemu-3.0.0/os-posix.c qemu-3.0.0.mod/os-posix.c
--- qemu-3.0.0/os-posix.c 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/os-posix.c 2018-10-26 15:33:11.289772244 +0300
@@ -36,6 +36,7 @@
#include "qemu/error-report.h"
#include "qemu/log.h"
#include "qemu/cutils.h"
+#include "lockf_implementation.h"
#ifdef CONFIG_LINUX
#include <sys/prctl.h>

View File

@ -1,6 +1,6 @@
diff -uNr qemu-2.12.1/qemu-nbd.c qemu-2.12.1.mod/qemu-nbd.c
--- qemu-2.12.1/qemu-nbd.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/qemu-nbd.c 2018-09-17 16:27:47.017395933 +0300
diff -uNr qemu-3.0.0/qemu-nbd.c qemu-3.0.0.mod/qemu-nbd.c
--- qemu-3.0.0/qemu-nbd.c 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/qemu-nbd.c 2018-10-26 15:33:11.289772244 +0300
@@ -43,7 +43,7 @@
#include "trace/control.h"
#include "qemu-version.h"

View File

@ -1,6 +1,6 @@
diff -uNr qemu-2.12.1/qga/main.c qemu-2.12.1.mod/qga/main.c
--- qemu-2.12.1/qga/main.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/qga/main.c 2018-09-17 16:27:47.017395933 +0300
diff -uNr qemu-3.0.0/qga/main.c qemu-3.0.0.mod/qga/main.c
--- qemu-3.0.0/qga/main.c 2018-08-14 22:10:34.000000000 +0300
+++ qemu-3.0.0.mod/qga/main.c 2018-10-26 15:33:11.293105608 +0300
@@ -45,6 +45,8 @@
#endif
#endif

View File

@ -0,0 +1,12 @@
diff -uNr qemu-3.0.0/scsi/qemu-pr-helper.c qemu-3.0.0.mod/scsi/qemu-pr-helper.c
--- qemu-3.0.0/scsi/qemu-pr-helper.c 2018-08-14 22:10:35.000000000 +0300
+++ qemu-3.0.0.mod/scsi/qemu-pr-helper.c 2018-10-26 15:33:11.296438974 +0300
@@ -24,6 +24,8 @@
#include <linux/dm-ioctl.h>
#include <scsi/sg.h>
+#include "lockf_implementation.h"
+
#ifdef CONFIG_LIBCAP
#include <cap-ng.h>
#endif

View File

@ -0,0 +1,12 @@
diff -uNr qemu-3.0.0/slirp/misc.c qemu-3.0.0.mod/slirp/misc.c
--- qemu-3.0.0/slirp/misc.c 2018-08-14 22:10:35.000000000 +0300
+++ qemu-3.0.0.mod/slirp/misc.c 2018-10-26 15:33:11.299772338 +0300
@@ -146,7 +146,7 @@
dup2(s, 0);
dup2(s, 1);
dup2(s, 2);
- for (s = getdtablesize() - 1; s >= 3; s--)
+ for (s = sysconf(_SC_OPEN_MAX) - 1; s >= 3; s--)
close(s);
i = 0;

View File

@ -1,6 +1,6 @@
diff -uNr qemu-2.12.1/slirp/slirp.c qemu-2.12.1.mod/slirp/slirp.c
--- qemu-2.12.1/slirp/slirp.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/slirp/slirp.c 2018-09-17 16:27:47.024062640 +0300
diff -uNr qemu-3.0.0/slirp/slirp.c qemu-3.0.0.mod/slirp/slirp.c
--- qemu-3.0.0/slirp/slirp.c 2018-08-14 22:10:35.000000000 +0300
+++ qemu-3.0.0.mod/slirp/slirp.c 2018-10-26 15:33:11.299772338 +0300
@@ -133,7 +133,7 @@
return 0;
}

View File

@ -1,6 +1,6 @@
diff -uNr qemu-2.12.1/tcg/i386/tcg-target.inc.c qemu-2.12.1.mod/tcg/i386/tcg-target.inc.c
--- qemu-2.12.1/tcg/i386/tcg-target.inc.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/tcg/i386/tcg-target.inc.c 2018-09-17 16:27:47.027395993 +0300
diff -uNr qemu-3.0.0/tcg/i386/tcg-target.inc.c qemu-3.0.0.mod/tcg/i386/tcg-target.inc.c
--- qemu-3.0.0/tcg/i386/tcg-target.inc.c 2018-08-14 22:10:35.000000000 +0300
+++ qemu-3.0.0.mod/tcg/i386/tcg-target.inc.c 2018-10-26 15:33:11.303105703 +0300
@@ -1869,8 +1869,12 @@
#elif defined(__x86_64__) && defined(__linux__)
# include <asm/prctl.h>

View File

@ -1,7 +1,7 @@
diff -uNr qemu-2.12.1/tcg/tcg.c qemu-2.12.1.mod/tcg/tcg.c
--- qemu-2.12.1/tcg/tcg.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/tcg/tcg.c 2018-09-17 16:27:47.027395993 +0300
@@ -3731,7 +3731,7 @@
diff -uNr qemu-3.0.0/tcg/tcg.c qemu-3.0.0.mod/tcg/tcg.c
--- qemu-3.0.0/tcg/tcg.c 2018-08-14 22:10:35.000000000 +0300
+++ qemu-3.0.0.mod/tcg/tcg.c 2018-10-26 15:33:11.306439067 +0300
@@ -3909,7 +3909,7 @@
/* Enable this block to be able to debug the ELF image file creation.
One can use readelf, objdump, or other inspection utilities. */
{

View File

@ -1,6 +1,6 @@
diff -uNr qemu-2.12.1/util/qemu-sockets.c qemu-2.12.1.mod/util/qemu-sockets.c
--- qemu-2.12.1/util/qemu-sockets.c 2018-08-03 00:48:53.000000000 +0300
+++ qemu-2.12.1.mod/util/qemu-sockets.c 2018-09-17 16:27:47.030729346 +0300
diff -uNr qemu-3.0.0/util/qemu-sockets.c qemu-3.0.0.mod/util/qemu-sockets.c
--- qemu-3.0.0/util/qemu-sockets.c 2018-08-14 22:10:35.000000000 +0300
+++ qemu-3.0.0.mod/util/qemu-sockets.c 2018-10-26 15:33:11.309772432 +0300
@@ -841,7 +841,7 @@
path = saddr->path;
} else {