SHA256
1
0
forked from pool/qemu

Accepting request 70250 from home:anubisg1:networking

enabled vde2 support (accept 70249 first), new upstream version 0.14.1, added patch for enabling udp tunneling and multicast

OBS-URL: https://build.opensuse.org/request/show/70250
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=11
This commit is contained in:
Bruce Rogers 2011-05-16 22:37:59 +00:00 committed by Git OBS Bridge
parent 19b362cff3
commit 610c23cc84
6 changed files with 348 additions and 54 deletions

View File

@ -1,25 +0,0 @@
From 3f23daf11dab4206ef87839bb513c4f97609f112 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Wed, 17 Jun 2009 14:54:48 +0200
Subject: [PATCH 14/17] qemu-0.11-git-ioctl_mount
---
linux-user/ioctls.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index 13ff54f..2442040 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -317,7 +317,7 @@
IOCTL(LOOP_CLR_FD, 0, TYPE_INT)
IOCTL(LOOP_SET_STATUS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info)))
IOCTL(LOOP_GET_STATUS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info)))
-#if 0 /* These have some problems - not fully tested */
+#if 1 /* These have some problems - not fully tested */
IOCTL(LOOP_SET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
IOCTL(LOOP_GET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
#endif
--
1.7.1

View File

@ -0,0 +1,289 @@
diff -uNr old-qemu-0.14.1//block/raw-win32.c qemu-0.14.1/block/raw-win32.c
--- old-qemu-0.14.1//block/raw-win32.c 2011-05-06 21:01:43.000000000 +0200
+++ qemu-0.14.1/block/raw-win32.c 2011-05-11 15:41:45.744749392 +0200
@@ -93,7 +93,7 @@
else if (!(flags & BDRV_O_CACHE_WB))
overlapped |= FILE_FLAG_WRITE_THROUGH;
s->hfile = CreateFile(filename, access_flags,
- FILE_SHARE_READ, NULL,
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, overlapped, NULL);
if (s->hfile == INVALID_HANDLE_VALUE) {
int err = GetLastError();
@@ -354,7 +354,7 @@
else if (!(flags & BDRV_O_CACHE_WB))
overlapped |= FILE_FLAG_WRITE_THROUGH;
s->hfile = CreateFile(filename, access_flags,
- FILE_SHARE_READ, NULL,
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
create_flags, overlapped, NULL);
if (s->hfile == INVALID_HANDLE_VALUE) {
int err = GetLastError();
diff -uNr old-qemu-0.14.1//hw/e1000.c qemu-0.14.1/hw/e1000.c
--- old-qemu-0.14.1//hw/e1000.c 2011-05-06 21:01:43.000000000 +0200
+++ qemu-0.14.1/hw/e1000.c 2011-05-11 15:41:45.744749392 +0200
@@ -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)) //&& (rctl & E1000_RCTL_MPE)) // promiscuous mcast
return 1;
if ((rctl & E1000_RCTL_BAM) && !memcmp(buf, bcast, sizeof bcast))
diff -uNr old-qemu-0.14.1//Makefile.objs qemu-0.14.1/Makefile.objs
--- old-qemu-0.14.1//Makefile.objs 2011-05-06 21:01:43.000000000 +0200
+++ qemu-0.14.1/Makefile.objs 2011-05-11 15:41:45.751749392 +0200
@@ -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 -uNr old-qemu-0.14.1//net/udp.c qemu-0.14.1/net/udp.c
--- old-qemu-0.14.1//net/udp.c 1970-01-01 01:00:00.000000000 +0100
+++ qemu-0.14.1/net/udp.c 2011-05-11 15:41:45.752749392 +0200
@@ -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 -uNr old-qemu-0.14.1//net/udp.h qemu-0.14.1/net/udp.h
--- old-qemu-0.14.1//net/udp.h 1970-01-01 01:00:00.000000000 +0100
+++ qemu-0.14.1/net/udp.h 2011-05-11 15:41:45.752749392 +0200
@@ -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 -uNr old-qemu-0.14.1//net.c qemu-0.14.1/net.c
--- old-qemu-0.14.1//net.c 2011-05-06 21:01:44.000000000 +0200
+++ qemu-0.14.1/net.c 2011-05-11 15:42:53.145749408 +0200
@@ -30,6 +30,7 @@
#include "net/dump.h"
#include "net/slirp.h"
#include "net/vde.h"
+#include "net/udp.h"
#include "net/util.h"
#include "monitor.h"
#include "sysemu.h"
@@ -1085,9 +1086,31 @@
.help = "permissions for socket",
},
{ /* end of list */ }
- },
+ },
#endif
}, {
+
+ .type = "udp",
+ .init = net_init_udp,
+ .desc = {
+ NET_COMMON_PARAMS_DESC,
+ {
+ .name = "sport",
+ .type = QEMU_OPT_NUMBER,
+
+ .help = "source port number",
+ }, {
+ .name = "daddr",
+ .type = QEMU_OPT_STRING,
+ .help = "destination IP address",
+ }, {
+ .name = "dport",
+ .type = QEMU_OPT_NUMBER,
+ .help = "destination port number",
+ },
+ { /* end of list */ }
+ },
+ }, {
.type = "dump",
.init = net_init_dump,
.desc = {
diff -uNr old-qemu-0.14.1//net.h qemu-0.14.1/net.h
--- old-qemu-0.14.1//net.h 2011-05-06 21:01:44.000000000 +0200
+++ qemu-0.14.1/net.h 2011-05-11 15:41:45.754749392 +0200
@@ -35,6 +35,7 @@
NET_CLIENT_TYPE_TAP,
NET_CLIENT_TYPE_SOCKET,
NET_CLIENT_TYPE_VDE,
+ NET_CLIENT_TYPE_UDP,
NET_CLIENT_TYPE_DUMP
} net_client_type;
diff -uNr old-qemu-0.14.1//qemu-options.hx qemu-0.14.1/qemu-options.hx
--- old-qemu-0.14.1//qemu-options.hx 2011-05-06 21:01:44.000000000 +0200
+++ qemu-0.14.1/qemu-options.hx 2011-05-11 15:41:45.755749392 +0200
@@ -1070,6 +1070,8 @@
"-net socket[,vlan=n][,name=str][,fd=h][,mcast=maddr:port[,localaddr=addr]]\n"
" connect the vlan 'n' to multicast maddr and port\n"
" use 'localaddr=addr' to specify the host address to send packets from\n"
+ "-net udp[,vlan=n]sport=sport,dport=dport,daddr=host\n"
+ " connect the vlan 'n' to a UDP tunnel (for Dynamips/GNS3)\n"
#ifdef CONFIG_VDE
"-net vde[,vlan=n][,name=str][,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n"
" connect the vlan 'n' to port 'n' of a vde switch running\n"

View File

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

3
qemu-0.14.1.tar.bz2 Normal file
View File

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

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Wed May 11 13:47:03 UTC 2011 - andrea@opensuse.org
- added 0018-qemu-0.14.1-mcast-udp.patch to enable multicast and
udp tunneling support
-------------------------------------------------------------------
Tue May 10 15:09:50 UTC 2011 - andrea@opensuse.org
- New Upstream version 0.14.1
See http://wiki.qemu.org/Changelog/0.14 for changes in 0.14
- removed 0014-qemu-0.11-git-ioctl_mount.patch not required anymore
- enabled vde support
- some spec clean up
-------------------------------------------------------------------
Mon Feb 21 10:48:07 UTC 2011 - coolo@novell.com

View File

@ -19,14 +19,13 @@
Name: qemu
BuildRequires: SDL-devel bison bluez-devel curl-devel cyrus-sasl-devel e2fsprogs-devel libaio libaio-devel libgnutls-devel libpcap-devel ncurses-devel zlib-devel-static
Url: http://fabrice.bellard.free.fr/qemu/
License: BSD3c(or similar) ; GPLv2+ ; LGPLv2.1+ ; MIT License (or similar)
Group: System/Emulators/PC
Summary: Universal CPU emulator
Version: 0.14.0_rc1
Version: 0.14.1
Release: 2
Source: %name-0.14.0-rc1.tar.bz2
Source: %name-%version.tar.bz2
Patch1: 0001-qemu-0.7.0-amd64.patch
Patch2: 0002-qemu-0.9.0.cvs-binfmt.patch
Patch3: 0003-qemu-cvs-alsa_bitfield.patch
@ -40,14 +39,30 @@ Patch10: 0010-qemu-cvs-mmap-amd64.patch
Patch11: 0011-qemu-img-vmdk-scsi.patch
Patch12: 0012-qemu-nonvoid_return.patch
Patch13: 0013-i386-linux-user-NPTL-support.patch
Patch14: 0014-qemu-0.11-git-ioctl_mount.patch
Patch15: 0015-S-390-support.patch
Patch16: 0016-fix-mipsn32-linux-user-builds.patch
Patch17: 0017-S-390-build-fix.patch
Patch18: 0018-qemu-0.14.1-mcast-udp.patch
# this is to make lint happy
Source300: rpmlintrc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExclusiveArch: %ix86 ppc sparc %arm x86_64 s390x
BuildRequires: SDL-devel
BuildRequires: bison
BuildRequires: bluez-devel
BuildRequires: curl-devel
BuildRequires: cyrus-sasl-devel
BuildRequires: e2fsprogs-devel
BuildRequires: libaio
BuildRequires: libaio-devel
BuildRequires: libgnutls-devel
BuildRequires: libpcap-devel
BuildRequires: ncurses-devel
BuildRequires: zlib-devel-static
BuildRequires: libvdehist0-devel
BuildRequires: libvdemgmt0-devel
BuildRequires: libvdeplug3-devel
BuildRequires: libvdesnmp0-devel
Requires: timezone virt-utils
%description
@ -64,7 +79,7 @@ Authors:
Fabrice Bellard <fabrice.bellard@free.fr>
%prep
%setup -q -n %name-0.14.0-rc1
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
@ -78,22 +93,22 @@ Authors:
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%ifarch s390x ppc64 x86_64
# s390 target only builds on 64-bit machines
%patch15 -p1
%patch17 -p1
%endif
%patch16 -p1
%patch18 -p1
%build
# build QEMU
mkdir -p dynamic
# build qemu-system
./configure --prefix=/usr --sysconfdir=%_sysconfdir \
--interp-prefix=/usr/share/qemu/qemu-i386 \
./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \
--interp-prefix=%_datadir/%name/qemu-i386 \
--audio-card-list="ac97 es1370 sb16 cs4231a adlib gus" \
--audio-drv-list="alsa sdl" --enable-mixemu \
--audio-drv-list="alsa sdl" --enable-mixemu --enable-vde \
--extra-cflags="$QEMU_OPT_FLAGS" --enable-system --disable-linux-user \
%ifarch ppc
--disable-kvm
@ -107,8 +122,8 @@ make qemu-img V=1
mv */qemu */qemu-* qemu-io dynamic || true
make clean
# build userland emus
./configure --prefix=/usr --sysconfdir=%_sysconfdir \
--interp-prefix=/usr/share/qemu/qemu-i386 \
./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \
--interp-prefix=%_datadir/%name/qemu-i386 \
--enable-linux-user \
--disable-system \
--static --disable-linux-aio \
@ -117,14 +132,14 @@ make -j1 V=1
%install
make install DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT/usr/share/man/man1/qemu-img.1
rm -f $RPM_BUILD_ROOT/usr/share/man/man8/qemu-nbd.8
rm -fr $RPM_BUILD_ROOT/usr/share/doc
install -m 755 */qemu $RPM_BUILD_ROOT/usr/bin
ln -sf qemu $RPM_BUILD_ROOT/usr/bin/qemu-system-i386
install -m 755 */qemu-*[^.]? $RPM_BUILD_ROOT/usr/bin
install -d -m 755 $RPM_BUILD_ROOT/usr/sbin
install -m 755 dynamic/qemu-binfmt-conf.sh $RPM_BUILD_ROOT/usr/sbin
rm -f $RPM_BUILD_ROOT/%_mandir/man1/qemu-img.1
rm -f $RPM_BUILD_ROOT/%_mandir/man8/qemu-nbd.8
rm -fr $RPM_BUILD_ROOT/%_datadir/doc
install -m 755 */qemu $RPM_BUILD_ROOT/%_bindir
ln -sf qemu $RPM_BUILD_ROOT/%_bindir/qemu-system-i386
install -m 755 */qemu-*[^.]? $RPM_BUILD_ROOT/%_bindir
install -d -m 755 $RPM_BUILD_ROOT/%_sbindir
install -m 755 dynamic/qemu-binfmt-conf.sh $RPM_BUILD_ROOT/%_sbindir
%ifnarch %ix86 x86_64
ln -sf ../../../emul/ia32-linux $RPM_BUILD_ROOT/usr/share/qemu/qemu-i386
%endif
@ -138,15 +153,15 @@ rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(-, root, root)
%doc COPYING COPYING.LIB Changelog README TODO VERSION qemu-doc.html qemu-tech.html
/usr/bin/qemu
/usr/bin/qemu-*
/usr/sbin/qemu*
%doc %{_mandir}/man[18]/qemu*.[18].gz
/usr/share/qemu
%_bindir/qemu
%_bindir/qemu-*
%_sbindir/qemu*
%doc %_mandir/man[18]/qemu*.[18].gz
%_datadir/%name
%ifnarch %ix86 x86_64 ia64
%dir /emul/ia32-linux
%endif
%dir %_sysconfdir/qemu
%config %_sysconfdir/qemu/target-x86_64.conf
%dir %_sysconfdir/%name
%config %_sysconfdir/%name/target-x86_64.conf
%changelog