- 29 6月, 2009 12 次提交
-
-
由 Jan Kiszka 提交于
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. Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Jan Kiszka 提交于
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. Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Jan Kiszka 提交于
Slirp doesn't invoke slirp[_can]_output before it is initialized. The motivation for these checks (3b7f5d47) no longer applies. So drop them. Note: slirp_vc will become invalid if the slirp stack is removed during runtime. But this is no new bug and will be fixed later. Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Jan Kiszka 提交于
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: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Jan Kiszka 提交于
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: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Jan Kiszka 提交于
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. Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Jan Kiszka 提交于
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: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Jan Kiszka 提交于
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: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Jan Kiszka 提交于
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 support and the monitor add command as the latter will be extended later on. Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Jan Kiszka 提交于
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. It also renames "redir" to "hostfwd" and "channel" to "guestfwd" in order to (hopefully) clarify their meanings. The format of guestfwd is extended so that the user can define not only the port but also the virtual server's IP address the forwarding starts from. Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Jan Kiszka 提交于
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/ delete) and multi-instance slirp. This patch refactors the configuration by turning -smb, -redir, -tftp and -bootp as well as -net channel into options of "-net user". The old stand-alone command line options are still processed, but no longer advertised. This allows smooth migration of management applications to to the new syntax and also the extension of that syntax later in this series. Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Jan Kiszka 提交于
This reverts commit 1c6ed9f3. It's redundant to slirp statistics, which are going to be split up / reworked later on. Conflicts: monitor.c net.c Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 24 6月, 2009 1 次提交
-
-
由 Michael S. Tsirkin 提交于
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: NMichael S. Tsirkin <mst@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 22 6月, 2009 10 次提交
-
-
由 Mark McLoughlin 提交于
virtio-net needs this - for the same purpose that it currently uses the return value from qemu_sendv_packet(). Signed-off-by: NMark McLoughlin <markmc@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Mark McLoughlin 提交于
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 loss when the sending application in the guest out-runs the NIC in the host. There is no obviously sensible default setting - a suitable value depends mostly on the capabilities of the physical NIC through which the packets are being sent. Also, note that when using a bridge with netfilter enabled, we currently never get EAGAIN because netfilter causes the packet to be immediately orphaned. Set /proc/sys/net/bridge/bridge nf-call-iptables to zero to disable this behaviour. Signed-off-by: NMark McLoughlin <markmc@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Mark McLoughlin 提交于
net_tap_fd_init() already returns TAPState, so this is a sensible cleanup in its own right. Signed-off-by: NMark McLoughlin <markmc@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Mark McLoughlin 提交于
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 packets. Signed-off-by: NMark McLoughlin <markmc@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Mark McLoughlin 提交于
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: NMark McLoughlin <markmc@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Mark McLoughlin 提交于
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: NMark McLoughlin <markmc@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Mark McLoughlin 提交于
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: NMark McLoughlin <markmc@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Markus Armbruster 提交于
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. Machines "malta" and "r2d" have a default NIC with a well-known PCI address. Deal with that the same way as the NIC model: make pci_nic_init() take an optional default to be used when the user doesn't specify one. Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Filip Navara 提交于
Fix the pcap dumps on Win32 and other systems where O_BINARY is required. Signed-off-by: NFilip Navara <filip.navara@gmail.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Glauber Costa 提交于
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, that we can use to keep track of whether or not a given nic should be bootable, avoiding the introduction of yet another global state. With that in hands, we move the code in vl.c to hw/pc.c, and use the already existing infra structure to load those option roms. Error checking code suggested by Mark McLoughlin Signed-off-by: NGlauber Costa <glommer@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 13 6月, 2009 2 次提交
-
-
由 Stefan Weil 提交于
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: NStefan Weil <weil@mail.berlios.de>
-
由 Blue Swirl 提交于
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: NBlue Swirl <blauwirbel@gmail.com>
-
- 11 6月, 2009 1 次提交
-
-
由 Anthony Liguori 提交于
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 09 6月, 2009 14 次提交
-
-
由 Mark McLoughlin 提交于
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 being dropped. Signed-off-by: NMark McLoughlin <markmc@redhat.com>
-
由 Mark McLoughlin 提交于
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 to not send any more packets until the queued packet has been sent. Packets are queued iff a receive() handler returns zero (indicating queue full) and the caller has provided a sent notification callback (indicating it will stop and start its own queue). We need the packet sending API to support queueing because: - a sending client should process all available packets in one go (e.g. virtio-net emptying its tx ring) - a receiving client may not be able to handle the packet (e.g. -EAGAIN from write() to tapfd) - the sending client could detect this condition in advance (e.g. by select() for writable on tapfd) - that's too much overhead (e.g. a select() call per packet) - therefore the sending client must handle the condition by dropping the packet or queueing it - dropping packets is poor form; we should queue. However, we don't want queueing to be completely transparent. We want the sending client to stop sending packets as soon as a packet is queued. This allows the sending client to be throttled by the receiver. Signed-off-by: NMark McLoughlin <markmc@redhat.com>
-
由 Mark McLoughlin 提交于
We'll be doing more packet queueing in later commits. Signed-off-by: NMark McLoughlin <markmc@redhat.com>
-
由 Mark McLoughlin 提交于
Will allow qemu_send_packet() handle queue full condition. Signed-off-by: NMark McLoughlin <markmc@redhat.com>
-
由 Mark McLoughlin 提交于
This allows us to handle queue full conditions rather than dropping the packet on the floor. Signed-off-by: NMark McLoughlin <markmc@redhat.com>
-
由 Mark McLoughlin 提交于
Give static type checking a chance to catch errors. Signed-off-by: NMark McLoughlin <markmc@redhat.com>
-
由 Mark McLoughlin 提交于
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: NMark McLoughlin <markmc@redhat.com>
-
由 Mark McLoughlin 提交于
This, apparently, is the style we prefer - all VLANClientState should be an argument to qemu_new_vlan_client(). Signed-off-by: NMark McLoughlin <markmc@redhat.com>
-
由 Mark McLoughlin 提交于
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: NMark McLoughlin <markmc@redhat.com>
-
由 Mark McLoughlin 提交于
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: NMark McLoughlin <markmc@redhat.com>
-
由 Mark McLoughlin 提交于
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. Signed-off-by: NMark McLoughlin <markmc@redhat.com>
-
由 Mark McLoughlin 提交于
Move portability clutter out into its own function. Signed-off-by: NMark McLoughlin <markmc@redhat.com>
-
由 Jan Kiszka 提交于
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 add a smb export or some redirections until the actual initialization of the stack. This also allows to move a few parameters that were passed via global variable into the argument list of net_slirp_init. Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NMark McLoughlin <markmc@redhat.com>
-
由 Jan Kiszka 提交于
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 a helper to catch both cases and convert net_client_init as well as net_slirp_redir. Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NMark McLoughlin <markmc@redhat.com>
-