SHA256
1
0
forked from pool/qemu
Alexander Graf
2012-02-03 13:37:47 +00:00
committed by Git OBS Bridge
parent ce9a9e892b
commit f4f549f4e3

View File

@@ -1,4 +1,4 @@
From 3ee42b48dd69ca6f4cf35a065628088bbdf7fa4f Mon Sep 17 00:00:00 2001 From 20d9c73417a401a79a3c5ae9aa07d635a06e9519 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de> From: Alexander Graf <agraf@suse.de>
Date: Thu, 2 Feb 2012 18:02:33 +0100 Date: Thu, 2 Feb 2012 18:02:33 +0100
Subject: [PATCH] linux-user: binfmt: support host binaries Subject: [PATCH] linux-user: binfmt: support host binaries
@@ -8,11 +8,11 @@ trying to run, let's just use that instead as it will be a lot faster.
Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
--- ---
linux-user/binfmt.c | 27 +++++++++++++++++++++++++++ linux-user/binfmt.c | 25 +++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-) 1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/linux-user/binfmt.c b/linux-user/binfmt.c diff --git a/linux-user/binfmt.c b/linux-user/binfmt.c
index cd1f513..74f5741 100644 index cd1f513..87dc4c6 100644
--- a/linux-user/binfmt.c --- a/linux-user/binfmt.c
+++ b/linux-user/binfmt.c +++ b/linux-user/binfmt.c
@@ -5,6 +5,9 @@ @@ -5,6 +5,9 @@
@@ -25,7 +25,7 @@ index cd1f513..74f5741 100644
int main(int argc, char **argv, char **envp) int main(int argc, char **argv, char **envp)
{ {
@@ -28,6 +31,30 @@ int main(int argc, char **argv, char **envp) @@ -28,6 +31,28 @@ int main(int argc, char **argv, char **envp)
binfmt[0] = '\0'; binfmt[0] = '\0';
/* Now argv[0] is the real qemu binary name */ /* Now argv[0] is the real qemu binary name */
@@ -39,9 +39,7 @@ index cd1f513..74f5741 100644
+ goto skip; + goto skip;
+ } + }
+ guestarch++; + guestarch++;
+ hostbin = malloc(strlen(argv[1] + strlen("/emul/-for-/" ARCH_NAME) + + asprintf(&hostbin, "/emul/" ARCH_NAME "-for-%s/%s", guestarch, argv[1]);
+ strlen(guestarch) + 1));
+ sprintf(hostbin, "/emul/" ARCH_NAME "-for-%s/%s", guestarch, argv[1]);
+ if (!access(hostbin, X_OK)) { + if (!access(hostbin, X_OK)) {
+ /* + /*
+ * We found a host binary replacement for the non-host binary. Let's + * We found a host binary replacement for the non-host binary. Let's