Statistics
| Branch: | Revision:

root / net.c @ 1f3d3c8f

History | View | Annotate | Download (84.5 kB)

# Date Author Comment
7f1c9d20 10/06/2009 10:36 pm Mark McLoughlin

Port host_net_add monitor command to QemuOpts

Here is where we rely on qemu_opts_parse() to handle an empty string.
We could alternatively explicitly handle this here by using
qemu_opts_create() when we're not supplied any parameters, but its
cleaner this way....

13cf8f21 10/06/2009 10:36 pm Mark McLoughlin

Port usb net to QemuOpts

We need net_client_init_from_opts() exported for this

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

dc1c9fe8 10/06/2009 10:36 pm Mark McLoughlin

Final net cleanup after conversion to QemuOpts

Now that net_client_init() has no users, kill it off and rename
net_client_init_from_opts().

There is no further need for the old code in net_client_parse() either.
We use qemu_opts_parse() 'firstname' facitity for that. Instead, move...

f83c6e10 10/06/2009 10:36 pm Mark McLoughlin

Port -net none and -net nic to QemuOpts

We use a table of network types to look up the initialization function
and parameter descriptions in net_client_init().

For now, we use QemuOpts for the 'none' and 'nic' types. Subsequent
patches port the other types too and the special casing is removed....

ec302ffd 10/06/2009 10:36 pm Mark McLoughlin

Port -net user to QemuOpts

The handling of guestfwd and hostfwd requires the previous changes
to allow multiple values for each parameter. The only way to access
those multiple values is to use qemu_opt_foreach().

Signed-off-by: Mark McLoughlin <>...

8a1c5235 10/06/2009 10:36 pm Mark McLoughlin

Port -net tap to QemuOpts

Some parameters are not valid with fd=. Rather than having a separate
parameter description table for validating fd=, it's easir to just
check for those invalid parameters later.

Note, the need to possible lookup a file descriptor name from the...

88ce16ca 10/06/2009 10:36 pm Mark McLoughlin

Port -net socket to QemuOpts

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

dd51058d 10/06/2009 10:36 pm Mark McLoughlin

Port -net vde to QemuOpts

The net_vde_init() change is needed because we now pass NULL pointers
instead of empty strings for group/sock if they're not set.

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

ed2955c2 10/06/2009 10:36 pm Mark McLoughlin

Port -net dump to QemuOpts

Note, not incrementing nb_host_devs in net_init_dump() is intentional.

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

7b3fb251 10/06/2009 10:36 pm Mark McLoughlin

Clean up legacy code in net_client_init()

Now that we've ported everything over to QemuOpts, we can kill off
all the cruft in net_client_init().

Note, the 'channel' type requires special handling as it uses a
format that QemuOpts can't parse

Signed-off-by: Mark McLoughlin <>...

fb12577c 10/06/2009 10:36 pm Markus Armbruster

Drop config_error(), use qemu_error() instead

Diagnostic output goes to stderr, except when we're in a monitor
command, when it goes to the monitor instead.

config_error() implements this with a monitor argument: if it's
non-null, report there, else to stderr. This obliges us to pass the...

32a8e14a 10/06/2009 10:36 pm Mark McLoughlin

Use qemu_strdup() for NICInfo string fields

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

9203f520 10/06/2009 10:36 pm Mark McLoughlin

Make NICInfo string fields non-const

We now only assign strdup()ed strings to these fields, never static
strings.

aliguori: fix build for ppc_prep and mips_jazz

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

d2cffe30 10/06/2009 10:36 pm Mark McLoughlin

Move memset() from net_client_uninit() to net_client_init()

zeroing a structure before using it is more common than zeroing after
using it. Also makes the setting of nd->used more obvious.

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

02374aa0 10/06/2009 10:36 pm Mark McLoughlin

Use qemu_strdup() for VLANClientState string fields

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

3a179c66 10/06/2009 10:36 pm Markus Armbruster

Make net_client_init() consume slirp_configs even on error

net_slirp_init() walks slirp_configs, and stops when it encounters one
that doesn't work. Instead of consuming slirp_configs members there,
consume them in the sole caller. This makes sure all are consumed....

0752706d 10/06/2009 10:36 pm Markus Armbruster

Don't exit() in config_error()

Propagating errors up the call chain is tedious. In startup code, we
can take a shortcut: terminate the program. This is wrong elsewhere,
the monitor in particular.

config_error() tries to cater for both customers: it terminates the...

9ee05825 10/05/2009 05:32 pm Markus Armbruster

Make it obvious that pci_nic_init() can't fail

Before this patch, pci_nic_init() returns NULL when it can't find the
model in pci_nic_models[]. Except this can't happen, because
qemu_check_nic_model_list() just searched for model in
pci_nic_models[], and terminated the program on failure....

07caea31 10/05/2009 05:32 pm Markus Armbruster

Fix pci_add nic not to exit on bad model

Monitor command "pci_add ADDR nic model=MODEL" uses pci_nic_init() to
create the NIC. When MODEL is unknown or "?", this prints to stderr
and terminates the program.

Change pci_nic_init() not to treat "?" specially, and to return NULL...

a9796703 10/05/2009 05:32 pm Glauber Costa

Correctly free nd structure

When we "free" a NICInfo structure, we can leak pointers, since we don't do
much more than setting used = 0.

We free() the model parameter, but we don't set it to NULL. This means that
a new user of this structure will see garbage in there. It was not noticed...

acedcfbf 09/30/2009 09:56 pm Michael S. Tsirkin

net: fix coding style nit

Put space between = and - assigning a negative number
to avoid confusion with old-style "-="
(which we also have, and need to be fixed).

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

72cf2d4f 09/12/2009 10:36 am Blue Swirl

Fix sys-queue.h conflict for good

Problem: Our file sys-queue.h is a copy of the BSD file, but there are
some additions and it's not entirely compatible. Because of that, there have
been conflicts with system headers on BSD systems. Some hacks have been
introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...

6ee093c9 09/11/2009 06:19 pm Juan Quintela

Unexport ticks_per_sec variable. Create get_ticks_per_sec() function

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

f40d7537 09/04/2009 08:47 pm Blue Swirl

Include sys-queue.h early to override system queue definitions on BSD

Signed-off-by: Blue Swirl <>

f18c16de 09/04/2009 05:37 pm Luiz Capitulino

monitor: Port handler_2 to use QDict

This commit ports command handlers that receive two arguments to use
the new monitor's dictionary.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

1d4daa91 09/04/2009 05:37 pm Luiz Capitulino

monitor: Port handler_3 to use QDict

This commit ports command handlers that receive three arguments to use
the new monitor's dictionary.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

9da43187 09/04/2009 05:37 pm Jan Kiszka

net: Fix send queue ordering

Ensure that packets enqueued for delayed delivery are dequeued in FIFO
order. At least one simplistic guest TCP/IP stack became unhappy due to
sporadically reordered packet streams.

At this chance, switch the send queue implementation to TAILQ....

7dc3fa09 08/24/2009 04:01 pm Stefan Weil

Add missing linefeed in error message

The error message for an unknown network device given to
monitor command set_link looks better with a terminating
linefeed.

Signed-off-by: Stefan Weil <>
Signed-off-by: Anthony Liguori <>

c3cf0d3f 08/10/2009 09:05 pm Luiz Capitulino

net: Fix do_set_link() return type

do_set_link() returns int, but Monitor handler functions should
always return void.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>
Message-Id:

71e72a19 07/27/2009 10:09 pm Juan Quintela

rename HOST_BSD to CONFIG_BSD

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

8fde6546 07/27/2009 10:09 pm Filip Navara

Remove useless Win32 include files and unused function in net.c.

Signed-off-by: Filip Navara <>
Signed-off-by: Anthony Liguori <>

bb53fc53 07/27/2009 10:08 pm Jan Kiszka

slirp: Fix guestfwd for incoming data

Unless a virtual server address was explicitly defined (which is
impossible with the legacy net channel format), guestfwd did not
properly forwarded host
>guest packets. This patch fixes it.

Signed-off-by: Jan Kiszka <>...

c1d6eed7 07/27/2009 04:39 pm Mark McLoughlin

Add support for fd=name to tap and socket networking

This allows a program to initialize a host networking device using a
file descriptor passed over a unix monitor socket.

The program must first pass the file descriptor using SCM_RIGHTS
ancillary data with the getfd monitor command. It then may do...

eb54b6dc 07/17/2009 01:28 am Gerd Hoffmann

qdev: add id= support for pci nics.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

8389e7f4 07/16/2009 04:28 pm Anthony Liguori

slirp: Fix default netmask to 255.255.255.0

This got broken between a13a4126c8 and c92ef6a22d: old slirp code used
255.255.255.0.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

d026fb6d 07/10/2009 12:58 am Mark McLoughlin

Don't abort if TUNSETSNDBUF fails where no sndbuf= arg is supplied

If no tap,sndbuf= arg is supplied, we use a default value. If
TUNSETSNDBUF fails in this case, we should not abort.

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

fc5b81d1 07/10/2009 12:06 am Mark McLoughlin

net: set a default value for sndbuf=

On reflection, perhaps it does make sense to set a default value for
the sndbuf= tap parameter.

For best effect, sndbuf= should be set to just below the capacity of
the physical NIC.

Setting it higher will cause packets to be dropped before the limit...

3da6abd4 07/01/2009 11:29 pm Blue Swirl

Use pstrcpy and pstrcat to avoid OpenBSD linker warning

Signed-off-by: Blue Swirl <>

fc57bc57 06/29/2009 04:52 pm Jan Kiszka

slirp: Basic VLAN client info_str

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

b1c99fcd 06/29/2009 04:52 pm Jan Kiszka

slirp: Enable multiple instances

Once again this was a long journey to reach the destination: Allow to
instantiate slirp multiple times. But as in the past, the journey was
worthwhile, cleaning up, fixing and enhancing various parts of the user
space network stack along the way....

09c18925 06/29/2009 04:52 pm Jan Kiszka

slirp: Use shell to erase smb directory

Instead of open-coding this, we can use the power of the shell to remove
the smb_dir on exit.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

492efabd 06/29/2009 04:52 pm Jan Kiszka

slirp: Improve error handling in slirp_smb

Make sure for invocations from the monitor that slirp_smb properly
reports errors and doesn't terminate qemu.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

28432466 06/29/2009 04:52 pm Jan Kiszka

slirp: Enable multi-instance support for the smb service

Push the smb state, smb_dir, into SlirpState and construct it in a way
that allows multiple smb instances (one per slirp stack). Remove the smb
directory on slirp cleanup instead of qemu termination. As VLAN clients...

1a609520 06/29/2009 04:52 pm Jan Kiszka

net: Provide VLAN client lookup helper

Introduce qemu_find_vlan_client_by_name for VLANClientState lookup based
on VLAN ID and client name. This is useful for monitor commands.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

f13b572c 06/29/2009 04:52 pm Jan Kiszka

slirp: Make hostfwd_add/remove multi-instance-aware

Extend the syntax of hostfwd_add/remove to optionally take a tuple of
VLAN ID and slirp stack name. If those are omitted, the commands will
continue to work on the first registered slirp stack.

Signed-off-by: Jan Kiszka <>...

d918f23e 06/29/2009 04:52 pm Jan Kiszka

slirp: Kill slirp_is_inited

Avoid the need for slirp_is_inited by refactoring the protected
slirp_select_* functions. This also avoids the clearing of all fd sets
on select errors.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

d6cf84e1 06/29/2009 04:52 pm Jan Kiszka

slirp: Drop redundant checks from slirp_output

Slirp doesn't invoke slirp[_can]_output before it is initialized. The
motivation for these checks (3b7f5d479c) no longer applies. So drop
them.

Note: slirp_vc will become invalid if the slirp stack is removed during...

9f8bd042 06/29/2009 04:52 pm Jan Kiszka

slirp: Use internal state in interface

This now also exports the internal state to the slirp users in qemu,
returning it from slirp_init and expecting it along with service
invocations. Additionally provide an opaque value interface for the
callbacks from slirp into the qemu core....

ad0d8c4c 06/29/2009 04:52 pm Jan Kiszka

slirp: Allocate/free stack instance dynamically

Allocate the internal slirp state dynamically and provide and call
slirp_cleanup to properly release it after use. This patch finally
unbreaks slirp release and re-instantiation via host_net_* monitor
commands....

9c12a6f2 06/29/2009 04:52 pm Jan Kiszka

slirp: Do not allow to remove non-hostfwd sockets

Prevent that the users accidentally shoots down dynamic sockets. This
allows to remove looping for removals as there can now only be one
match.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

6dbe553f 06/29/2009 04:52 pm Jan Kiszka

slirp: Add info usernet for dumping connection states

Break out sockstats from the slirp statistics and present them under the
new info category "usernet". This patch also improves the current output
/wrt proper reporting connection source and destination....

0fe6a7f2 06/29/2009 04:52 pm Jan Kiszka

slirp: Drop statistic code

As agreed on the mailing list, there is no interest in keeping the
usually disabled slirp statistics in the tree. So this patch removes
them.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

c92ef6a2 06/29/2009 04:52 pm Jan Kiszka

slirp: Rework external configuration interface

With the internal IP configuration made more flexible, we can now
enhance the user interface. This patch adds a number of new options to
"-net user": net (address and mask), host, dhcpstart, dns and smbserver....

f3546deb 06/29/2009 04:52 pm Jan Kiszka

slirp: Rework monitor commands for host forwarding

Improve the monitor interface for adding and removing host forwarding
rules by splitting it up in two commands and rename them to hostfwd_add
and hostfwd_remove. Also split up the paths taken for legacy -redir...

3c6a0580 06/29/2009 04:52 pm Jan Kiszka

slirp: Bind support for host forwarding rules

Extend the hostfwd rule format so that the user can specify on which
host interface qemu should listen for incoming connections. If omitted,
binding will takes place against all interfaces.

Signed-off-by: Jan Kiszka <>...

e15f4a99 06/29/2009 04:52 pm Jan Kiszka

Revert "User networking: Show active connections"

This reverts commit 1c6ed9f3379faac83da0ed3e95cbd49003ac0dd1.

It's redundant to slirp statistics, which are going to be split up /
reworked later on.

Conflicts:

monitor.c
net.c

Signed-off-by: Jan Kiszka <>...

ad196a9d 06/29/2009 04:52 pm Jan Kiszka

slirp: Move smb, redir, tftp and bootp parameters and -net channel

So far a couple of slirp-related parameters were expressed via
stand-alone command line options. This it inconsistent and unintuitive.
Moreover, it prevents both dynamically reconfigured (host_net_add/...

ffe6370c 06/24/2009 05:09 pm Michael S. Tsirkin

qemu/net: flag to control the number of vectors a nic has

Add an option to specify the number of MSI-X vectors for PCI NIC cards. This
can also be used to disable MSI-X, for compatibility with old qemu. This
option currently only affects virtio cards.

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

8cad5516 06/22/2009 06:15 pm Mark McLoughlin

net: add qemu_purge_queued_packets()

If net client sends packets asynchronously, it needs to purge its queued
packets in cleanup() so as to prevent sent callbacks being invoked with
a freed client.

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

b9adce2c 06/22/2009 06:15 pm Mark McLoughlin

net: purge queued packets in tap_cleanup()

If tap has any packets queued at host_net_remove time, it needs to purge
them in order to prevent a sent callback being invoked for it.

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

b664e367 06/22/2009 06:15 pm Mark McLoughlin

net: add tap_read_poll() helper

Add a helper to enable/disable the read polling on tapfd.

We need this, because we want to start write polling on the tapfd too
and enable/disable both types of polling independently.

Signed-off-by: Mark McLoughlin <>...

1f7babf6 06/22/2009 06:15 pm Mark McLoughlin

net: handle EAGAIN from tapfd write()

If a write() on tapfd returns EAGAIN, return zero so that the packet
gets queued (in the case of async send) and enable polling tapfd for
writing.

When tapfd becomes writable, disable write polling and flush any queued...

4a77b25e 06/22/2009 06:15 pm Mark McLoughlin

net: return TAPState from net_tap_init()

net_tap_fd_init() already returns TAPState, so this is a sensible
cleanup in its own right.

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

0df0ff6d 06/22/2009 06:15 pm Mark McLoughlin

net: add '-net tap,sndbuf=nbytes'

2.6.30 adds a new TUNSETSNDBUF ioctl() which allows a send buffer limit
for the tap device to be specified. When this limit is reached, a tap
write() will return EAGAIN and poll() will indicate the fd isn't
writable.

This allows people to tune their setups so as to avoid e.g. UDP packet...

783527a9 06/22/2009 06:15 pm Mark McLoughlin

net: add packet length to NetPacketSent callback

virtio-net needs this - for the same purpose that it currently uses the
return value from qemu_sendv_packet().

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

5607c388 06/22/2009 06:15 pm Markus Armbruster

Support addr=... in option argument of -net nic

Make net_client_init() accept addr=, put the value into struct
NICinfo. Use it in pci_nic_init(), and remove arguments bus and
devfn.

Don't support addr= in third argument of monitor command pci_add,
because that clashes with its first argument. Admittedly unelegant....

406c8df3 06/22/2009 06:10 pm Glauber Costa

Make nic option rom loading less painful.

The code how it is today, is totally painful to read and keep.
To begin with, the code is duplicated with the option rom loading
code that linux_boot and vga are already using.

This patch introduces a "bootable" state in NICInfo structure,...

024431b3 06/22/2009 06:10 pm Filip Navara

Add O_BINARY to open call in net_dump_init.

Fix the pcap dumps on Win32 and other systems where O_BINARY is required.

Signed-off-by: Filip Navara <>
Signed-off-by: Anthony Liguori <>

70503264 06/13/2009 02:22 pm Stefan Weil

Win32: Don't remove const attribute in type casts.

Type casts removing the const attribute are bad because
they hide the fact that the argument remains const.

They also result in a compiler warning (at least with MS-C).

Signed-off-by: Stefan Weil <>

c5b76b38 06/13/2009 11:44 am Blue Swirl

Fix mingw32 build warnings

Work around buffer and ioctlsocket argument type signedness problems
Suppress a prototype which is unused on mingw32
Expand a macro to avoid warnings from some GCC versions

Signed-off-by: Blue Swirl <>

068daedd 06/11/2009 04:24 am Anthony Liguori

Fix build breakage when using VDE introduced by 4f1c942

Signed-off-by: Anthony Liguori <>

3e021d40 06/09/2009 01:38 pm Mark McLoughlin

net: return status from qemu_deliver_packet()

Will allow qemu_send_packet() handle queue full condition.

Signed-off-by: Mark McLoughlin <>

e94667b9 06/09/2009 01:38 pm Mark McLoughlin

net: split out packet queueing and flushing into separate functions

We'll be doing more packet queueing in later commits.

Signed-off-by: Mark McLoughlin <>

f3b6c7fc 06/09/2009 01:38 pm Mark McLoughlin

net: add qemu_send_packet_async()

Add a qemu_send_packet() variant which will queue up the packet
if it cannot be sent when all client queues are full. It later
invokes the supplied callback when the packet has been sent.

If qemu_send_packet_async() returns zero, the caller is expected...

e19eb224 06/09/2009 01:38 pm Mark McLoughlin

net: make use of async packet sending API in tap client

If a packet is queued by qemu_send_packet(), remove I/O
handler for the tap fd until we get notification that the
packet has been sent.

A not insignificant side effect of this is we can now
drain the tap send queue in one go without fear of packets...

7c3370d4 06/09/2009 01:38 pm Jan Kiszka

slirp: Avoid zombie processes after fork_exec

Slirp uses fork_exec for spawning service processes, and QEMU uses this
for running smbd. As SIGCHLD is not handled, these processes become
zombies on termination. Fix this by installing a proper signal handler,...

cda94b27 06/09/2009 01:38 pm Mark McLoughlin

Revert "Fix output of uninitialized strings"

This reverts commit 8cf07dcbe7691dbe4f47563058659dba6ef66b05.

This is a sorry saga.

This commit:

8e4416af45 net: Add parameter checks for VLAN clients

broken '-net socket' and this commit:

ffad4116b9 net: Fix -net socket parameter checks...
0aa7a205 06/09/2009 01:38 pm Jan Kiszka

net: Real fix for check_params users

OK, last try: 8e4416af45 broke -net socket, ffad4116b9 tried to fix it
but broke error reporting of invalid parameters. So this patch widely
reverts ffad4116b9 again and intead fixes those callers of check_params
that originally suffered from overwritten buffers by using separate...

c8decae2 06/09/2009 01:38 pm Mark McLoughlin

net: fix error reporting for some net parameter checks

A small bit of confusion between buffers is causing errors like:

qemu: invalid parameter '10' in 'script=/etc/qemu-ifup,fd=10'

instead of:

qemu: invalid parameter 'script' in 'script=/etc/qemu-ifup,fd=10'...
10ae5a7a 06/09/2009 01:38 pm Jan Kiszka

net: Improve parameter error reporting

As host network devices can also be instantiated via the monitor, errors
should then be reported to the related monitor instead of stderr. This
requires larger refactoring, so this patch starts small with introducing...

b8e8af38 06/09/2009 01:38 pm Jan Kiszka

slirp: Reorder initialization

This patch reorders the initialization of slirp itself as well as its
associated features smb and redirection. So far the first reference to
slirp triggered the initialization, independent of the actual -net user
option which may carry additional parameters. Now we save any request to...

5a6d8815 06/09/2009 01:38 pm Mark McLoughlin

net: factor tap_read_packet() out of tap_send()

Move portability clutter out into its own function.

Signed-off-by: Mark McLoughlin <>

5b01e886 06/09/2009 01:38 pm Mark McLoughlin

net: move the tap buffer into TAPState

KVM uses a 64k buffer for reading from tapfd (for GSO support)
and allocates the buffer with TAPState rather than on the stack.

Not allocating it on the stack probably makes sense for qemu
anyway, so merge it in advance of GSO support....

2e1e0641 06/09/2009 01:38 pm Mark McLoughlin

net: vlan clients with no fd_can_read() can always receive

If a vlan client has no fd_can_read(), that means it can
always receive packets. The current code assumes it can never
receive packets.

Signed-off-by: Mark McLoughlin <>

3471b757 06/09/2009 01:38 pm Mark McLoughlin

net: only read from tapfd when we can send

Reduce the number of packets dropped under heavy network
traffic by only reading a packet from the tapfd when a
client can actually handle it.

Signed-off-by: Mark McLoughlin <>

463af534 06/09/2009 01:38 pm Mark McLoughlin

net: add fd_readv() handler to qemu_new_vlan_client() args

This, apparently, is the style we prefer - all VLANClientState
should be an argument to qemu_new_vlan_client().

Signed-off-by: Mark McLoughlin <>

cda9046b 06/09/2009 01:38 pm Mark McLoughlin

net: re-name vc->fd_read() to vc->receive()

VLANClientState's fd_read() handler doesn't read from file
descriptors, it adds a buffer to the client's receive queue.

Re-name the handlers to make things a little less confusing.

Signed-off-by: Mark McLoughlin <>

e3f5ec2b 06/09/2009 01:38 pm Mark McLoughlin

net: pass VLANClientState* as first arg to receive handlers

Give static type checking a chance to catch errors.

Signed-off-by: Mark McLoughlin <>

4f1c942b 06/09/2009 01:38 pm Mark McLoughlin

net: add return value to packet receive handler

This allows us to handle queue full conditions rather than dropping
the packet on the floor.

Signed-off-by: Mark McLoughlin <>

c8aa237c 06/09/2009 01:38 pm Jan Kiszka

net: Don't deliver to disabled interfaces in qemu_sendv_packet

Signed-off-by: Jan Kiszka <>
Signed-off-by: Mark McLoughlin <>

c27ff608 06/09/2009 01:38 pm Jan Kiszka

net: Fix and improved ordered packet delivery

Fix a race in qemu_send_packet when delivering deferred packets and
add proper deferring also to qemu_sendv_packet.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Mark McLoughlin <>

1c6ed9f3 05/28/2009 10:14 am Alexander Graf

User networking: Show active connections

In case you're wondering what connections exactly you have open
or maybe redir'ed in the past, you can't really find out from qemu
right now.

This patch enables you to see all current connections the host
only networking holds open, so you can kill them using the previous...

c1261d8d 05/27/2009 05:46 pm Alexander Graf

User Networking: Enable removal of redirections

Using the new host_net_redir command you can easily create redirections
on the fly while your VM is running.

While that's great, it's missing the removal of redirections, in case you
want to have a port closed again at a later point in time....

8cf07dcb 05/27/2009 05:44 pm Kevin Wolf

Fix output of uninitialized strings

Commit ffad4116b96e29e0fbe892806f97c0a6c903d30d removed the "scratch buffer"
from check_params, but didn't care for the error messages which actually
included this string to tell the user which option was wrong. Now this string...

37cb6fc3 05/22/2009 06:50 pm Jan Kiszka

net: Fix dump time stamps

Signed-off-by: Jan Kiszka <>

cc63bb0f 05/04/2009 12:40 am Paul Brook

Suppress type mismatch warnings in VDE code.

Signed-off-by: Paul Brook <>

ffad4116 05/01/2009 05:44 pm Jan Kiszka

net: Fix -net socket parameter checks

My commit ea053add700d8abe203cd79a9ffb082aee4eabc0 broke -net socket by
overwriting an intermediate buffer in the added check_param. Fix this
by switching check_param to automatic buffer allocation and release, ie.
callers no longer have to worry about providing a scratch buffer....

206ab6e0 05/01/2009 05:44 pm Jan Kiszka

net: Avoid gcc'ism in net_host_device_add

+ if (net_client_init(device, opts ? : "") < 0) {

Is this a gcc extension? Do we want to introduce this construct to the
code base.

Valid remark, fix below.

Thanks,
Jan

-------->

Signed-off-by: Jan Kiszka <>...

8d316b00 04/27/2009 08:11 pm Robert Reif

fix net.c compile warning

Fix net.c compile warning:

CC net.o
net.c: In function net_slirp_redir:
net.c:623: warning: format not a string literal and no format arguments

Signed-off-by: Robert Reif <>

8d6249a7 04/21/2009 11:49 pm aliguori

net: Prevent multiple slirp instances (Jan Kiszka)

The slirp stack is full of global variables which prevents instantiating
it more than once. Catch this during net_slirp_init to prevent more harm
later on.

Signed-off-by: Jan Kiszka <>...