slirp: Clean up updtime
Drop redundant typecasts in both variants and remove the pointlessround-up in the UNIX version.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
slirp: Kill slirp_is_inited
Avoid the need for slirp_is_inited by refactoring the protectedslirp_select_* functions. This also avoids the clearing of all fd setson select errors.
slirp: Drop redundant checks from slirp_output
Slirp doesn't invoke slirp[_can]_output before it is initialized. Themotivation for these checks (3b7f5d479c) no longer applies. So dropthem.
Note: slirp_vc will become invalid if the slirp stack is removed during...
slirp: Clean up timeout handling around slirp_select_fill/poll
Again lot of dead code. Remove it.
slirp: Drop link_up checks from if_output and slirp_socket_can_recv
link_up is true once slirp is initialized, so these check are really notrequired.
slirp: Factor out internal state structure
The essence of this patch is to stuff (almost) all global variables ofthe slirp stack into the structure Slirp. In this step, we still keepthe structure as global variable, directly accessible by the wholestack. Changes to the external interface of slirp will be applied in...
slirp: Make IP packet ID consistent
Currently, ip_id is always initialized to 0 on slirp startup (despitethe broken attempt to derive it from the clock). This is good forreproducibility. But it is not preserved across save/restore. This patchtherefore drops the dead initialization code from ip_init and introduces...
slirp: Drop unused icmp_var.h
slirp: tftp: Cleanup tftp_prefix check
Perform check for set prefix early (if it's not given, tftp is disabled)and drop redundant second check.
slirp: tftp: Clean up tftp_send_error
The return code of tftp_send_error is not used, drop it. And also makesure to always terminate the session.
slirp: tftp: Refactor tftp_handle_rrq
Specifically make the filename extraction more readable, and alwaysreport errors back to the client.
slirp: tftp: Rework filename handling
This changes the filename handling from a static buffer in tftp_sessionfor the client-provided name + prefix to a dynamically allocated bufferthat keeps the combined path in one place.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
slirp: Factor out one-time initialization
In order to prepare re-initialization and multi-instance slirp, factorout init code that is of global scope and (at least for now) only needto be run once.
This also fixes the potentially uninitialized use of our_addr in...
slirp: Do not allow to remove non-hostfwd sockets
Prevent that the users accidentally shoots down dynamic sockets. Thisallows to remove looping for removals as there can now only be onematch.
slirp: Mark sockets of incoming TCP connections
Required for pretty-printing.
slirp: Add info usernet for dumping connection states
Break out sockstats from the slirp statistics and present them under thenew info category "usernet". This patch also improves the current output/wrt proper reporting connection source and destination....
slirp: Drop dead code
After all its years inside the qemu tree, there is no point in keepingthe dead code paths of slirp. This patch is a first round of removingusually commented out code parts. More cleanups need to follow (andmaybe finally a proper reindention)....
slirp: Drop statistic code
As agreed on the mailing list, there is no interest in keeping theusually disabled slirp statistics in the tree. So this patch removesthem.
slirp: Cleanup and basic reanimation of debug code
slirp: Rework internal configuration
The user mode IP stack is currently only minimally configurable /wrt toits virtual IP addresses. This is unfortunate if some guest has a fixedidea of which IP addresses to use.
Therefore this patch prepares the stack for fully configurable IP...
slirp: Rework external configuration interface
With the internal IP configuration made more flexible, we can nowenhance the user interface. This patch adds a number of new options to"-net user": net (address and mask), host, dhcpstart, dns and smbserver....
slirp: Fix port comparision in slirp_remove_hostfwd
For UDP host forwardings, fport is not stable, every outgoing packet ofthe redirection can modify it. Use getsockname instead to look up theport that is actually used on the host side.
slirp: Rework monitor commands for host forwarding
Improve the monitor interface for adding and removing host forwardingrules by splitting it up in two commands and rename them to hostfwd_addand hostfwd_remove. Also split up the paths taken for legacy -redir...
slirp: Bind support for host forwarding rules
Extend the hostfwd rule format so that the user can specify on whichhost interface qemu should listen for incoming connections. If omitted,binding will takes place against all interfaces.
slirp: Prepare for persistent socket state flags
This prepares for adding flags to socket.so_state that must not beremoved during the lifetime of a socket.
slirp: Explicitely mark host-forwarding sockets
Mark sockets that describe host forwardings. This is required for their(and only their) proper deletion and for pretty-printing.
sdl zooming
Hi all,this patch implements zooming capabilities for the sdl interface.A new sdl_zoom_blit function is added that is able to scale and blit aportion of a surface into another.This way we can enable SDL_RESIZABLE and have a real_screen surface with...
slirp: Drop redundant lines from udp_input
The socket faddr/fport is already updated a few lines below, so theseare completely redundant.
slirp: Refactor tcp_ctl
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
Introduce get_next_param_value
In order to parse multiple instances of the same param=value pair,introduce get_next_param_value which can pass back to string parsingposition after reading a parameter value.
slirp: Move smb, redir, tftp and bootp parameters and -net channel
So far a couple of slirp-related parameters were expressed viastand-alone command line options. This it inconsistent and unintuitive.Moreover, it prevents both dynamically reconfigured (host_net_add/...
Fix QCOW2 debugging code to compile again
Updated to use C99 comments.
Signed-off-by: Filip Navara <filip.navara@gmail.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu/virtio: virtio save/load bindings
Implement bindings for virtio save/load. Use them in virtio pci.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu/pci: add pci_get/set_byte
Add pci_get/set_byte to keep *_word and *_long access functions company.They are unused for now.
qemu/net: request 3 vectors in virtio-net
Request up to 3 vectors in virtio-net. Actual bindings might supplyless.
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. Thiscan also be used to disable MSI-X, for compatibility with old qemu. Thisoption currently only affects virtio cards.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
Fix dump output in qemu-io.
The dump output was not nicely formatted for byteslarger than 0x7f, because signed values expanded tosizeof(int) bytes. So for example 0xab did not printas "ab", but as "ffffffab".
I also cleaned the function prototype, which avoids...
qemu-io: Fix spelling in help message.
excerciser -> exerciser
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-io: add aio read/write/flush commands
Add commands to exercise asynchronous reads/writes and to flush alloutstanding aio commands. Commands to exercise aio cancellations willfollow in a separate patch.
Signed-off-by: Christoph Hellwig <hch@lst.de>...
Make sure to zero out memory before calling madvise to increase robustness
Avi pointed out that it's not entirely safe to rely on madvise zeroing outmemory. So let's do it explicitly before calling madvise.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Remove unused gen_bx_T0 function.
Add serial number support for virtio_blk
[brought forward to current qemu-kvm.git]
This patch implements the missing qemu logic tointerpret a '-drive .. serial=XYZ ..' flag fora virtio_blk device.
The serial number string is contained in askeletal IDENTIFY DEVICE data structure and...
qemu/pci: make default_write_config use mask table
Change much of hw/pci to use symbolic constants and a table-drivendesign: add a mask table with writable bits set and readonly bits unset.Detect change by comparing original and new registers.
This makes it easy to support capabilities where read-only/writeable...
qemu/pci: helper routines for pci access
Add inline routines for convenient access to pci deviceswith correct (little) endianness. Will be used by MSI-X support.
qemu/pci: add routines to manage PCI capabilities
Add routines to manage PCI capability list. First user will be MSI-X.
qemu/pci: check constant registers on load
Add "cmask" table of constant register masks: if a bit is not writeableand is set in cmask table, this bit is checked on load. An attempt toload an image that would change such a register causes load to fail....
qemu/pci: MSI-X support functions
Add functions implementing MSI-X support. First user will be virtio-pci.Note that platform must set a flag to declare MSI supported: thisis a safety measure to avoid breaking platforms which should supportMSI-X but currently lack this in the interrupt controller emulation....
qemu/apic: minimal MSI/MSI-X implementation for PC
Implement MSI support in APIC. Note that MSI and MMIO APIC registersare at the same memory location, but actually not on the global bus: MSIis on PCI bus, APIC is connected directly to the CPU. We map them on the...
qemu/virtio: virtio support for many interrupt vectors
Extend virtio to support many interrupt vectors, and rearrange code inpreparation for multi-vector support (mostly move reset out to bindings,because we will have to reset the vectors in transport-specific code)....
qemu/virtio: MSI-X support in virtio PCI
This enables actual support for MSI-X in virtio PCI.First user will be virtio-net.
add sparc64-softmmu to default configure targets list
Add sparc64 to default list of softmmu targetsSigned-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
sparc64 follow pci_nic_init change
sun4u.c: correct pci_nic_init arguments followingcommit 5607c38820366954c38dd702e979499486057481
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
microblaze: Support the latest mmu-kernel stat64 ABI.
Microblaze recently changed their ABI. The new is not backwards compatibleand there doesn't seem to be a way to distinguish old/new binaries.Let's support the latest ABI for now and hope someone figures out a way to...
target-ppc: permit linux-user to read PVR
Access to the PVR SPR is normally forbidden from userspace apps. TheLinux kernel, however, fixes up reads in the appropriate trap handler.To permit applications that read PVR to run on QEMU, then, we need toimplement the same handling of PVR reads....
cris: Remove unused internal flag.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Win32: Reduce section alignment for Windows.
Maximum alignment for Win32 is 16, so don't tryto set it to 32. Otherwise the compiler complains:
exec.c:102: warning: alignment of 'code_gen_prologue'is greater than maximum object file alignment. Using 16...
net: add qemu_purge_queued_packets()
If net client sends packets asynchronously, it needs to purge its queuedpackets in cleanup() so as to prevent sent callbacks being invoked witha freed client.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net: purge queued packets in tap_cleanup()
If tap has any packets queued at host_net_remove time, it needs to purgethem in order to prevent a sent callback being invoked for it.
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 tooand enable/disable both types of polling independently.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>...
net: handle EAGAIN from tapfd write()
If a write() on tapfd returns EAGAIN, return zero so that the packetgets queued (in the case of async send) and enable polling tapfd forwriting.
When tapfd becomes writable, disable write polling and flush any queued...
net: return TAPState from net_tap_init()
net_tap_fd_init() already returns TAPState, so this is a sensiblecleanup in its own right.
net: add '-net tap,sndbuf=nbytes'
2.6.30 adds a new TUNSETSNDBUF ioctl() which allows a send buffer limitfor the tap device to be specified. When this limit is reached, a tapwrite() will return EAGAIN and poll() will indicate the fd isn'twritable.
This allows people to tune their setups so as to avoid e.g. UDP packet...
net: add packet length to NetPacketSent callback
virtio-net needs this - for the same purpose that it currently uses thereturn value from qemu_sendv_packet().
virtio-net: implement async packet sending
Win32: Fix compilation with SDL.
`sdl-config --cflags` defines main = SDL_mainon some platforms. One of these platforms isWindows with mingw32.
For those platforms, the solution already developedfor APPLE is now applied.
A compiler warning (missing return value) is fixed, too....
Win: Install keymaps for Windows, too (needed for VNC).
vmware_vga: clean up
use NULL instead of 0 for pci_register_device() argumentfor consistency. Any other caller uses NULL.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix do_pci_register_device() to reject devfn already in use
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Support addr=... in option argument of -net nic
Make net_client_init() accept addr=, put the value into structNICinfo. Use it in pci_nic_init(), and remove arguments bus anddevfn.
Don't support addr= in third argument of monitor command pci_add,because that clashes with its first argument. Admittedly unelegant....
Make first argument of monitor command pci_add work
Simply pass the PCI address through qemu_pci_hot_add_nic() topci_nic_init() and through qemu_pci_hot_add_storage() to pci_create().
Before, pci_device_hot_add() passed along the PCI bus to use, andignored any user-specified slot....
Support addr=... in option argument of -drive if=virtio
Make drive_init() accept addr=, put the value into struct DriveInfo.Use it in all the places that create virtio-blk-pci devices:pc_init1(), bamboo_init(), mpc8544ds_init().
Don't support addr= in third argument of monitor command pci_add and...
Don't register cpu reset handler for cpu with APIC.
APIC reset handler already resets cpu, no need to reset it twice.Also register cpu_reset handler directly to make it impossible toadd additional code to main_cpu_reset() by mistake.
Signed-off-by: Gleb Natapov <gleb@redhat.com>...
Fix build on Mac OS X
Handle init/sipi in a main cpu exec loop. (v2)
This should fix compilation problem in case of CONFIG_USER_ONLY.
Currently INIT/SIPI is handled in the context of CPU that sends IPI.This patch changes this to handle them like all other events in a maincpu exec loop. When KVM will gain thread per vcpu capability it will...
Instead of writing a zero page, madvise it away
Otherwise, after migration, we end up with a much larger RSS size then weought to have.
acpi.c: make qemu_system_device_hot_add piix independent.
introruce piix4_device_hot_add() for piix4 specific codeand make qemu_system_device_hot_add() generic.
virtio-net: enable mergeable receive buffers
When virtio-net was merged in from qemu-kvm.git, the VNET_HDR relatedfeatures were dropped from the code.
However, VIRTIO_NET_F_MRG_RXBUF appears to have accidentally beendropped too. Re-instate that now.
Reported-by: Michael S. Tsirkin <mst@redhat.com>...
dot gitignore: add qemu-monitor.texi
add qemu-monitor.texi to .gitignore.
Disable _FORTIFY_SOURCE to fix Ubuntu build with -Werror
This eliminates the results unused warnings.
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 loadingcode that linux_boot and vga are already using.
This patch introduces a "bootable" state in NICInfo structure,...
Add O_BINARY to open call in net_dump_init.
Fix the pcap dumps on Win32 and other systems where O_BINARY is required.
virtio: make vring_desc_*() take phys addrs
Change the vring descriptor helpers to take the physicaladdress of the descriptor table rather than a virtqueue.
This is needed in order to allow these helpers to be usedwith an indirect descriptor table.
virtio: add support for indirect ring entries
Support a new feature flag for indirect ring entries. These are ringentries which point to a table of buffer descriptors.
The idea here is to increase the ring capacity by allowing a largereffective ring size whereby the ring size dictates the number of...
Add pci_bus_reset() function.
To reset internal irq handling data structures.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Yaniv Kamay <ykamay@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Apply TCGV_UNUSED on variables that GCC mistakenly thinks can be useduninitialized
Restore consistent formatting of audio devices
linux-user: strace now handles guest stringscorrectly [v2]
On Tue, Jun 16, 2009 at 08:19:23PM -0500, Anthony Liguori wrote:
malc wrote: On my system the above line causes gcc to emit: In file included from /home/malc/x/rcs/git/qemu/linux-user/strace.c:12:...
malc wrote:
On my system the above line causes gcc to emit: In file included from /home/malc/x/rcs/git/qemu/linux-user/strace.c:12:...
On my system the above line causes gcc to emit:
In file included from /home/malc/x/rcs/git/qemu/linux-user/strace.c:12:...
fix qemu_alloc/qemu_free for audio subsystem
Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
alsa: fix warning
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
xilinx-eth: Remove debug print.
Don't set IRQs on device reset and loadvm/savevm
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Call piix4_reset() on system reset.
Also zero pci_irq_levels on reset to avoid stuck irq after reset.
Based on 15a1956af94e36105494f782a752698103addf63 by Gleb Natapov.
Call piix3_reset() on system reset.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Yaniv Kamay <ykamay@redhat.com>
Register usb-uhci reset function.
The device is not reset on system reset currently.Without this patch RHEL4.8 hangs after reboot if -usbdevice tableis in use.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Revert "Update irqs on reset and device load"
This reverts commit 3dcd219f09d6c1817bf9a132899e6b925f7a0914.
It is incorrect to call qemu_irq functions (or any other functions thataccess other device state) during savevm/loadvm.
Allow user to specify CPU model
Fix opening of read only raw images
Replace ELF section hack with normal table