Statistics
| Branch: | Revision:

root / net @ 0d09e41a

# Date Author Comment
0d09e41a 04/08/2013 07:13 pm Paolo Bonzini

hw: move headers to include/

Many of these should be cleaned up with proper qdev-/QOM-ification.
Right now there are many catch-all headers in include/hw/ARCH depending
on cpu.h, and this makes it necessary to compile these files per-target.
However, fixing this does not belong in these patches....

456d6069 04/05/2013 03:21 am Hans de Goede

qemu-char: Call fe_claim / fe_release when not using qdev chr properties

chardev-frontends need to explictly check, increase and decrement the
avail_connections "property" of the chardev when they are not using a
qdev-chardev-property for the chardev.

This fixes things like:...

f9e8cacc 04/02/2013 06:47 pm Stefan Hajnoczi

oslib-posix: rename socket_set_nonblock() to qemu_set_nonblock()

The fcntl(fd, F_SETFL, O_NONBLOCK) flag is not specific to sockets.
Rename to qemu_set_nonblock() just like qemu_set_cloexec().

Signed-off-by: Stefan Hajnoczi <>
Reviewed-by: Eric Blake <>...

fc13fa00 04/02/2013 06:47 pm Stefan Hajnoczi

net: ensure "socket" backend uses non-blocking fds

There are several code paths in net_init_socket() depending on how the
socket is created: file descriptor passing, UDP multicast, TCP, or UDP.
Some of these support both listen and connect.

Not all code paths set the socket to non-blocking. This patch addresses...

d32fcad3 03/25/2013 12:14 pm Scott Feldman

net: increase buffer size to accommodate Jumbo frame pkts

Socket buffer sizes were hard-coded to 4K for VDE and socket netdevs. Bump this
up to 68K (ala tap netdev) to handle maximum GSO packet size (64k) plus plenty
of room for the ethernet and virtio_net headers....

84026301 03/25/2013 12:13 pm Dmitry Fleytman

net: iovec checksum calculator

Signed-off-by: Dmitry Fleytman <>
Signed-off-by: Yan Vugenfirer <>
Signed-off-by: Stefan Hajnoczi <>

75020a70 03/25/2013 12:13 pm Dmitry Fleytman

Common definitions for VMWARE devices

Signed-off-by: Dmitry Fleytman <>
Signed-off-by: Yan Vugenfirer <>
Signed-off-by: Stefan Hajnoczi <>

20048d0a 03/25/2013 12:13 pm Stefan Hajnoczi

net: use socket_set_nodelay() for -netdev socket

Reduce -netdev socket latency by disabling the Nagle algorithm on
SOCK_STREAM sockets in net/socket.c. Since we are tunelling Ethernet
over TCP we shouldn't artificially delay outgoing packets, let the guest...

5acf5ea4 03/25/2013 12:13 pm Dmitry Fleytman

Checksum-related utility functions

net_checksum_add_cont()
checksum calculation for scattered data with odd chunk sizes

net_raw_checksum()
checksum calculation for a buffer

Signed-off-by: Dmitry Fleytman <>
Signed-off-by: Yan Vugenfirer <>...

085d8134 03/22/2013 02:25 pm Peter Maydell

Fix typos and misspellings

Fix various typos and misspellings. The bulk of these were found with
codespell.

Signed-off-by: Peter Maydell <>
Reviewed-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

9957fc7f 03/22/2013 02:14 pm Stefan Weil

MinGW: Replace setsockopt by qemu_setsocketopt

Instead of adding missing type casts which are needed by MinGW for the
4th argument, the patch uses qemu_setsockopt which was invented for this
purpose.

Signed-off-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

ce675a75 02/27/2013 05:10 pm Jason Wang

tap: forbid creating multiqueue tap when hub is used

Obviously, hub does not support multiqueue tap. So this patch forbids creating
multiple queue tap when hub is used to prevent the crash when command line such
as "-net tap,queues=2" is used.

Cc: ...

d26e445c 02/27/2013 05:10 pm Peter Lieven

tap: set IFF_ONE_QUEUE per default

historically the kernel queues packets two times. once
at the device and second in qdisc. this is believed to cause
interface stalls if one of these queues overruns.

setting IFF_ONE_QUEUE is the default in kernels >= 3.8. the...

f6b26cf2 02/27/2013 05:10 pm Jason Wang

net: reduce the unnecessary memory allocation of multiqueue

Edivaldo reports a problem that the array of NetClientState in NICState is too
large - MAX_QUEUE_NUM(1024) which will wastes memory even if multiqueue is not
used.

Instead of static arrays, solving this issue by allocating the queues on demand...

7d91ddd2 02/27/2013 05:10 pm Luigi Rizzo

net: fix unbounded NetQueue

In the current implementation of qemu, running without a network
backend will cause the queue to grow unbounded when the guest is
transmitting traffic.

This patch fixes the problem by implementing bounded size NetQueue,
used with an arbitrary limit of 10000 packets, and dropping packets...

199ee608 02/27/2013 05:10 pm Luigi Rizzo

net: fix qemu_flush_queued_packets() in presence of a hub

When frontend and backend are connected through a hub as below
(showing only one direction), and the frontend (or in general, all
output ports of the hub) cannot accept more traffic, the backend
queues packets in queue-A....

cc2a9043 02/13/2013 07:57 pm Andreas Färber

net: Avoid NULL function pointer dereference on cleanup

The pSeries machine and some other devices don't supply a cleanup
callback. Revert part of 1ceef9f27359cbe92ef124bf74de6f792e71f6fb that
started calling it unconditionally.

Cc: Jason Wang <>...

b8904921 02/07/2013 09:13 pm Michael Roth

net: fix infinite loop on exit

1ceef9f27359cbe92ef124bf74de6f792e71f6fb added handling for cleaning
up multiple queues in qemu_del_nic() for cases where multiqueue is in
use. To determine the number of queues it looks at nic->conf->queues,
then iterates through all the queues to cleanup the associated...

02cd8090 02/02/2013 02:05 am Anthony Liguori

tap: unbreak -netdev tap,fd=X

The multiqueue patch series broke -netdev tap,fd=X which manifests
as libvirt not being able to start a guest. This was because it
passed NULL for the netdev name which results in an anonymous netdev
device regardless of what the user specified....

16dbaf90 02/01/2013 07:03 pm Jason Wang

tap: support enabling or disabling a queue

This patch introduce a new bit - enabled in TAPState which tracks whether a
specific queue/fd is enabled. The tap/fd is enabled during initialization and
could be enabled/disabled by tap_enalbe() and tap_disable() which calls platform...

e5dc0b40 02/01/2013 07:03 pm Jason Wang

tap: introduce a helper to get the name of an interface

This patch introduces a helper tap_get_ifname() to get the device name of tap
device. This is needed when ifname is unspecified in the command line and qemu
were asked to create tap device by itself. In this situation, the name were...

264986e2 02/01/2013 07:03 pm Jason Wang

tap: multiqueue support

Recently, linux support multiqueue tap which could let userspace call TUNSETIFF
for a signle device many times to create multiple file descriptors as
independent queues. User could also enable/disabe a specific queue through
TUNSETQUEUE....

948ecf21 02/01/2013 07:03 pm Jason Wang

net: intorduce qemu_del_nic()

To support multiqueue nic, this patch separate the nic destructor from
qemu_del_net_client() to a new helper qemu_del_nic() since the mapping bettween
NiCState and NetClientState were not 1:1 in multiqueue. The following patches...

6c51ae73 02/01/2013 07:03 pm Jason Wang

net: introduce qemu_find_net_clients_except()

In multiqueue, all NetClientState that belongs to the same netdev or nic has the
same id. So this patches introduces an helper qemu_find_net_clients_except()
which finds all NetClientState with the same id. This will be used by multiqueue...

18a1541a 02/01/2013 07:03 pm Jason Wang

net: introduce qemu_net_client_setup()

This patch separates the setup of NetClientState from its allocation, this will
allow allocating an arrays of NetClientState and does the initialization one by
one which is what multiqueue needs.

Signed-off-by: Jason Wang <>...

f7860455 02/01/2013 07:03 pm Jason Wang

net: introduce NetClientState destructor

To allow allocating an array of NetClientState and free it once, this patch
introduces destructor of NetClientState. Which could do type specific free,
which could be used by multiqueue to free the array once.

Signed-off-by: Jason Wang <>...

1ceef9f2 02/01/2013 07:03 pm Jason Wang

net: multiqueue support

This patch adds basic multiqueue support for qemu. The idea is simple, an array
of NetClientStates were introduced in NICState, parse_netdev() were extended to
find and match all NetClientStates belongs to the backend and place their...

4e4f9ae7 02/01/2013 07:03 pm Jason Wang

tap: import linux multiqueue constants

Import multiqueue constants from if_tun.h from 3.8-rc3. A new ifr flag
IFF_MULTI_QUEUE were introduced to create a multiqueue backend by calling
TUNSETIFF with the this flag and with the same interface name many times....

5193e5fb 02/01/2013 07:03 pm Jason Wang

tap: factor out common tap initialization

This patch factors out the common initialization of tap into a new helper
net_init_tap_one(). This will be used by multiqueue tap patches.

Signed-off-by: Jason Wang <>
Signed-off-by: Anthony Liguori <>

94fdc6d0 02/01/2013 07:03 pm Jason Wang

tap: add Linux multiqueue support

This patch add basic multiqueue support for Linux. When multiqueue is needed, we
will first check whether kernel support multiqueue tap before creating more
queues. Two new functions tap_fd_enable() and tap_fd_disable() were introduced...

cc1f0f45 02/01/2013 07:03 pm Jason Wang

net: introduce qemu_get_nic()

To support multiqueue, this patch introduces a helper qemu_get_nic() to get
NICState from a NetClientState. The following patches would refactor this helper
to support multiqueue.

Signed-off-by: Jason Wang <>...

b356f76d 02/01/2013 07:02 pm Jason Wang

net: introduce qemu_get_queue()

To support multiqueue, the patch introduce a helper qemu_get_queue()
which is used to get the NetClientState of a device. The following patches would
refactor this helper to support multiqueue.

Signed-off-by: Jason Wang <>...

ec45f083 02/01/2013 06:50 pm Jason Wang

net: tap: using bool instead of bitfield

Signed-off-by: Jason Wang <>
Signed-off-by: Anthony Liguori <>

28a65891 02/01/2013 06:50 pm Jason Wang

net: tap: use abort() instead of assert(0)

Signed-off-by: Jason Wang <>
Signed-off-by: Anthony Liguori <>

c64f50d1 01/30/2013 12:14 pm Markus Armbruster

g_strdup(NULL) returns NULL; simplify

Signed-off-by: Markus Armbruster <>
Reviewed-by: Eric Blake <>
Signed-off-by: Stefan Hajnoczi <>

84f2d0ea 01/17/2013 02:24 pm Wenchao Xia

HMP: add QDict to info callback handler

This patch change all info call back function to take
additional QDict * parameter, which allow those command
take parameter. Now it is set to NULL at default case.

Signed-off-by: Wenchao Xia <>...

4d454574 01/12/2013 06:17 pm Paolo Bonzini

qemu-option: move standard option definitions out of qemu-config.c

Signed-off-by: Paolo Bonzini <>

3f124b68 12/22/2012 02:06 pm Liming Wang

net: add missing include file

To fix building error:

CC net/vde.o
net/vde.c: In function ‘vde_cleanup’:
net/vde.c:65:5: error: implicit declaration of function ‘qemu_set_fd_handler’ [-Werror=implicit-function-declaration]
net/vde.c:65:5: error: nested extern declaration of ‘qemu_set_fd_handler’ [-Werror=nested-externs]...

b2136140 12/22/2012 02:05 pm Stefan Weil

net: Add missing include statement (fix compiler warnings for MinGW)

These and some more compiler warnings were caused by a recent commit:

net/tap-win32.c:724: warning: no previous prototype for ‘tap_has_ufo’
net/tap-win32.c:729: warning: no previous prototype for ‘tap_has_vnet_hdr’...

27dd7730 12/20/2012 01:15 am Anthony Liguori

Merge remote-tracking branch 'bonzini/header-dirs' into staging

  • bonzini/header-dirs: (45 commits)
    janitor: move remaining public headers to include/
    hw: move executable format header files to hw/
    fpu: move public header file to include/fpu
    softmmu: move remaining include files to include/ subdirectories...
927d4878 12/19/2012 09:32 am Paolo Bonzini

softmmu: move remaining include files to include/ subdirectories

Signed-off-by: Paolo Bonzini <>

9c17d615 12/19/2012 09:32 am Paolo Bonzini

softmmu: move include files to include/sysemu/

Signed-off-by: Paolo Bonzini <>

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

83c9089e 12/19/2012 09:31 am Paolo Bonzini

monitor: move include files to include/monitor/

Signed-off-by: Paolo Bonzini <>

7b1b5d19 12/19/2012 09:31 am Paolo Bonzini

qapi: move include files to include/qobject/

Signed-off-by: Paolo Bonzini <>

1422e32d 12/19/2012 09:31 am Paolo Bonzini

net: reorganize headers

Move public headers to include/net, and leave private headers in net/.
Put the virtio headers in include/net/tap.h, removing the multiple copies
that existed. Leave include/net/tap.h as the interface for NICs, and
net/tap_int.h as the interface for OS-specific parts of the tap backend....

f8fe7964 12/19/2012 09:29 am Paolo Bonzini

janitor: do not include qemu-char everywhere

Touching char/char.h basically causes the whole of QEMU to
be rebuilt. Avoid this, it is usually unnecessary.

Signed-off-by: Paolo Bonzini <>

fd9400b3 12/19/2012 09:29 am Paolo Bonzini

net: move net.c to net/

Signed-off-by: Paolo Bonzini <>

e103129b 12/18/2012 05:48 pm Zhi Yong Wu

net, hub: fix the indent in the comments

Remove some redundant blanks in the comments of
net_hub_id_for_client().

Signed-off-by: Zhi Yong Wu <>
Signed-off-by: Stefan Hajnoczi <>

89e6d68e 12/12/2012 11:36 pm Michael S. Tsirkin

tap: reset vnet header size on open

For tap, we currently assume the vnet header size is 10
(the default value) but that might not be the case
if tap is persistent and has been used by qemu previously.
To fix, set vnet header size correctly on open.

Signed-off-by: Michael S. Tsirkin <>

eac29d87 12/07/2012 01:34 pm Stefan Weil

Fix spelling (prefered -> preferred)

Signed-off-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

58ddcd50 11/20/2012 04:38 pm Michael S. Tsirkin

tap: reset vnet header size on open

For tap, we currently assume the vnet header size is 10
(the default value) but that might not be the case
if tap is persistent and has been used by qemu previously.
To fix, set host header size in tap device on open.
...

63d2960b 11/15/2012 11:27 am Klaus Stengel

slirp: Add domain-search option to slirp's DHCP server

This patch will allow the user to include the domain-search option in
replies from the built-in DHCP server. The domain suffixes can be
specified by adding dnssearch= entries to the "-net user" parameter....

f0e3ac70 11/01/2012 12:00 pm Lei Li

net: use "socket" model name for UDP sockets

Fix the problem that can not delete the udp socket.
It's caused by passing "udp" model to net_socket_udp_init,
but we do not have "udp" model in our model list.
Pass the right model "socket" to init function.
...

aee0bf7d 10/30/2012 09:18 pm Michael S. Tsirkin

tap-win32: stubs to fix win32 build

Add missing stubs to win32 to fix link failure.

Signed-off-by: Michael S. Tsirkin <>
Reported-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

08778b39 10/19/2012 11:39 am Stefan Weil

net/tap-win32: Fix compiler warning caused by missing include statement

The include file for net_init_tap was missing:

net/tap-win32.c:703:
warning: no previous prototype for ‘net_init_tap’

Signed-off-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

a245fc18 10/08/2012 02:59 pm Paolo Bonzini

net: consolidate NetClientState header files into one

This patch doesn't seem much useful alone, I must admit. However,
it makes sense as part of the upcoming directory reorganization,
where I want to have include/net/tap.h as the net<->hw interface
for tap. Then having both net/tap.h and include/net/tap.h does...

73062dfe 09/23/2012 09:37 am Stefan Weil

net/socket: Fix compiler warning (regression for MinGW)

Commit 213fd5087e2e4e2da10ad266df0ba950cf7618bf removed a type cast
which is needed for MinGW:

net/socket.c:136: warning:
pointer targets in passing argument 2 of ‘sendto’ differ in signedness
/usr/lib/gcc/amd64-mingw32msvc/4.4.4/../../../../amd64-mingw32msvc/include/winsock2.h:1313: note:...

61518a74 09/14/2012 10:40 am Stefan Hajnoczi

net: broadcast hub packets if at least one port can receive

In commit 60c07d933c66c4b30a83b7ccbc8a0cb3df1b2d0e ("net: fix
qemu_can_send_packet logic") the "VLAN" broadcast behavior was changed
to queue packets if any net client cannot receive. It turns out that...

863f678f 09/14/2012 10:40 am Stefan Hajnoczi

net: asynchronous send/receive infrastructure for net/socket.c

The net/socket.c net client is not truly asynchronous. This patch
borrows the qemu_set_fd_handler2() code from net/tap.c as the basis for
proper asynchronous send/receive.

Only read packets from the socket when the peer is able to receive....

213fd508 09/14/2012 10:40 am Stefan Hajnoczi

net: EAGAIN handling for net/socket.c UDP

Implement asynchronous send for UDP (or other SOCK_DGRAM) sockets. If
send fails with EAGAIN we wait for the socket to become writable again.

Signed-off-by: Stefan Hajnoczi <>

45a7f54a 09/14/2012 10:40 am Stefan Hajnoczi

net: EAGAIN handling for net/socket.c TCP

Replace spinning send_all() with a proper non-blocking send. When the
socket write buffer limit is reached, we should stop trying to send and
wait for the socket to become writable again.

Non-blocking TCP sockets can return in two different ways when the write...

06b5f36d 09/14/2012 10:40 am Stefan Hajnoczi

net: do not report queued packets as sent

Net send functions have a return value where 0 means the packet has not
been sent and will be queued. A non-zero value means the packet was
sent or an error caused the packet to be dropped.

This patch fixes two instances where packets are queued but we return...

987a9b48 09/14/2012 10:40 am Paolo Bonzini

net: notify iothread after flushing queue

virtio-net has code to flush the queue and notify the iothread
whenever new receive buffers are added by the guest. That is
fine, and indeed we need to do the same in all other drivers.
However, notifying the iothread should be work for the network...

a96ed02f 09/07/2012 09:15 am Nicholas Bellinger

monitor: Rename+move net_handle_fd_param -> monitor_handle_fd_param

This patch renames+moves the net_handle_fd_param() caller used to
obtain a file descriptor from either qemu_parse_fd() (the normal case)
or from monitor_get_fd() (migration case) into a generically prefixed...

427a1a2c 08/09/2012 09:34 pm Blue Swirl

qapi: avoid reserved keywords

Clang compiler complained about use of reserved word 'restrict' in SLIRP
and QAPI.

Prefix C keywords with "q_", adjust SLIRP accordingly.

Reviewed-by: Markus Armbruster <>
Signed-off-by: Blue Swirl <>

1a859593 08/01/2012 03:32 pm Zhi Yong Wu

net: Make "info network" output more readable info

Reviewed-by: Jan Kiszka <>
Signed-off-by: Zhi Yong Wu <>
Signed-off-by: Stefan Hajnoczi <>
Reviewed-by: Laszlo Ersek <>

86a77c38 08/01/2012 03:32 pm Zhi Yong Wu

net: cleanup deliver/deliver_iov func pointers

Reviewed-by: Paolo Bonzini <>
Signed-off-by: Zhi Yong Wu <>
Signed-off-by: Stefan Hajnoczi <>
Reviewed-by: Laszlo Ersek <>

691a4f3a 08/01/2012 03:32 pm Zhi Yong Wu

net: determine if packets can be sent before net queue deliver packets

Reviewed-by: Paolo Bonzini <>
Signed-off-by: Zhi Yong Wu <>
Signed-off-by: Stefan Hajnoczi <>
Reviewed-by: Laszlo Ersek <>

52a3cb86 08/01/2012 03:32 pm Zhi Yong Wu

hub: add the support for hub own flow control

Only when all other hub port's peer .can_receive() all return 1,
the source hub port .can_receive() return 1.

Reviewed-by: Paolo Bonzini <>
Signed-off-by: Zhi Yong Wu <>...

e34cde35 08/01/2012 03:32 pm Zhi Yong Wu

net: fix the coding style

Signed-off-by: Zhi Yong Wu <>
Signed-off-by: Stefan Hajnoczi <>
Reviewed-by: Laszlo Ersek <>

011de2b5 08/01/2012 03:32 pm Zhi Yong Wu

net: add the support for -netdev socket, listen

The -net socket,listen option does not work with the newer -netdev
syntax:
http://lists.gnu.org/archive/html/qemu-devel/2011-11/msg01508.html

This patch makes it work now.

For the case where one vlan has multiple listenning sockets,...

4e68f7a0 08/01/2012 03:32 pm Stefan Hajnoczi

net: Rename VLANClientState to NetClientState

The vlan feature is no longer part of net core. Rename VLANClientState
to NetClientState because net clients are not explicitly associated with
a vlan at all, instead they have a peer net client to which they are...

35277d14 08/01/2012 03:32 pm Stefan Hajnoczi

net: Rename vc local variables to nc

Now that VLANClientState has been renamed to NetClientState all 'vc'
local variables should be 'nc'. Much of the code already used 'nc' but
there are places where 'vc' needs to be renamed.

Signed-off-by: Stefan Hajnoczi <>...

b20c6b9e 08/01/2012 03:32 pm Stefan Hajnoczi

net: Rename qemu_del_vlan_client() to qemu_del_net_client()

Another step in moving the vlan feature out of net core. Users only
deal with NetClientState and therefore qemu_del_vlan_client() should be
named qemu_del_net_client().

Signed-off-by: Stefan Hajnoczi <>...

f6c874e3 08/01/2012 02:28 pm Stefan Hajnoczi

net: Add a hub net client

The vlan feature can be implemented in terms of hubs. By introducing a
hub net client it becomes possible to remove the special case vlan code
from net.c and push the vlan feature out of generic networking code.

Signed-off-by: Stefan Hajnoczi <>...

d33d93b2 08/01/2012 02:28 pm Stefan Hajnoczi

net: Use hubs for the vlan feature

Stop using the special-case vlan code in net.c. Instead use the hub net
client to implement the vlan feature. The next patch will remove vlan
code from net.c completely.

Signed-off-by: Stefan Hajnoczi <>...

90d87a33 08/01/2012 02:28 pm Stefan Hajnoczi

net: Look up 'vlan' net clients using hubs

Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Zhi Yong Wu <>
Reviewed-by: Laszlo Ersek <>

81017645 08/01/2012 02:28 pm Stefan Hajnoczi

hub: Check that hubs are configured correctly

Checks can be performed to make sure that hubs have at least one NIC and
one host device, warning the user if this is not the case.
Configurations which do not meet this rule tend to be broken but just
emit a warning. This patch preserves compatibility with the checks...

ab5f3f84 08/01/2012 02:28 pm Stefan Hajnoczi

net: Drop vlan argument to qemu_new_net_client()

Since hubs are now used to implement the 'vlan' feature and the vlan
argument is always NULL, remove the argument entirely and update all net
clients that use qemu_new_net_client().

Signed-off-by: Stefan Hajnoczi <>...

606c10e2 08/01/2012 02:28 pm Zhi Yong Wu

net: Convert qdev_prop_vlan to peer with hub

Instead of using VLANState use net/hub.h to support the vlan qdev
property. The vlan qdev property becomes an alias for the peer qdev
property but is represented as a VLAN ID number. When a VLAN ID is
selected the device will really peer with a hub port....

2be64a68 07/23/2012 01:55 pm Laszlo Ersek

hw, net: "net_client_type" -> "NetClientOptionsKind" (qapi-generated)

NET_CLIENT_TYPE_ -> NET_CLIENT_OPTIONS_KIND_

Signed-off-by: Laszlo Ersek <>
Signed-off-by: Stefan Hajnoczi <>

6687b79d 07/23/2012 01:55 pm Laszlo Ersek

convert net_client_init() to OptsVisitor

The net_client_init() prototype is kept intact.

Based on "is_netdev", the QemuOpts-rooted QemuOpt-list is parsed as a
Netdev or a NetLegacy. The original meat of net_client_init() is moved to
and simplified in net_client_init1():...

848040d1 07/23/2012 01:55 pm Laszlo Ersek

convert net_init_dump() to NetClientOptions

v1->v2:
- NetdevDumpOptions::len is of type 'size', whose C type was changed to
uint64_t. Adapt the printf() format specifier macro.

Signed-off-by: Laszlo Ersek <>
Signed-off-by: Stefan Hajnoczi <>

094f15c5 07/23/2012 01:55 pm Laszlo Ersek

convert net_init_slirp() to NetClientOptions

Signed-off-by: Laszlo Ersek <>
Signed-off-by: Stefan Hajnoczi <>

bef8e8fe 07/23/2012 01:55 pm Laszlo Ersek

convert net_init_socket() to NetClientOptions

I "reverse engineered" the following permissions between the -socket
sub-options:

fd  listen  connect  mcast  udp | localaddr
fd x . . . . | .
listen . x . . . | ....
4a917c39 07/23/2012 01:55 pm Laszlo Ersek

convert net_init_vde() to NetClientOptions

v1->v2:
- NetdevVdeOptions::port and ::mode are of type uint16. Remove superfluous
range checks.

Signed-off-by: Laszlo Ersek <>
Signed-off-by: Stefan Hajnoczi <>

08c573a8 07/23/2012 01:55 pm Laszlo Ersek

convert net_init_tap() to NetClientOptions

Signed-off-by: Laszlo Ersek <>
Signed-off-by: Stefan Hajnoczi <>

f79b51b0 07/23/2012 01:55 pm Laszlo Ersek

convert net_init_bridge() to NetClientOptions

Signed-off-by: Laszlo Ersek <>
Signed-off-by: Stefan Hajnoczi <>

1a0c0958 07/23/2012 01:55 pm Laszlo Ersek

remove unused QemuOpts parameter from net init functions

v1->v2:
- unchanged

v2->v3:
- keep "qemu-option.h" included in "net/slirp.h"

Signed-off-by: Laszlo Ersek <>
Signed-off-by: Stefan Hajnoczi <>

22a61f36 07/09/2012 06:39 pm Jan Kiszka

slirp: Improve error reporting of inaccessible smb directories

Instead of guessing, print the error code returned by access.

Signed-off-by: Jan Kiszka <>

1cb1c5d1 07/09/2012 06:38 pm Jan Kiszka

slirp: Enforce host-side user of smb share

Windows 7 (and possibly other versions) cannot connect to the samba
share if the exported host directory is not world-readable. This can be
resolved by forcing the username used for access checks to the one
under which QEMU and smbd are running....

b412eb61 07/09/2012 06:38 pm Alexander Graf

slirp: add 'cmd:' target for guestfwd

When using guestfwd=, Qemu only connects the virtual server's TCP port
to a single chardev. This is useless in most cases, as we usually want
to have more than a single connection from the guest to the outside world....

927d811b 07/09/2012 06:38 pm Dunrong Huang

slirp: Ensure smbd and shared directory exist when enable smb

Users may pass the following parameters to qemu:
$ qemu-kvm -net nic -net user,smb= ...
$ qemu-kvm -net nic -net user,smb ...
$ qemu-kvm -net nic -net user,smb=bad_directory ...

In these cases, qemu started successfully while samba server...

37003adf 06/15/2012 04:41 pm Paolo Bonzini

qmp: include monitor.h when needed

This is needed to get file descriptors from SCM_RIGHTS.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Luiz Capitulino <>

3294ce18 06/09/2012 01:30 pm Michael Tokarev

do not include <libutil.h> needlessly or if it doesn't exist

<libutil.h> and <util.h> on *BSD (some have one, some another)
were #included just for openpty() declaration. The only file
where this function is actually used is qemu-char.c.

In vl.c and net/tap-bsd.c, none of functions declared in libutil.h...

d8469de6 06/07/2012 10:21 am Paolo Bonzini

build: move net/ objects to nested Makefile.objs

Signed-off-by: Paolo Bonzini <>

42dcc547 06/04/2012 07:49 pm Luiz Capitulino

net: purge the monitor object from all init functions

The only backend that really uses it is the socket one, which calls
monitor_get_fd(). But it can use 'cur_mon' instead.

Signed-off-by: Luiz Capitulino <>
Reviewed-By: Laszlo Ersek <>

de305b13 05/02/2012 01:08 am Nikolaus Rath

slirp: don't use "smb ports = 0" option

The "smb ports = 0" option causes recent samba versions to crash. It was
introduced in commit 157777ef3e with log message "Samba 3 support".
However, a value of 0 has never been officially supported by smb and is
also not necessary: if stdin is a socket, smb does not try to listen on...

276eda57 05/02/2012 01:08 am Nikolaus Rath

Declare state directory in smb.conf

The smb.conf generated by the userspace networking does not include a state directory
directive. Samba therefore falls back to the default value. Since the user generally
does not have write access to this path, smbd immediately crashes....