qemu-common: move v4.0.0 to disabled packages
Completely broken.
This commit is contained in:
parent
9446f844fc
commit
0d3510ba65
@ -1,254 +0,0 @@
|
||||
diff -uNr qemu-4.0.0/block.c qemu-4.0.0.mod/block.c
|
||||
--- qemu-4.0.0/block.c 2019-04-23 21:14:45.000000000 +0300
|
||||
+++ qemu-4.0.0.mod/block.c 2019-04-30 15:48:40.350266539 +0300
|
||||
@@ -603,20 +603,26 @@
|
||||
int fd;
|
||||
const char *tmpdir;
|
||||
tmpdir = getenv("TMPDIR");
|
||||
+
|
||||
if (!tmpdir) {
|
||||
- tmpdir = "/var/tmp";
|
||||
+ tmpdir = "@TERMUX_PREFIX@/tmp";
|
||||
}
|
||||
+
|
||||
if (snprintf(filename, size, "%s/vl.XXXXXX", tmpdir) >= size) {
|
||||
return -EOVERFLOW;
|
||||
}
|
||||
+
|
||||
fd = mkstemp(filename);
|
||||
+
|
||||
if (fd < 0) {
|
||||
return -errno;
|
||||
}
|
||||
+
|
||||
if (close(fd) != 0) {
|
||||
unlink(filename);
|
||||
return -errno;
|
||||
}
|
||||
+
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
diff -uNr qemu-4.0.0/hw/usb/ccid-card-emulated.c qemu-4.0.0.mod/hw/usb/ccid-card-emulated.c
|
||||
--- qemu-4.0.0/hw/usb/ccid-card-emulated.c 2019-04-23 21:14:46.000000000 +0300
|
||||
+++ qemu-4.0.0.mod/hw/usb/ccid-card-emulated.c 2019-04-30 15:50:31.485832837 +0300
|
||||
@@ -415,7 +415,6 @@
|
||||
event_notifier_cleanup(&card->notifier);
|
||||
}
|
||||
|
||||
-#define CERTIFICATES_DEFAULT_DB "/etc/pki/nssdb"
|
||||
#define CERTIFICATES_ARGS_TEMPLATE\
|
||||
"db=\"%s\" use_hw=no soft=(,Virtual Reader,CAC,,%s,%s,%s)"
|
||||
|
||||
@@ -445,13 +444,16 @@
|
||||
VCardEmulOptions *options = NULL;
|
||||
|
||||
snprintf(emul_args, sizeof(emul_args) - 1, CERTIFICATES_ARGS_TEMPLATE,
|
||||
- card->db ? card->db : CERTIFICATES_DEFAULT_DB,
|
||||
+ card->db ? card->db : "@TERMUX_PREFIX@/etc/pki/nssdb",
|
||||
card->cert1, card->cert2, card->cert3);
|
||||
+
|
||||
options = vcard_emul_options(emul_args);
|
||||
+
|
||||
if (options == NULL) {
|
||||
printf("%s: warning: not using certificates due to"
|
||||
" initialization error\n", __func__);
|
||||
}
|
||||
+
|
||||
return wrap_vcard_emul_init(options);
|
||||
}
|
||||
|
||||
diff -uNr qemu-4.0.0/include/net/net.h qemu-4.0.0.mod/include/net/net.h
|
||||
--- qemu-4.0.0/include/net/net.h 2019-04-23 21:14:46.000000000 +0300
|
||||
+++ qemu-4.0.0.mod/include/net/net.h 2019-04-30 15:47:35.503933215 +0300
|
||||
@@ -209,8 +209,6 @@
|
||||
int net_hub_id_for_client(NetClientState *nc, int *id);
|
||||
NetClientState *net_hub_port_find(int hub_id);
|
||||
|
||||
-#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
|
||||
-#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
|
||||
#define DEFAULT_BRIDGE_HELPER CONFIG_QEMU_HELPERDIR "/qemu-bridge-helper"
|
||||
#define DEFAULT_BRIDGE_INTERFACE "br0"
|
||||
|
||||
diff -uNr qemu-4.0.0/linux-user/syscall.c qemu-4.0.0.mod/linux-user/syscall.c
|
||||
--- qemu-4.0.0/linux-user/syscall.c 2019-04-23 21:14:46.000000000 +0300
|
||||
+++ qemu-4.0.0.mod/linux-user/syscall.c 2019-04-30 15:51:37.599167189 +0300
|
||||
@@ -6833,7 +6833,7 @@
|
||||
/* create temporary file to map stat to */
|
||||
tmpdir = getenv("TMPDIR");
|
||||
if (!tmpdir)
|
||||
- tmpdir = "/tmp";
|
||||
+ tmpdir = "@TERMUX_PREFIX@/tmp";
|
||||
snprintf(filename, sizeof(filename), "%s/qemu-open.XXXXXX", tmpdir);
|
||||
fd = mkstemp(filename);
|
||||
if (fd < 0) {
|
||||
diff -uNr qemu-4.0.0/migration/exec.c qemu-4.0.0.mod/migration/exec.c
|
||||
--- qemu-4.0.0/migration/exec.c 2019-04-23 21:14:46.000000000 +0300
|
||||
+++ qemu-4.0.0.mod/migration/exec.c 2019-04-30 15:52:19.661379049 +0300
|
||||
@@ -28,7 +28,7 @@
|
||||
void exec_start_outgoing_migration(MigrationState *s, const char *command, Error **errp)
|
||||
{
|
||||
QIOChannel *ioc;
|
||||
- const char *argv[] = { "/bin/sh", "-c", command, NULL };
|
||||
+ const char *argv[] = { "@TERMUX_PREFIX@/bin/sh", "-c", command, NULL };
|
||||
|
||||
trace_migration_exec_outgoing(command);
|
||||
ioc = QIO_CHANNEL(qio_channel_command_new_spawn(argv,
|
||||
@@ -55,7 +55,7 @@
|
||||
void exec_start_incoming_migration(const char *command, Error **errp)
|
||||
{
|
||||
QIOChannel *ioc;
|
||||
- const char *argv[] = { "/bin/sh", "-c", command, NULL };
|
||||
+ const char *argv[] = { "@TERMUX_PREFIX@/bin/sh", "-c", command, NULL };
|
||||
|
||||
trace_migration_exec_incoming(command);
|
||||
ioc = QIO_CHANNEL(qio_channel_command_new_spawn(argv,
|
||||
diff -uNr qemu-4.0.0/net/tap.c qemu-4.0.0.mod/net/tap.c
|
||||
--- qemu-4.0.0/net/tap.c 2019-04-23 21:14:46.000000000 +0300
|
||||
+++ qemu-4.0.0.mod/net/tap.c 2019-04-30 15:54:00.958886851 +0300
|
||||
@@ -526,7 +526,7 @@
|
||||
*parg++ = helper_cmd;
|
||||
*parg++ = NULL;
|
||||
|
||||
- execv("/bin/sh", args);
|
||||
+ execv("@TERMUX_PREFIX@/bin/sh", args);
|
||||
} else {
|
||||
/* assume helper is just the executable path name */
|
||||
|
||||
@@ -903,9 +903,9 @@
|
||||
error_setg(errp, "vhostfds= is invalid if fds= wasn't specified");
|
||||
return -1;
|
||||
}
|
||||
- script = tap->has_script ? tap->script : DEFAULT_NETWORK_SCRIPT;
|
||||
- downscript = tap->has_downscript ? tap->downscript :
|
||||
- DEFAULT_NETWORK_DOWN_SCRIPT;
|
||||
+
|
||||
+ script = tap->has_script ? tap->script : "@TERMUX_PREFIX@/etc/qemu-ifup";
|
||||
+ downscript = tap->has_downscript ? tap->downscript : "@TERMUX_PREFIX@/etc/qemu-ifdown";
|
||||
|
||||
if (tap->has_ifname) {
|
||||
pstrcpy(ifname, sizeof ifname, tap->ifname);
|
||||
@@ -932,6 +932,7 @@
|
||||
i >= 1 ? "no" : script,
|
||||
i >= 1 ? "no" : downscript,
|
||||
vhostfdname, vnet_hdr, fd, &err);
|
||||
+
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
close(fd);
|
||||
diff -uNr qemu-4.0.0/qemu-nbd.c qemu-4.0.0.mod/qemu-nbd.c
|
||||
--- qemu-4.0.0/qemu-nbd.c 2019-04-23 21:14:46.000000000 +0300
|
||||
+++ qemu-4.0.0.mod/qemu-nbd.c 2019-04-30 15:55:17.646269318 +0300
|
||||
@@ -49,7 +49,6 @@
|
||||
#define HAVE_NBD_DEVICE 0
|
||||
#endif
|
||||
|
||||
-#define SOCKET_PATH "/var/lock/qemu-nbd-%s"
|
||||
#define QEMU_NBD_OPT_CACHE 256
|
||||
#define QEMU_NBD_OPT_AIO 257
|
||||
#define QEMU_NBD_OPT_DISCARD 258
|
||||
@@ -88,7 +87,7 @@
|
||||
" -p, --port=PORT port to listen on (default `%d')\n"
|
||||
" -b, --bind=IFACE interface to bind to (default `0.0.0.0')\n"
|
||||
" -k, --socket=PATH path to the unix socket\n"
|
||||
-" (default '"SOCKET_PATH"')\n"
|
||||
+" (default '@TERMUX_PREFIX@/tmp/qemu-nbd-sock-%s')\n"
|
||||
" -e, --shared=NUM device can be shared by NUM clients (default '1')\n"
|
||||
" -t, --persistent don't exit on the last connection\n"
|
||||
" -v, --verbose display extra debugging information\n"
|
||||
@@ -1050,7 +1049,7 @@
|
||||
|
||||
if (device != NULL && sockpath == NULL) {
|
||||
sockpath = g_malloc(128);
|
||||
- snprintf(sockpath, 128, SOCKET_PATH, basename(device));
|
||||
+ snprintf(sockpath, 128, "@TERMUX_PREFIX@/tmp/qemu-nbd-sock-%s", basename(device));
|
||||
}
|
||||
|
||||
server = qio_net_listener_new();
|
||||
diff -uNr qemu-4.0.0/qemu-options.hx qemu-4.0.0.mod/qemu-options.hx
|
||||
--- qemu-4.0.0/qemu-options.hx 2019-04-23 21:14:46.000000000 +0300
|
||||
+++ qemu-4.0.0.mod/qemu-options.hx 2019-04-30 15:47:35.506933231 +0300
|
||||
@@ -2086,8 +2086,8 @@
|
||||
" [,poll-us=n]\n"
|
||||
" configure a host TAP network backend with ID 'str'\n"
|
||||
" connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
|
||||
- " use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n"
|
||||
- " to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n"
|
||||
+ " use network scripts 'file' (default=@TERMUX_PREFIX@/etc/qemu-ifup)\n"
|
||||
+ " to configure it and 'dfile' (default=@TERMUX_PREFIX@/etc/qemu-ifdown)\n"
|
||||
" to deconfigure it\n"
|
||||
" use '[down]script=no' to disable script execution\n"
|
||||
" use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n"
|
||||
diff -uNr qemu-4.0.0/slirp/src/slirp.c qemu-4.0.0.mod/slirp/src/slirp.c
|
||||
--- qemu-4.0.0/slirp/src/slirp.c 2019-04-23 21:14:46.000000000 +0300
|
||||
+++ qemu-4.0.0.mod/slirp/src/slirp.c 2019-04-30 15:56:37.710667145 +0300
|
||||
@@ -124,14 +124,20 @@
|
||||
struct stat *cached_stat, unsigned *cached_time)
|
||||
{
|
||||
struct stat old_stat;
|
||||
+
|
||||
if (curtime - *cached_time < TIMEOUT_DEFAULT) {
|
||||
memcpy(pdns_addr, cached_addr, addrlen);
|
||||
return 0;
|
||||
}
|
||||
+
|
||||
old_stat = *cached_stat;
|
||||
- if (stat("/etc/resolv.conf", cached_stat) != 0) {
|
||||
+
|
||||
+ int ret = stat("@TERMUX_PREFIX@/etc/resolv.conf", cached_stat);
|
||||
+
|
||||
+ if (ret != 0) {
|
||||
return -1;
|
||||
}
|
||||
+
|
||||
if (cached_stat->st_dev == old_stat.st_dev
|
||||
&& cached_stat->st_ino == old_stat.st_ino
|
||||
&& cached_stat->st_size == old_stat.st_size
|
||||
@@ -139,6 +145,7 @@
|
||||
memcpy(pdns_addr, cached_addr, addrlen);
|
||||
return 0;
|
||||
}
|
||||
+
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -153,7 +160,8 @@
|
||||
void *tmp_addr = alloca(addrlen);
|
||||
unsigned if_index;
|
||||
|
||||
- f = fopen("/etc/resolv.conf", "r");
|
||||
+ f = fopen("@TERMUX_PREFIX@/etc/resolv.conf", "r");
|
||||
+
|
||||
if (!f)
|
||||
return -1;
|
||||
|
||||
diff -uNr qemu-4.0.0/tcg/tcg.c qemu-4.0.0.mod/tcg/tcg.c
|
||||
--- qemu-4.0.0/tcg/tcg.c 2019-04-23 21:14:46.000000000 +0300
|
||||
+++ qemu-4.0.0.mod/tcg/tcg.c 2019-04-30 15:57:46.031820043 +0300
|
||||
@@ -4315,11 +4315,13 @@
|
||||
/* Enable this block to be able to debug the ELF image file creation.
|
||||
One can use readelf, objdump, or other inspection utilities. */
|
||||
{
|
||||
- FILE *f = fopen("/tmp/qemu.jit", "w+b");
|
||||
+ FILE *f = fopen("@TERMUX_PREFIX@/tmp/qemu.jit", "w+b");
|
||||
+
|
||||
if (f) {
|
||||
if (fwrite(img, img_size, 1, f) != img_size) {
|
||||
/* Avoid stupid unused return value warning for fwrite. */
|
||||
}
|
||||
+
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
diff -uNr qemu-4.0.0/util/qemu-sockets.c qemu-4.0.0.mod/util/qemu-sockets.c
|
||||
--- qemu-4.0.0/util/qemu-sockets.c 2019-04-23 21:14:46.000000000 +0300
|
||||
+++ qemu-4.0.0.mod/util/qemu-sockets.c 2019-04-30 15:58:34.510637663 +0300
|
||||
@@ -841,7 +841,7 @@
|
||||
path = saddr->path;
|
||||
} else {
|
||||
const char *tmpdir = getenv("TMPDIR");
|
||||
- tmpdir = tmpdir ? tmpdir : "/tmp";
|
||||
+ tmpdir = tmpdir ? tmpdir : "@TERMUX_PREFIX@/tmp";
|
||||
path = pathbuf = g_strdup_printf("%s/qemu-socket-XXXXXX", tmpdir);
|
||||
}
|
||||
|
@ -1,12 +0,0 @@
|
||||
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 16:49:45.240264962 +0300
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
#include "qemu/osdep.h"
|
||||
#include <sys/ioctl.h>
|
||||
-#include <sys/soundcard.h>
|
||||
+#include <linux/soundcard.h>
|
||||
#include "qemu-common.h"
|
||||
#include "qemu/main-loop.h"
|
||||
#include "qemu/host-utils.h"
|
@ -1,17 +0,0 @@
|
||||
diff -uNr qemu-4.0.0/tcg/i386/tcg-target.inc.c qemu-4.0.0.mod/tcg/i386/tcg-target.inc.c
|
||||
--- qemu-4.0.0/tcg/i386/tcg-target.inc.c 2019-04-23 21:14:46.000000000 +0300
|
||||
+++ qemu-4.0.0.mod/tcg/i386/tcg-target.inc.c 2019-04-27 03:36:23.678807870 +0300
|
||||
@@ -1888,7 +1888,12 @@
|
||||
# if defined(__x86_64__) && defined(__linux__)
|
||||
# include <asm/prctl.h>
|
||||
# include <sys/prctl.h>
|
||||
-int arch_prctl(int code, unsigned long addr);
|
||||
+# include <linux/unistd.h>
|
||||
+static int arch_prctl(int code, unsigned long addr)
|
||||
+{
|
||||
+ return syscall(__NR_arch_prctl, code, addr);
|
||||
+}
|
||||
+
|
||||
static inline int setup_guest_base_seg(void)
|
||||
{
|
||||
if (arch_prctl(ARCH_SET_GS, guest_base) == 0) {
|
@ -1,22 +0,0 @@
|
||||
diff -uNr qemu-3.0.0/fsdev/9p-marshal.h qemu-3.0.0.mod/fsdev/9p-marshal.h
|
||||
--- qemu-3.0.0/fsdev/9p-marshal.h 2018-08-14 22:10:34.000000000 +0300
|
||||
+++ qemu-3.0.0.mod/fsdev/9p-marshal.h 2018-10-26 16:58:37.620555116 +0300
|
||||
@@ -48,6 +48,18 @@
|
||||
int64_t mtime_nsec;
|
||||
} V9fsIattr;
|
||||
|
||||
+#ifdef st_atime_nsec
|
||||
+# undef st_atime_nsec
|
||||
+#endif
|
||||
+
|
||||
+#ifdef st_mtime_nsec
|
||||
+# undef st_mtime_nsec
|
||||
+#endif
|
||||
+
|
||||
+#ifdef st_ctime_nsec
|
||||
+# undef st_ctime_nsec
|
||||
+#endif
|
||||
+
|
||||
typedef struct V9fsStatDotl {
|
||||
uint64_t st_result_mask;
|
||||
V9fsQID qid;
|
@ -1,74 +0,0 @@
|
||||
diff -uNr qemu-3.1.0/hw/9pfs/9p-local.c qemu-3.1.0.mod/hw/9pfs/9p-local.c
|
||||
--- qemu-3.1.0/hw/9pfs/9p-local.c 2018-12-11 19:44:34.000000000 +0200
|
||||
+++ qemu-3.1.0.mod/hw/9pfs/9p-local.c 2019-02-14 00:29:24.568616982 +0200
|
||||
@@ -535,9 +535,23 @@
|
||||
rewinddir(fs->dir.stream);
|
||||
}
|
||||
|
||||
+struct DIR {
|
||||
+ int fd_;
|
||||
+};
|
||||
+
|
||||
+static long android_telldir(struct DIR *dirp)
|
||||
+{
|
||||
+ return (long) lseek(dirp->fd_, 0, SEEK_CUR);
|
||||
+}
|
||||
+
|
||||
+static void android_seekdir(DIR *dirp, long loc)
|
||||
+{
|
||||
+ (void) lseek(dirp->fd_, loc, SEEK_SET);
|
||||
+}
|
||||
+
|
||||
static off_t local_telldir(FsContext *ctx, V9fsFidOpenState *fs)
|
||||
{
|
||||
- return telldir(fs->dir.stream);
|
||||
+ return android_telldir(fs->dir.stream);
|
||||
}
|
||||
|
||||
static bool local_is_mapped_file_metadata(FsContext *fs_ctx, const char *name)
|
||||
@@ -571,7 +585,7 @@
|
||||
|
||||
static void local_seekdir(FsContext *ctx, V9fsFidOpenState *fs, off_t off)
|
||||
{
|
||||
- seekdir(fs->dir.stream, off);
|
||||
+ android_seekdir(fs->dir.stream, off);
|
||||
}
|
||||
|
||||
static ssize_t local_preadv(FsContext *ctx, V9fsFidOpenState *fs,
|
||||
diff -uNr qemu-3.1.0/hw/9pfs/9p-proxy.c qemu-3.1.0.mod/hw/9pfs/9p-proxy.c
|
||||
--- qemu-3.1.0/hw/9pfs/9p-proxy.c 2018-12-11 19:44:34.000000000 +0200
|
||||
+++ qemu-3.1.0.mod/hw/9pfs/9p-proxy.c 2019-02-14 00:29:30.425318357 +0200
|
||||
@@ -674,9 +674,23 @@
|
||||
rewinddir(fs->dir.stream);
|
||||
}
|
||||
|
||||
+struct DIR {
|
||||
+ int fd_;
|
||||
+};
|
||||
+
|
||||
+static long android_telldir(struct DIR *dirp)
|
||||
+{
|
||||
+ return (long) lseek(dirp->fd_, 0, SEEK_CUR);
|
||||
+}
|
||||
+
|
||||
+static void android_seekdir(DIR *dirp, long loc)
|
||||
+{
|
||||
+ (void) lseek(dirp->fd_, loc, SEEK_SET);
|
||||
+}
|
||||
+
|
||||
static off_t proxy_telldir(FsContext *ctx, V9fsFidOpenState *fs)
|
||||
{
|
||||
- return telldir(fs->dir.stream);
|
||||
+ return android_telldir(fs->dir.stream);
|
||||
}
|
||||
|
||||
static struct dirent *proxy_readdir(FsContext *ctx, V9fsFidOpenState *fs)
|
||||
@@ -686,7 +700,7 @@
|
||||
|
||||
static void proxy_seekdir(FsContext *ctx, V9fsFidOpenState *fs, off_t off)
|
||||
{
|
||||
- seekdir(fs->dir.stream, off);
|
||||
+ android_seekdir(fs->dir.stream, off);
|
||||
}
|
||||
|
||||
static ssize_t proxy_preadv(FsContext *ctx, V9fsFidOpenState *fs,
|
@ -1,31 +0,0 @@
|
||||
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 16:49:45.270265128 +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
|
@ -1,12 +0,0 @@
|
||||
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 16:49:45.273598481 +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>
|
@ -1,27 +0,0 @@
|
||||
diff -uNr qemu-3.1.0/fsdev/virtfs-proxy-helper.c qemu-3.1.0.mod/fsdev/virtfs-proxy-helper.c
|
||||
--- qemu-3.1.0/fsdev/virtfs-proxy-helper.c 2018-12-11 19:44:34.000000000 +0200
|
||||
+++ qemu-3.1.0.mod/fsdev/virtfs-proxy-helper.c 2018-12-29 00:45:59.721725318 +0200
|
||||
@@ -62,21 +62,13 @@
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, format);
|
||||
- if (is_daemon) {
|
||||
- vsyslog(LOG_CRIT, format, ap);
|
||||
- } else {
|
||||
- vfprintf(stderr, format, ap);
|
||||
- }
|
||||
+ vfprintf(stderr, format, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
static void do_perror(const char *string)
|
||||
{
|
||||
- if (is_daemon) {
|
||||
- syslog(LOG_CRIT, "%s:%s", string, strerror(errno));
|
||||
- } else {
|
||||
- fprintf(stderr, "%s:%s\n", string, strerror(errno));
|
||||
- }
|
||||
+ fprintf(stderr, "%s:%s\n", string, strerror(errno));
|
||||
}
|
||||
|
||||
static int do_cap_set(cap_value_t *cap_value, int size, int reset)
|
@ -1,63 +0,0 @@
|
||||
diff -uNr qemu-4.0.0/linux-user/aarch64/signal.c qemu-4.0.0.mod/linux-user/aarch64/signal.c
|
||||
--- qemu-4.0.0/linux-user/aarch64/signal.c 2019-04-23 21:14:46.000000000 +0300
|
||||
+++ qemu-4.0.0.mod/linux-user/aarch64/signal.c 2019-04-27 15:15:35.724365997 +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;
|
||||
};
|
||||
diff -uNr qemu-4.0.0/linux-user/arm/signal.c qemu-4.0.0.mod/linux-user/arm/signal.c
|
||||
--- qemu-4.0.0/linux-user/arm/signal.c 2019-04-23 21:14:46.000000000 +0300
|
||||
+++ qemu-4.0.0.mod/linux-user/arm/signal.c 2019-04-27 15:15:48.572413658 +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)));
|
||||
};
|
||||
|
||||
diff -uNr qemu-4.0.0/linux-user/syscall_defs.h qemu-4.0.0.mod/linux-user/syscall_defs.h
|
||||
--- qemu-4.0.0/linux-user/syscall_defs.h 2019-04-23 21:14:46.000000000 +0300
|
||||
+++ qemu-4.0.0.mod/linux-user/syscall_defs.h 2019-04-27 15:15:06.028256027 +0300
|
||||
@@ -1731,7 +1731,7 @@
|
||||
abi_ulong target_st_mtime_nsec;
|
||||
abi_ulong target_st_ctime;
|
||||
abi_ulong target_st_ctime_nsec;
|
||||
- abi_long __unused[3];
|
||||
+ abi_long __qemu_unused[3];
|
||||
};
|
||||
|
||||
#elif defined(TARGET_SH4)
|
||||
@@ -1816,7 +1816,7 @@
|
||||
abi_ulong target_st_ctime;
|
||||
abi_ulong target_st_ctime_nsec;
|
||||
|
||||
- abi_long __unused[3];
|
||||
+ abi_long __qemu_unused[3];
|
||||
};
|
||||
#elif defined(TARGET_S390X)
|
||||
struct target_stat {
|
||||
@@ -1837,7 +1837,7 @@
|
||||
abi_ulong target_st_ctime_nsec;
|
||||
abi_ulong st_blksize;
|
||||
abi_long st_blocks;
|
||||
- abi_ulong __unused[3];
|
||||
+ abi_ulong __qemu_unused[3];
|
||||
};
|
||||
#elif defined(TARGET_AARCH64)
|
||||
struct target_stat {
|
||||
@@ -1859,7 +1859,7 @@
|
||||
abi_ulong target_st_mtime_nsec;
|
||||
abi_long target_st_ctime;
|
||||
abi_ulong target_st_ctime_nsec;
|
||||
- unsigned int __unused[2];
|
||||
+ unsigned int __qemu_unused[2];
|
||||
};
|
||||
#elif defined(TARGET_XTENSA)
|
||||
struct target_stat {
|
@ -1,99 +0,0 @@
|
||||
diff -uNr qemu-4.0.0/configure qemu-4.0.0.mod/configure
|
||||
--- qemu-4.0.0/configure 2019-04-23 21:14:45.000000000 +0300
|
||||
+++ qemu-4.0.0.mod/configure 2019-04-27 04:00:44.774004972 +0300
|
||||
@@ -2301,23 +2301,10 @@
|
||||
fi
|
||||
|
||||
##########################################
|
||||
-# lzo check
|
||||
+# disable lzo check, force enable instead
|
||||
|
||||
-if test "$lzo" != "no" ; then
|
||||
- cat > $TMPC << EOF
|
||||
-#include <lzo/lzo1x.h>
|
||||
-int main(void) { lzo_version(); return 0; }
|
||||
-EOF
|
||||
- if compile_prog "" "-llzo2" ; then
|
||||
- libs_softmmu="$libs_softmmu -llzo2"
|
||||
- lzo="yes"
|
||||
- else
|
||||
- if test "$lzo" = "yes"; then
|
||||
- feature_not_found "liblzo2" "Install liblzo2 devel"
|
||||
- fi
|
||||
- lzo="no"
|
||||
- fi
|
||||
-fi
|
||||
+libs_softmmu="$libs_softmmu -llzo2"
|
||||
+lzo="yes"
|
||||
|
||||
##########################################
|
||||
# snappy check
|
||||
@@ -2339,22 +2326,9 @@
|
||||
fi
|
||||
|
||||
##########################################
|
||||
-# bzip2 check
|
||||
+# disable bzip2 check, force enable bz2
|
||||
|
||||
-if test "$bzip2" != "no" ; then
|
||||
- cat > $TMPC << EOF
|
||||
-#include <bzlib.h>
|
||||
-int main(void) { BZ2_bzlibVersion(); return 0; }
|
||||
-EOF
|
||||
- if compile_prog "" "-lbz2" ; then
|
||||
- bzip2="yes"
|
||||
- else
|
||||
- if test "$bzip2" = "yes"; then
|
||||
- feature_not_found "libbzip2" "Install libbzip2 devel"
|
||||
- fi
|
||||
- bzip2="no"
|
||||
- fi
|
||||
-fi
|
||||
+bzip2="yes"
|
||||
|
||||
##########################################
|
||||
# lzfse check
|
||||
@@ -3183,6 +3157,7 @@
|
||||
# VNC SASL detection
|
||||
if test "$vnc" = "yes" && test "$vnc_sasl" != "no" ; then
|
||||
cat > $TMPC <<EOF
|
||||
+#include <sys/types.h>
|
||||
#include <sasl/sasl.h>
|
||||
#include <stdio.h>
|
||||
int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
|
||||
@@ -4381,16 +4356,6 @@
|
||||
##########################################
|
||||
# signalfd probe
|
||||
signalfd="no"
|
||||
-cat > $TMPC << EOF
|
||||
-#include <unistd.h>
|
||||
-#include <sys/syscall.h>
|
||||
-#include <signal.h>
|
||||
-int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
|
||||
-EOF
|
||||
-
|
||||
-if compile_prog "" "" ; then
|
||||
- signalfd=yes
|
||||
-fi
|
||||
|
||||
# check if optreset global is declared by <getopt.h>
|
||||
optreset="no"
|
||||
@@ -6029,7 +5994,7 @@
|
||||
|
||||
# We can only support ivshmem if we have eventfd
|
||||
if [ "$eventfd" = "yes" ]; then
|
||||
- ivshmem=yes
|
||||
+ ivshmem=no
|
||||
fi
|
||||
|
||||
tools=""
|
||||
@@ -6699,9 +6664,6 @@
|
||||
if test "$posix_fallocate" = "yes" ; then
|
||||
echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak
|
||||
fi
|
||||
-if test "$sync_file_range" = "yes" ; then
|
||||
- echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak
|
||||
-fi
|
||||
if test "$fiemap" = "yes" ; then
|
||||
echo "CONFIG_FIEMAP=y" >> $config_host_mak
|
||||
fi
|
@ -1,17 +0,0 @@
|
||||
diff -uNr qemu-4.0.0/util/cacheinfo.c qemu-4.0.0.mod/util/cacheinfo.c
|
||||
--- qemu-4.0.0/util/cacheinfo.c 2019-04-23 21:14:46.000000000 +0300
|
||||
+++ qemu-4.0.0.mod/util/cacheinfo.c 2019-05-27 18:52:53.357425925 +0300
|
||||
@@ -172,13 +172,6 @@
|
||||
{
|
||||
int isize = 0, dsize = 0;
|
||||
|
||||
- sys_cache_info(&isize, &dsize);
|
||||
- arch_cache_info(&isize, &dsize);
|
||||
- fallback_cache_info(&isize, &dsize);
|
||||
-
|
||||
- assert((isize & (isize - 1)) == 0);
|
||||
- assert((dsize & (dsize - 1)) == 0);
|
||||
-
|
||||
qemu_icache_linesize = isize;
|
||||
qemu_icache_linesize_log = ctz32(isize);
|
||||
qemu_dcache_linesize = dsize;
|
@ -1,209 +0,0 @@
|
||||
diff -uNr qemu-4.0.0/linux-user/syscall.c qemu-4.0.0.mod/linux-user/syscall.c
|
||||
--- qemu-4.0.0/linux-user/syscall.c 2019-05-01 02:55:06.401703214 +0300
|
||||
+++ qemu-4.0.0.mod/linux-user/syscall.c 2019-05-01 02:56:06.894984667 +0300
|
||||
@@ -42,7 +42,7 @@
|
||||
#include <poll.h>
|
||||
#include <sys/times.h>
|
||||
#include <sys/shm.h>
|
||||
-#include <sys/sem.h>
|
||||
+#include <linux/sem.h>
|
||||
#include <sys/statfs.h>
|
||||
#include <utime.h>
|
||||
#include <sys/sysinfo.h>
|
||||
@@ -76,12 +76,17 @@
|
||||
#endif
|
||||
|
||||
#define termios host_termios
|
||||
+#define termios2 host_termios2
|
||||
+#define ktermios host_ktermios
|
||||
#define winsize host_winsize
|
||||
#define termio host_termio
|
||||
#define sgttyb host_sgttyb /* same as target */
|
||||
#define tchars host_tchars /* same as target */
|
||||
#define ltchars host_ltchars /* same as target */
|
||||
|
||||
+#undef __ASM_GENERIC_TERMBITS_H
|
||||
+#include <asm/termbits.h>
|
||||
+
|
||||
#include <linux/termios.h>
|
||||
#include <linux/unistd.h>
|
||||
#include <linux/cdrom.h>
|
||||
@@ -244,6 +249,61 @@
|
||||
#define __NR__llseek __NR_lseek
|
||||
#endif
|
||||
|
||||
+_syscall0(int, vhangup)
|
||||
+#ifdef __NR_msgctl
|
||||
+_syscall3(int, msgctl, int, msqid, int, cmd, struct msqid_ds *, buf)
|
||||
+#else
|
||||
+static int
|
||||
+msgctl (int msqid, int cmd, struct msqid_ds *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)
|
||||
+{
|
||||
+ 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)
|
||||
+#ifdef __NR_msgget
|
||||
+_syscall2(int, msgget, key_t, key, int, msgflg)
|
||||
+#else
|
||||
+static int
|
||||
+msgget (key_t key, int msgflg)
|
||||
+{
|
||||
+ return syscall(__NR_ipc, 5, IPCOP_msgget, key, msgflg, 0, NULL);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+#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
|
||||
+
|
||||
/* Newer kernel ports have llseek() instead of _llseek() */
|
||||
#if defined(TARGET_NR_llseek) && !defined(TARGET_NR__llseek)
|
||||
#define TARGET_NR__llseek TARGET_NR_llseek
|
||||
@@ -806,6 +866,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)
|
||||
+_syscall1(int, mq_unlink, const char *, name)
|
||||
+_syscall4(__kernel_mqd_t, mq_open, const char *, name, int, oflag, mode_t, mode,
|
||||
+ struct mq_attr *, attr)
|
||||
#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
|
||||
@@ -1184,7 +1247,7 @@
|
||||
}
|
||||
|
||||
#if defined(TARGET_NR_mq_open) && defined(__NR_mq_open)
|
||||
-#include <mqueue.h>
|
||||
+#include <linux/mqueue.h>
|
||||
|
||||
static inline abi_long copy_from_user_mq_attr(struct mq_attr *attr,
|
||||
abi_ulong target_mq_attr_addr)
|
||||
@@ -3231,6 +3294,8 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
+#define semid_ds __kernel_legacy_semid_ds
|
||||
+
|
||||
static inline abi_long target_to_host_semid_ds(struct semid_ds *host_sd,
|
||||
abi_ulong target_addr)
|
||||
{
|
||||
@@ -3310,6 +3375,16 @@
|
||||
abi_ulong __buf;
|
||||
};
|
||||
|
||||
+#ifdef __NR_semctl
|
||||
+_syscall4(int, semctl, int, semid, int, semnum, int, cmd, union semun, arg4)
|
||||
+#else
|
||||
+static int semctl(int semid, int semnum, int cmd, union semun arg4)
|
||||
+{
|
||||
+ return syscall(__NR_ipc, IPCOP_semctl, semid, semnum, cmd | 0x100,
|
||||
+ arg4.__buf);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
static inline abi_long target_to_host_semarray(int semid, unsigned short **host_array,
|
||||
abi_ulong target_addr)
|
||||
{
|
||||
@@ -3440,7 +3515,7 @@
|
||||
case GETPID:
|
||||
case GETNCNT:
|
||||
case GETZCNT:
|
||||
- ret = get_errno(semctl(semid, semnum, cmd, NULL));
|
||||
+ ret = get_errno(semctl(semid, semnum, cmd, (union semun) {.buf = NULL}));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3522,7 +3597,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);
|
||||
- host_md->__msg_cbytes = tswapal(target_md->__msg_cbytes);
|
||||
+ host_md->msg_cbytes = tswapal(target_md->__msg_cbytes);
|
||||
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);
|
||||
@@ -3543,7 +3618,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);
|
||||
- target_md->__msg_cbytes = tswapal(host_md->__msg_cbytes);
|
||||
+ target_md->__msg_cbytes = tswapal(host_md->msg_cbytes);
|
||||
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);
|
||||
@@ -4799,6 +4874,9 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
+#undef winsize
|
||||
+#undef termio
|
||||
+
|
||||
static IOCTLEntry ioctl_entries[] = {
|
||||
#define IOCTL(cmd, access, ...) \
|
||||
{ TARGET_ ## cmd, cmd, #cmd, access, 0, { __VA_ARGS__ } },
|
||||
@@ -7378,7 +7456,7 @@
|
||||
unlock_user(p, arg1, 0);
|
||||
return ret;
|
||||
#endif
|
||||
-#ifdef TARGET_NR_stime /* not on alpha */
|
||||
+#if 0 //def TARGET_NR_stime /* not on alpha */
|
||||
case TARGET_NR_stime:
|
||||
{
|
||||
time_t host_time;
|
||||
@@ -7440,7 +7518,7 @@
|
||||
}
|
||||
return ret;
|
||||
#endif
|
||||
-#if defined(TARGET_NR_futimesat)
|
||||
+#if 0 && defined(TARGET_NR_futimesat)
|
||||
case TARGET_NR_futimesat:
|
||||
{
|
||||
struct timeval *tvp, tv[2];
|
||||
@@ -11056,7 +11134,7 @@
|
||||
/* Not implemented for now... */
|
||||
/* case TARGET_NR_mq_notify: */
|
||||
/* break; */
|
||||
-
|
||||
+#if 0
|
||||
case TARGET_NR_mq_getsetattr:
|
||||
{
|
||||
struct mq_attr posix_mq_attr_in, posix_mq_attr_out;
|
||||
@@ -11074,6 +11152,7 @@
|
||||
}
|
||||
return ret;
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#ifdef CONFIG_SPLICE
|
||||
#ifdef TARGET_NR_tee
|
@ -1,95 +0,0 @@
|
||||
diff -uNr qemu-3.1.0/lockf_implementation.h qemu-3.1.0.mod/lockf_implementation.h
|
||||
--- qemu-3.1.0/lockf_implementation.h 1970-01-01 03:00:00.000000000 +0300
|
||||
+++ qemu-3.1.0.mod/lockf_implementation.h 2019-02-14 00:17:12.137667319 +0200
|
||||
@@ -0,0 +1,56 @@
|
||||
+#ifndef LOCKF_IMPLEMENTATION_H
|
||||
+#define LOCKF_IMPLEMENTATION_H
|
||||
+
|
||||
+//
|
||||
+// lockf() implementation from GNU Libc
|
||||
+//
|
||||
+
|
||||
+static int lockf (int fd, int cmd, off_t len)
|
||||
+{
|
||||
+ struct flock fl;
|
||||
+
|
||||
+ memset ((char *) &fl, '\0', sizeof (fl));
|
||||
+
|
||||
+ /* lockf is always relative to the current file position. */
|
||||
+ fl.l_whence = SEEK_CUR;
|
||||
+ fl.l_start = 0;
|
||||
+ fl.l_len = len;
|
||||
+
|
||||
+ switch (cmd)
|
||||
+ {
|
||||
+ case F_TEST:
|
||||
+ /* Test the lock: return 0 if FD is unlocked or locked by this process;
|
||||
+ return -1, set errno to EACCES, if another process holds the lock. */
|
||||
+ fl.l_type = F_RDLCK;
|
||||
+ if (fcntl (fd, F_GETLK, &fl) < 0)
|
||||
+ return -1;
|
||||
+ if (fl.l_type == F_UNLCK || fl.l_pid == getpid ())
|
||||
+ return 0;
|
||||
+ errno = EACCES;
|
||||
+ return -1;
|
||||
+
|
||||
+ case F_ULOCK:
|
||||
+ fl.l_type = F_UNLCK;
|
||||
+ cmd = F_SETLK;
|
||||
+ break;
|
||||
+ case F_LOCK:
|
||||
+ fl.l_type = F_WRLCK;
|
||||
+ cmd = F_SETLKW;
|
||||
+ break;
|
||||
+ case F_TLOCK:
|
||||
+ fl.l_type = F_WRLCK;
|
||||
+ cmd = F_SETLK;
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ errno = EINVAL;
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ /* lockf() is a cancellation point but so is fcntl() if F_SETLKW is
|
||||
+ used. Therefore we don't have to care about cancellation here,
|
||||
+ the fcntl() function will take care of it. */
|
||||
+ return fcntl (fd, cmd, &fl);
|
||||
+}
|
||||
+
|
||||
+#endif
|
||||
diff -uNr qemu-3.1.0/os-posix.c qemu-3.1.0.mod/os-posix.c
|
||||
--- qemu-3.1.0/os-posix.c 2018-12-11 19:44:34.000000000 +0200
|
||||
+++ qemu-3.1.0.mod/os-posix.c 2019-02-14 00:17:05.354295183 +0200
|
||||
@@ -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>
|
||||
diff -uNr qemu-3.1.0/qga/main.c qemu-3.1.0.mod/qga/main.c
|
||||
--- qemu-3.1.0/qga/main.c 2018-12-11 19:44:34.000000000 +0200
|
||||
+++ qemu-3.1.0.mod/qga/main.c 2019-02-14 00:17:18.731038388 +0200
|
||||
@@ -45,6 +45,8 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+#include "lockf_implementation.h"
|
||||
+
|
||||
#ifndef _WIN32
|
||||
#define QGA_VIRTIO_PATH_DEFAULT "/dev/virtio-ports/org.qemu.guest_agent.0"
|
||||
#define QGA_STATE_RELATIVE_DIR "run"
|
||||
diff -uNr qemu-3.1.0/scsi/qemu-pr-helper.c qemu-3.1.0.mod/scsi/qemu-pr-helper.c
|
||||
--- qemu-3.1.0/scsi/qemu-pr-helper.c 2018-12-11 19:44:34.000000000 +0200
|
||||
+++ qemu-3.1.0.mod/scsi/qemu-pr-helper.c 2019-02-14 00:17:24.634405524 +0200
|
||||
@@ -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
|
@ -1,39 +0,0 @@
|
||||
diff -uNr qemu-3.1.0/util/qemu-openpty.c qemu-3.1.0.mod/util/qemu-openpty.c
|
||||
--- qemu-3.1.0/util/qemu-openpty.c 2018-12-11 19:44:35.000000000 +0200
|
||||
+++ qemu-3.1.0.mod/util/qemu-openpty.c 2019-05-27 15:04:41.083303559 +0300
|
||||
@@ -108,6 +108,35 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifdef __ANDROID__
|
||||
+#ifdef __ANDROID_API__ < 24
|
||||
+static int openpty(int* amaster, int* aslave, char* name, const struct termios* termp, const struct winsize* winp)
|
||||
+{
|
||||
+ char buf[512];
|
||||
+
|
||||
+ int master = open("/dev/ptmx", O_RDWR);
|
||||
+ if (master == -1) return -1;
|
||||
+ if (grantpt(master) || unlockpt(master) || ptsname_r(master, buf, sizeof buf)) goto fail;
|
||||
+
|
||||
+ int slave = open(buf, O_RDWR | O_NOCTTY);
|
||||
+ if (slave == -1) goto fail;
|
||||
+
|
||||
+ /* XXX Should we ignore errors here? */
|
||||
+ if (termp) tcsetattr(slave, TCSANOW, termp);
|
||||
+ if (winp) ioctl(slave, TIOCSWINSZ, winp);
|
||||
+
|
||||
+ *amaster = master;
|
||||
+ *aslave = slave;
|
||||
+ if (name != NULL) strcpy(name, buf);
|
||||
+ return 0;
|
||||
+
|
||||
+fail:
|
||||
+ close(master);
|
||||
+ return -1;
|
||||
+}
|
||||
+#endif
|
||||
+#endif
|
||||
+
|
||||
int qemu_openpty_raw(int *aslave, char *pty_name)
|
||||
{
|
||||
int amaster;
|
@ -1,207 +0,0 @@
|
||||
diff -uNr qemu-4.0.0/linux-user/syscall.c qemu-4.0.0.mod/linux-user/syscall.c
|
||||
--- qemu-4.0.0/linux-user/syscall.c 2019-04-30 15:40:56.544812530 +0300
|
||||
+++ qemu-4.0.0.mod/linux-user/syscall.c 2019-04-30 15:41:21.775951365 +0300
|
||||
@@ -42,7 +42,7 @@
|
||||
#include <poll.h>
|
||||
#include <sys/times.h>
|
||||
#include <sys/shm.h>
|
||||
-#include <sys/sem.h>
|
||||
+#include <linux/sem.h>
|
||||
#include <sys/statfs.h>
|
||||
#include <utime.h>
|
||||
#include <sys/sysinfo.h>
|
||||
@@ -76,12 +76,17 @@
|
||||
#endif
|
||||
|
||||
#define termios host_termios
|
||||
+#define termios2 host_termios2
|
||||
+#define ktermios host_ktermios
|
||||
#define winsize host_winsize
|
||||
#define termio host_termio
|
||||
#define sgttyb host_sgttyb /* same as target */
|
||||
#define tchars host_tchars /* same as target */
|
||||
#define ltchars host_ltchars /* same as target */
|
||||
|
||||
+#undef __ASM_GENERIC_TERMBITS_H
|
||||
+#include <asm/termbits.h>
|
||||
+
|
||||
#include <linux/termios.h>
|
||||
#include <linux/unistd.h>
|
||||
#include <linux/cdrom.h>
|
||||
@@ -244,6 +249,59 @@
|
||||
#define __NR__llseek __NR_lseek
|
||||
#endif
|
||||
|
||||
+_syscall0(int, vhangup)
|
||||
+#ifdef __NR_msgctl
|
||||
+_syscall3(int, msgctl, int, msqid, int, cmd, struct msqid_ds *, buf)
|
||||
+#else
|
||||
+static int
|
||||
+msgctl (int msqid, int cmd, struct msqid_ds *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)
|
||||
+{
|
||||
+ return syscall (__NR_ipc, IPCOP_semget, key, nsems, semflg, NULL);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+_syscall2(int, setdomainname, const char *, name, size_t, len)
|
||||
+#ifdef __NR_msgget
|
||||
+_syscall2(int, msgget, key_t, key, int, msgflg)
|
||||
+#else
|
||||
+static int
|
||||
+msgget (key_t key, int msgflg)
|
||||
+{
|
||||
+ return syscall(__NR_ipc, 5, IPCOP_msgget, key, msgflg, 0, NULL);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+#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
|
||||
+
|
||||
/* Newer kernel ports have llseek() instead of _llseek() */
|
||||
#if defined(TARGET_NR_llseek) && !defined(TARGET_NR__llseek)
|
||||
#define TARGET_NR__llseek TARGET_NR_llseek
|
||||
@@ -806,6 +864,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)
|
||||
+_syscall1(int, mq_unlink, const char *, name)
|
||||
+_syscall4(__kernel_mqd_t, mq_open, const char *, name, int, oflag, mode_t, mode,
|
||||
+ struct mq_attr *, attr)
|
||||
#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
|
||||
@@ -1184,7 +1245,7 @@
|
||||
}
|
||||
|
||||
#if defined(TARGET_NR_mq_open) && defined(__NR_mq_open)
|
||||
-#include <mqueue.h>
|
||||
+#include <linux/mqueue.h>
|
||||
|
||||
static inline abi_long copy_from_user_mq_attr(struct mq_attr *attr,
|
||||
abi_ulong target_mq_attr_addr)
|
||||
@@ -3231,6 +3292,8 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
+#define semid_ds __kernel_legacy_semid_ds
|
||||
+
|
||||
static inline abi_long target_to_host_semid_ds(struct semid_ds *host_sd,
|
||||
abi_ulong target_addr)
|
||||
{
|
||||
@@ -3310,6 +3373,16 @@
|
||||
abi_ulong __buf;
|
||||
};
|
||||
|
||||
+#ifdef __NR_semctl
|
||||
+_syscall4(int, semctl, int, semid, int, semnum, int, cmd, union semun, arg4)
|
||||
+#else
|
||||
+static int semctl(int semid, int semnum, int cmd, union semun arg4)
|
||||
+{
|
||||
+ return syscall(__NR_ipc, IPCOP_semctl, semid, semnum, cmd | 0x100,
|
||||
+ arg4.__buf);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
static inline abi_long target_to_host_semarray(int semid, unsigned short **host_array,
|
||||
abi_ulong target_addr)
|
||||
{
|
||||
@@ -3440,7 +3513,7 @@
|
||||
case GETPID:
|
||||
case GETNCNT:
|
||||
case GETZCNT:
|
||||
- ret = get_errno(semctl(semid, semnum, cmd, NULL));
|
||||
+ ret = get_errno(semctl(semid, semnum, cmd, (union semun) {.buf = NULL}));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3522,7 +3595,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);
|
||||
- host_md->__msg_cbytes = tswapal(target_md->__msg_cbytes);
|
||||
+ host_md->msg_cbytes = tswapal(target_md->__msg_cbytes);
|
||||
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);
|
||||
@@ -3543,7 +3616,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);
|
||||
- target_md->__msg_cbytes = tswapal(host_md->__msg_cbytes);
|
||||
+ target_md->__msg_cbytes = tswapal(host_md->msg_cbytes);
|
||||
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);
|
||||
@@ -4799,6 +4872,9 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
+#undef winsize
|
||||
+#undef termio
|
||||
+
|
||||
static IOCTLEntry ioctl_entries[] = {
|
||||
#define IOCTL(cmd, access, ...) \
|
||||
{ TARGET_ ## cmd, cmd, #cmd, access, 0, { __VA_ARGS__ } },
|
||||
@@ -7399,7 +7475,7 @@
|
||||
unlock_user(p, arg1, 0);
|
||||
return ret;
|
||||
#endif
|
||||
-#ifdef TARGET_NR_stime /* not on alpha */
|
||||
+#if 0 //def TARGET_NR_stime /* not on alpha */
|
||||
case TARGET_NR_stime:
|
||||
{
|
||||
time_t host_time;
|
||||
@@ -7461,7 +7537,7 @@
|
||||
}
|
||||
return ret;
|
||||
#endif
|
||||
-#if defined(TARGET_NR_futimesat)
|
||||
+#if 0 && defined(TARGET_NR_futimesat)
|
||||
case TARGET_NR_futimesat:
|
||||
{
|
||||
struct timeval *tvp, tv[2];
|
||||
@@ -11077,7 +11153,7 @@
|
||||
/* Not implemented for now... */
|
||||
/* case TARGET_NR_mq_notify: */
|
||||
/* break; */
|
||||
-
|
||||
+#if 0
|
||||
case TARGET_NR_mq_getsetattr:
|
||||
{
|
||||
struct mq_attr posix_mq_attr_in, posix_mq_attr_out;
|
||||
@@ -11095,6 +11171,7 @@
|
||||
}
|
||||
return ret;
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#ifdef CONFIG_SPLICE
|
||||
#ifdef TARGET_NR_tee
|
@ -1,129 +0,0 @@
|
||||
TERMUX_PKG_HOMEPAGE=https://www.qemu.org
|
||||
TERMUX_PKG_DESCRIPTION="A set common files for the QEMU emulators"
|
||||
TERMUX_PKG_LICENSE="LGPL-2.1"
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com>"
|
||||
TERMUX_PKG_VERSION=4.0.0
|
||||
TERMUX_PKG_REVISION=3
|
||||
TERMUX_PKG_SRCURL=https://download.qemu.org/qemu-$TERMUX_PKG_VERSION.tar.xz
|
||||
TERMUX_PKG_SHA256=13a93dfe75b86734326f8d5b475fde82ec692d5b5a338b4262aeeb6b0fa4e469
|
||||
TERMUX_PKG_DEPENDS="capstone, dtc, glib, libandroid-shmem, libbz2, libc++, libcap, libcurl, libffi, libgnutls, libjpeg-turbo, liblzo, libnettle, libnfs, libpixman, libpng, libsasl, libssh2, libxml2, ncurses, openssl, pcre, sdl2, zlib"
|
||||
TERMUX_PKG_BUILD_IN_SRC=true
|
||||
|
||||
termux_step_pre_configure() {
|
||||
if [ $TERMUX_PKG_API_LEVEL -lt 24 ]; then
|
||||
patch -p1 -i "$TERMUX_PKG_BUILDER_DIR"/android-5/0008-fix-syscalls-android5.patch
|
||||
patch -p1 -i "$TERMUX_PKG_BUILDER_DIR"/android-5/0012-implement-lockf.patch
|
||||
patch -p1 -i "$TERMUX_PKG_BUILDER_DIR"/android-5/0013-implement-openpty.patch
|
||||
else
|
||||
patch -p1 -i "$TERMUX_PKG_BUILDER_DIR"/android-7/0008-fix-syscalls-android7.patch
|
||||
fi
|
||||
}
|
||||
|
||||
termux_step_configure() {
|
||||
local ENABLED_TARGETS
|
||||
|
||||
# System emulators.
|
||||
ENABLED_TARGETS+="aarch64-softmmu,"
|
||||
ENABLED_TARGETS+="arm-softmmu,"
|
||||
ENABLED_TARGETS+="i386-softmmu,"
|
||||
ENABLED_TARGETS+="riscv32-softmmu,"
|
||||
ENABLED_TARGETS+="riscv64-softmmu,"
|
||||
ENABLED_TARGETS+="x86_64-softmmu"
|
||||
|
||||
# Force-link with liblog and libandroid-shmem.
|
||||
LDFLAGS+=" -landroid-shmem -llog"
|
||||
|
||||
./configure \
|
||||
--prefix="$TERMUX_PREFIX" \
|
||||
--host-cc="gcc" \
|
||||
--cross-prefix="${CC//clang}" \
|
||||
--cc="$CC" \
|
||||
--cxx="$CXX" \
|
||||
--objcc="$CC" \
|
||||
--extra-cflags="$CFLAGS" \
|
||||
--extra-cxxflags="$CXXFLAGS" \
|
||||
--extra-ldflags="$LDFLAGS" \
|
||||
--enable-pie \
|
||||
--target-list="$ENABLED_TARGETS" \
|
||||
--interp-prefix="$TERMUX_PREFIX/gnemul" \
|
||||
--smbd="$TERMUX_PREFIX/bin/smbd" \
|
||||
--enable-tools \
|
||||
--disable-guest-agent \
|
||||
--enable-capstone \
|
||||
--enable-coroutine-pool \
|
||||
--disable-avx2 \
|
||||
--disable-jemalloc \
|
||||
--disable-tcmalloc \
|
||||
--disable-membarrier \
|
||||
--disable-seccomp \
|
||||
--disable-linux-aio \
|
||||
--disable-numa \
|
||||
--disable-brlapi \
|
||||
--disable-bluez \
|
||||
--disable-netmap \
|
||||
--disable-usb-redir \
|
||||
--disable-vde \
|
||||
--disable-vhost-crypto \
|
||||
--disable-vhost-net \
|
||||
--disable-vhost-user \
|
||||
--disable-vhost-vsock \
|
||||
--disable-hax \
|
||||
--disable-hvf \
|
||||
--disable-kvm \
|
||||
--disable-whpx \
|
||||
--disable-xen \
|
||||
--disable-virglrenderer \
|
||||
--enable-curses \
|
||||
--disable-gtk \
|
||||
--disable-opengl \
|
||||
--enable-sdl \
|
||||
--disable-vte \
|
||||
--enable-vnc \
|
||||
--enable-vnc-jpeg \
|
||||
--enable-vnc-png \
|
||||
--enable-vnc-sasl \
|
||||
--disable-spice \
|
||||
--disable-crypto-afalg \
|
||||
--enable-gnutls \
|
||||
--enable-nettle \
|
||||
--disable-gcrypt \
|
||||
--enable-curl \
|
||||
--enable-libnfs \
|
||||
--enable-libssh2 \
|
||||
--enable-bzip2 \
|
||||
--enable-lzo \
|
||||
--disable-snappy \
|
||||
--disable-glusterfs \
|
||||
--disable-libiscsi \
|
||||
--disable-libusb \
|
||||
--disable-mpath \
|
||||
--disable-rbd \
|
||||
--enable-virtfs \
|
||||
--disable-xfsctl \
|
||||
--disable-libpmem \
|
||||
--enable-bochs \
|
||||
--enable-cloop \
|
||||
--enable-dmg \
|
||||
--enable-parallels \
|
||||
--enable-qcow1 \
|
||||
--enable-qed \
|
||||
--enable-sheepdog \
|
||||
--enable-vdi \
|
||||
--enable-vvfat \
|
||||
--disable-vxhs \
|
||||
--enable-fdt \
|
||||
--enable-tpm \
|
||||
--disable-smartcard \
|
||||
--enable-attr \
|
||||
--disable-cap-ng \
|
||||
--enable-libxml2
|
||||
}
|
||||
|
||||
termux_step_post_make_install() {
|
||||
for i in aarch64 arm i386 riscv32 riscv64 x86_64; do
|
||||
ln -sfr \
|
||||
"${TERMUX_PREFIX}"/share/man/man1/qemu.1 \
|
||||
"${TERMUX_PREFIX}"/share/man/man1/qemu-system-${i}.1
|
||||
done
|
||||
unset i
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
TERMUX_SUBPKG_DESCRIPTION="A generic and open source machine emulator (aarch64)"
|
||||
TERMUX_SUBPKG_DEPENDS="capstone, dtc, glib, libandroid-shmem, libbz2, libc++, libcurl, libgnutls, libjpeg-turbo, liblzo, libnettle, libnfs, libpixman, libpng, libsasl, libssh2, libxml2, ncurses, qemu-common, sdl2"
|
||||
|
||||
TERMUX_SUBPKG_INCLUDE="
|
||||
bin/qemu-system-aarch64
|
||||
share/man/man1/qemu-system-aarch64.1.gz"
|
@ -1,6 +0,0 @@
|
||||
TERMUX_SUBPKG_DESCRIPTION="A generic and open source machine emulator (arm)"
|
||||
TERMUX_SUBPKG_DEPENDS="capstone, dtc, glib, libandroid-shmem, libbz2, libc++, libcurl, libgnutls, libjpeg-turbo, liblzo, libnettle, libnfs, libpixman, libpng, libsasl, libssh2, libxml2, ncurses, qemu-common, sdl2"
|
||||
|
||||
TERMUX_SUBPKG_INCLUDE="
|
||||
bin/qemu-system-arm
|
||||
share/man/man1/qemu-system-arm.1.gz"
|
@ -1,6 +0,0 @@
|
||||
TERMUX_SUBPKG_DESCRIPTION="A generic and open source machine emulator and virtualizer (i386)"
|
||||
TERMUX_SUBPKG_DEPENDS="capstone, dtc, glib, libandroid-shmem, libbz2, libc++, libcurl, libgnutls, libjpeg-turbo, liblzo, libnettle, libnfs, libpixman, libpng, libsasl, libssh2, libxml2, ncurses, qemu-common, sdl2"
|
||||
|
||||
TERMUX_SUBPKG_INCLUDE="
|
||||
bin/qemu-system-i386
|
||||
share/man/man1/qemu-system-i386.1.gz"
|
@ -1,6 +0,0 @@
|
||||
TERMUX_SUBPKG_DESCRIPTION="A generic and open source machine emulator (riscv32)"
|
||||
TERMUX_SUBPKG_DEPENDS="capstone, dtc, glib, libandroid-shmem, libbz2, libc++, libcurl, libgnutls, libjpeg-turbo, liblzo, libnettle, libnfs, libpixman, libpng, libsasl, libssh2, libxml2, ncurses, qemu-common, sdl2"
|
||||
|
||||
TERMUX_SUBPKG_INCLUDE="
|
||||
bin/qemu-system-riscv32
|
||||
share/man/man1/qemu-system-riscv32.1.gz"
|
@ -1,6 +0,0 @@
|
||||
TERMUX_SUBPKG_DESCRIPTION="A generic and open source machine emulator (riscv64)"
|
||||
TERMUX_SUBPKG_DEPENDS="capstone, dtc, glib, libandroid-shmem, libbz2, libc++, libcurl, libgnutls, libjpeg-turbo, liblzo, libnettle, libnfs, libpixman, libpng, libsasl, libssh2, libxml2, ncurses, qemu-common, sdl2"
|
||||
|
||||
TERMUX_SUBPKG_INCLUDE="
|
||||
bin/qemu-system-riscv64
|
||||
share/man/man1/qemu-system-riscv64.1.gz"
|
@ -1,6 +0,0 @@
|
||||
TERMUX_SUBPKG_DESCRIPTION="A generic and open source machine emulator and virtualizer (x86_64)"
|
||||
TERMUX_SUBPKG_DEPENDS="capstone, dtc, glib, libandroid-shmem, libbz2, libc++, libcurl, libgnutls, libjpeg-turbo, liblzo, libnettle, libnfs, libpixman, libpng, libsasl, libssh2, libxml2, ncurses, qemu-common, sdl2"
|
||||
|
||||
TERMUX_SUBPKG_INCLUDE="
|
||||
bin/qemu-system-x86_64
|
||||
share/man/man1/qemu-system-x86_64.1.gz"
|
@ -1,8 +0,0 @@
|
||||
TERMUX_SUBPKG_DESCRIPTION="A set of utilities for working with the QEMU emulators"
|
||||
TERMUX_SUBPKG_DEPENDS="capstone, glib, libandroid-shmem, libbz2, libc++, libcurl, libgnutls, libnettle, libnfs, libssh2, libxml2"
|
||||
|
||||
TERMUX_SUBPKG_INCLUDE="
|
||||
bin/qemu-img
|
||||
bin/qemu-io
|
||||
bin/qemu-nbd
|
||||
share/man/man1/qemu-img.1.gz"
|
Loading…
Reference in New Issue
Block a user