summaryrefslogtreecommitdiff
path: root/emulators/qemu-devel/files
diff options
context:
space:
mode:
authorJuergen Lock <nox@FreeBSD.org>2012-02-17 22:31:17 +0000
committerJuergen Lock <nox@FreeBSD.org>2012-02-17 22:31:17 +0000
commit743f1c15fc9f1c7ea4748451fb7a0c731c0dd22a (patch)
tree08d1133d67fb4af99c7ef3904d236dbdaed57c47 /emulators/qemu-devel/files
parent- Update to 1.6.3 (diff)
Update to 1.0.1 - announce message is here:
http://lists.nongnu.org/archive/html/qemu-devel/2012-02/msg02458.html
Diffstat (limited to 'emulators/qemu-devel/files')
-rw-r--r--emulators/qemu-devel/files/Makefile_objs.patch10
-rw-r--r--emulators/qemu-devel/files/hw_e1000_c.patch11
-rw-r--r--emulators/qemu-devel/files/net_udp_c.patch141
-rw-r--r--emulators/qemu-devel/files/net_udp_h.patch35
-rw-r--r--emulators/qemu-devel/files/patch-sgabios-read-only-rom16.ld15
5 files changed, 197 insertions, 15 deletions
diff --git a/emulators/qemu-devel/files/Makefile_objs.patch b/emulators/qemu-devel/files/Makefile_objs.patch
new file mode 100644
index 000000000000..5f8c04b5ed8d
--- /dev/null
+++ b/emulators/qemu-devel/files/Makefile_objs.patch
@@ -0,0 +1,10 @@
+--- qemu-0.14.1/Makefile.objs.orig Thu Jun 23 17:44:50 2011
++++ qemu-0.14.1/Makefile.objs Thu Jun 23 17:45:01 2011
+@@ -34,6 +34,7 @@
+ net-nested-y = queue.o checksum.o util.o
+ net-nested-y += socket.o
+ net-nested-y += dump.o
++net-nested-y += udp.o
+ net-nested-$(CONFIG_POSIX) += tap.o
+ net-nested-$(CONFIG_LINUX) += tap-linux.o
+ net-nested-$(CONFIG_WIN32) += tap-win32.o
diff --git a/emulators/qemu-devel/files/hw_e1000_c.patch b/emulators/qemu-devel/files/hw_e1000_c.patch
new file mode 100644
index 000000000000..15b2494f0d40
--- /dev/null
+++ b/emulators/qemu-devel/files/hw_e1000_c.patch
@@ -0,0 +1,11 @@
+--- qemu-0.14.1/hw/e1000.c.orig Thu Jun 23 17:01:19 2011
++++ qemu-0.14.1/hw/e1000.c Thu Jun 23 17:02:30 2011
+@@ -573,7 +573,7 @@
+ if (rctl & E1000_RCTL_UPE) // promiscuous
+ return 1;
+
+- if ((buf[0] & 1) && (rctl & E1000_RCTL_MPE)) // promiscuous mcast
++ if (buf[0] & 1) // promiscuous mcast
+ return 1;
+
+ if ((rctl & E1000_RCTL_BAM) && !memcmp(buf, bcast, sizeof bcast))
diff --git a/emulators/qemu-devel/files/net_udp_c.patch b/emulators/qemu-devel/files/net_udp_c.patch
new file mode 100644
index 000000000000..9fb9b084b772
--- /dev/null
+++ b/emulators/qemu-devel/files/net_udp_c.patch
@@ -0,0 +1,141 @@
+--- qemu-0.14.1/net/udp.c.orig Thu Jun 23 17:09:02 2011
++++ qemu-0.14.1/net/udp.c Thu Jun 23 17:10:17 2011
+@@ -0,0 +1,138 @@
++/*
++ * QEMU System Emulator
++ *
++ * Copyright (c) 2003-2008 Fabrice Bellard
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this software and associated documentation files (the "Software"), to deal
++ * in the Software without restriction, including without limitation the rights
++ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
++ * copies of the Software, and to permit persons to whom the Software is
++ * furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
++ * THE SOFTWARE.
++ */
++#include "net/udp.h"
++
++#include "config-host.h"
++
++#ifndef _WIN32
++#include <arpa/inet.h>
++#include <netinet/in.h>
++#include <netinet/udp.h>
++#endif
++
++#include "net.h"
++#include "qemu-char.h"
++#include "qemu-common.h"
++#include "qemu-option.h"
++#include "qemu_socket.h"
++#include "sysemu.h"
++
++
++typedef struct UDPState {
++ VLANClientState nc;
++ int rfd;
++ struct sockaddr_in sender;
++} UDPState;
++
++static void udp_to_qemu(void *opaque)
++{
++ UDPState *s = opaque;
++ uint8_t buf[4096];
++ int size;
++
++ size = recvfrom(s->rfd, (char *)buf, sizeof(buf), 0, NULL, NULL);
++ if (size > 0) {
++ qemu_send_packet(&s->nc, buf, size);
++ }
++}
++
++static ssize_t udp_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
++{
++ UDPState *s = DO_UPCAST(UDPState, nc, nc);
++ int ret;
++
++ do {
++ ret = sendto(s->rfd, (const char *)buf, size, 0, (struct sockaddr *)&s->sender, sizeof (s->sender));
++ } while (ret < 0 && errno == EINTR);
++
++ return ret;
++}
++
++static void udp_cleanup(VLANClientState *nc)
++{
++ UDPState *s = DO_UPCAST(UDPState, nc, nc);
++ qemu_set_fd_handler(s->rfd, NULL, NULL, NULL);
++ close(s->rfd);
++}
++
++static NetClientInfo net_udp_info = {
++ .type = NET_CLIENT_TYPE_UDP,
++ .size = sizeof(UDPState),
++ .receive = udp_receive,
++ .cleanup = udp_cleanup,
++};
++
++static int net_udp_init(VLANState *vlan, const char *model,
++ const char *name, int sport,
++ const char *daddr, int dport)
++{
++ VLANClientState *nc;
++ UDPState *s;
++ struct sockaddr_in receiver;
++ int ret;
++
++ nc = qemu_new_net_client(&net_udp_info, vlan, NULL, model, name);
++
++ snprintf(nc->info_str, sizeof(nc->info_str),"udp: %i->%s:%i",
++ sport, daddr, dport);
++
++ s = DO_UPCAST(UDPState, nc, nc);
++
++ s->rfd = socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP);
++ receiver.sin_family = AF_INET;
++ receiver.sin_addr.s_addr = INADDR_ANY;
++ receiver.sin_port = htons(sport);
++ ret = bind(s->rfd, (struct sockaddr *)&receiver, sizeof(receiver));
++
++ if (ret == -1) {
++ fprintf (stderr, "bind error:%s\n", strerror(errno));
++ return ret;
++ }
++
++ memset((char*)&s->sender, 0,sizeof(s->sender));
++ s->sender.sin_family = AF_INET;
++ s->sender.sin_port = htons(dport);
++ inet_aton(daddr, &s->sender.sin_addr);
++
++ qemu_set_fd_handler(s->rfd, udp_to_qemu, NULL, s);
++
++ return 0;
++}
++
++int net_init_udp(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan)
++{
++ const char *daddr;
++ int sport, dport;
++
++ daddr = qemu_opt_get(opts, "daddr");
++
++ sport = qemu_opt_get_number(opts, "sport", 0);
++ dport = qemu_opt_get_number(opts, "dport", 0);
++
++ if (net_udp_init(vlan, "udp", name, sport, daddr, dport) == -1) {
++ return -1;
++ }
++
++ return 0;
++}
diff --git a/emulators/qemu-devel/files/net_udp_h.patch b/emulators/qemu-devel/files/net_udp_h.patch
new file mode 100644
index 000000000000..a6f9d7f75c37
--- /dev/null
+++ b/emulators/qemu-devel/files/net_udp_h.patch
@@ -0,0 +1,35 @@
+--- qemu-0.14.1/net/udp.h.orig Thu Jun 23 17:12:45 2011
++++ qemu-0.14.1/net/udp.h Thu Jun 23 17:12:28 2011
+@@ -0,0 +1,32 @@
++/*
++ * QEMU System Emulator
++ *
++ * Copyright (c) 2003-2008 Fabrice Bellard
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this software and associated documentation files (the "Software"), to deal
++ * in the Software without restriction, including without limitation the rights
++ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
++ * copies of the Software, and to permit persons to whom the Software is
++ * furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
++ * THE SOFTWARE.
++ */
++#ifndef QEMU_NET_UDP_H
++#define QEMU_NET_UDP_H
++
++#include "qemu-common.h"
++#include "qemu-option.h"
++
++int net_init_udp(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan);
++
++#endif /* QEMU_NET_UDP_H */
diff --git a/emulators/qemu-devel/files/patch-sgabios-read-only-rom16.ld b/emulators/qemu-devel/files/patch-sgabios-read-only-rom16.ld
deleted file mode 100644
index 624d8273a32e..000000000000
--- a/emulators/qemu-devel/files/patch-sgabios-read-only-rom16.ld
+++ /dev/null
@@ -1,15 +0,0 @@
-Index: a/../sgabios-read-only/rom16.ld
-===================================================================
---- sgabios-read-only/rom16.ld (revision 8)
-+++ sgabios-read-only/rom16.ld (working copy)
-@@ -3,8 +3,8 @@
- */
-
- /* Script for -z combreloc: combine and sort reloc sections */
--OUTPUT_FORMAT("elf32-i386", "elf32-i386",
-- "elf32-i386")
-+OUTPUT_FORMAT("elf32-i386-freebsd", "elf32-i386-freebsd",
-+ "elf32-i386-freebsd")
- OUTPUT_ARCH(i386)
- EXTERN(_start)
- ENTRY(_start)