summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* raw-posix: add a raw_open_common helperChristoph Hellwig2009-06-151-29/+19
| | | | | | | | | | | raw_open and hdev_open contain the same basic logic. Add a new raw_open_common helper containing the guts of the open routine and call it from raw_open and hdev_open. We use the new open_flags field in BDRVRawState to allow passing additional open flags to raw_open_common from both. Signed-off-by: Christoph Hellwig <hch@lst.de>
* raw-posix: always store open flagsChristoph Hellwig2009-06-151-26/+21
| | | | | | | | | Both the Linux floppy and the FreeBSD CDROM host device need to store the open flags so that they can re-open the device later. Store the open flags unconditionally to remove the ifdef mess and simply the calling conventions for the later patches in the series. Signed-off-by: Christoph Hellwig <hch@lst.de>
* fix qemu_aio_flushAndrea Arcangeli2009-06-152-5/+10
| | | | | | | | | | | qemu_aio_wait by invoking the bh or one of the aio completion callbacks, could end up submitting new pending aio, breaking the invariant that qemu_aio_flush returns only when no pending aio is outstanding (possibly a problem for migration as such). Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Kevin Wolf <kwolf@redhat.com>
* migrate_fd_close: delete associated io-handler before closing the fdUri Lublin2009-06-131-0/+2
| | | | | | | | | | | | | | | It may happen that the io-handler is still registered. That causes select() to return with EBADF, not calling handlers for other fds. The io-handler would be registered when (on the source) the whole state was written but not yet flushed. For example when using QEMUFileBuffered, (tcp-migration) there may be data left in a buffer waiting to be transferred. In such a case buffered_close() calls buffered_flush() which calls migrate_fd_put_buffer, which may, upon EAGAIN, register migrate_fd_put_notify as a handler. Signed-off-by: Uri Lublin <uril@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* exec-migration: handle EINTR in popen_get_buffer()Uri Lublin2009-06-131-1/+8
| | | | | | | | | | Sometimes, upon interrupt, fread returns with no data, and the (incoming exec) migration fails. Fix by retrying on such a case. Signed-off-by: Uri Lublin <uril@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix prototype of function zfree.Stefan Weil2009-06-131-2/+2
| | | | | Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add static to local machine declaration.Stefan Weil2009-06-131-1/+1
| | | | | | | | Variable akitapda_machine is only used locally, so the static attribute avoids a compiler warning. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Don't use cpu_index as apic_id.Gleb Natapov2009-06-133-13/+40
| | | | | | | | | | | | | | (patch is on top of "Apic creation should not depend on pci" series) Currently cpu_index is used as cpu apic id on x86. This is incorrect since apic ids not have to be continuous (they can also encode cpu hierarchy information). This patch uses cpuid_apic_id for initial apic id value. For now cpuid_apic_id is set to be equal to cpu_index so behaviour is fully backward compatible, but it allows us to add qemu option to provide other values for cpu apic id. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Apic creation should not depend on pciGleb Natapov2009-06-131-8/+2
| | | | | | | It should depend on whether cpu has APIC. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add -no-virtio-balloon command-line optionEduardo Habkost2009-06-134-1/+15
| | | | | | | This new option may be used to disable the virtio-balloon device. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix SDL include path.Stefan Weil2009-06-132-2/+2
| | | | | | | | | | | | | | | | | | SDL header files can be included in two different ways: * like this: #include <SDL/SDL.h> * like this: #include <SDL.h> The 1st alternative is simple and works in many cases. The 2nd alternative needs sdl-config to get the correct compiler flags. It is the recommended way to write SDL includes and standard for QEMU. The patch fixes two non-standard SDL includes. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Really enable -WerrorBlue Swirl2009-06-131-13/+14
| | | | | | | 487fefdb.. did not actually enable -Werror despite the claims made by configure output. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Avoid collision with system NGROUPS definitionBlue Swirl2009-06-131-3/+3
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix a warning: uint_fast8_t is not 8 bits on OpenBSD/Sparc64Blue Swirl2009-06-131-2/+6
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Avoid a gcc 3 format warningBlue Swirl2009-06-132-12/+4
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Avoid gcc 4.4 warning about uninitialized fieldBlue Swirl2009-06-131-0/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix signedness problemsBlue Swirl2009-06-131-3/+3
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* xen nic: check tx queue after connect.Gerd Hoffmann2009-06-131-0/+2
| | | | | | | | | Needed for savevm/loadvm + migration: In that case the queue might already have packets on (re-)connect. The guest wouldn't notify us because notifications are only sent when stuffing a packet into an empty queue. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* include inttypes.h in xen.hGerd Hoffmann2009-06-131-0/+1
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* xen: adapt to qemu_machine changesGerd Hoffmann2009-06-131-1/+1
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* xen_disk: move sanity check to the correct placeGerd Hoffmann2009-06-131-4/+5
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Win32: Don't remove const attribute in type casts.Stefan Weil2009-06-133-3/+3
| | | | | | | | | 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 <weil@mail.berlios.de>
* Fix mingw32 build warningsBlue Swirl2009-06-137-12/+37
| | | | | | | | 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 <blauwirbel@gmail.com>
* Enable -Werror by default for git builds on Linux hostsAnthony Liguori2009-06-121-5/+13
| | | | | | | Additional hosts can be added to the white list as they are confirmed to build with --enable-werror. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* CRIS: Prettify sizes for the internal disasm.Edgar E. Iglesias2009-06-121-8/+8
| | | | Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* ETRAX: DMA fixes for 64bit hosts.Edgar E. Iglesias2009-06-121-26/+25
| | | | | | Mainly to remove warnings. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* ETRAX: Correct PIC creation for the bare FS board.Edgar E. Iglesias2009-06-111-2/+7
| | | | Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* qdev: move name+size into DeviceInfo (v2)Gerd Hoffmann2009-06-1127-61/+95
| | | | | | | | Rationale: move device information from code to data structures. v2: Adapt the drivers missed in the first version. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Fix stellaris ethernetPaul Brook2009-06-111-2/+2
| | | | | | | Revert bogus part of e3f5ec2b (pass VLANClientState* as first arg to receive handlers) Signed-off-by: Paul Brook <paul@codesourcery.com>
* Fix xilinx_ethlite breakage by 4f1c942b7fJan Kiszka2009-06-111-8/+8
| | | | | | Namely the new xilinx_ethlite used by mircoblaze. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
* Fix build breakage when using VDE introduced by 4f1c942Anthony Liguori2009-06-101-1/+1
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge branch 'net-queue'Anthony Liguori2009-06-1026-453/+834
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * net-queue: (28 commits) virtio-net: Increase filter and control limits virtio-net: Add new RX filter controls virtio-net: MAC filter optimization virtio-net: Fix MAC filter overflow handling virtio-net: reorganize receive_filter() virtio-net: Use a byte to store RX mode flags virtio-net: Add version_id 7 placeholder for vnet header support virtio-net: implement rx packet queueing net: make use of async packet sending API in tap client net: add qemu_send_packet_async() net: split out packet queueing and flushing into separate functions net: return status from qemu_deliver_packet() net: add return value to packet receive handler net: pass VLANClientState* as first arg to receive handlers net: re-name vc->fd_read() to vc->receive() net: add fd_readv() handler to qemu_new_vlan_client() args net: only read from tapfd when we can send net: vlan clients with no fd_can_read() can always receive net: move the tap buffer into TAPState net: factor tap_read_packet() out of tap_send() ... Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * virtio-net: Increase filter and control limitsAlex Williamson2009-06-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | Increase the size of the perfect filter table and control queue depth. This should give us more headroom in the MAC filter and is known to be needed by at least one guest user. Increasing the control queue depth allows a guest to feed several commands back to back if they so desire rather than using the send and wait approach Linux uses. Signed-off-by: Alex Williamson <alex.williamson@hp.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com>
| * virtio-net: Add new RX filter controlsAlex Williamson2009-06-092-8/+46
| | | | | | | | | | | | | | | | Add a few new RX modes to better control the receive_filter. These are all fairly obvious features that hardware could provide. Signed-off-by: Alex Williamson <alex.williamson@hp.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com>
| * virtio-net: MAC filter optimizationAlex Williamson2009-06-091-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The MAC filter table is received from the guest as two separate buffers, one with unicast entries, the other with multicast entries. If we track the index dividing the two sets, we can avoid searching the part of the table with the wrong type of entries. We could store this index as part of the save image, but its trivially easy to discover it on load. Signed-off-by: Alex Williamson <alex.williamson@hp.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com>
| * virtio-net: Fix MAC filter overflow handlingAlex Williamson2009-06-091-8/+23
| | | | | | | | | | | | | | | | | | Overloading the promisc and allmulti flags for indicating filter table overflow makes it difficult to track the actual requested operating mode. Split these out into separate flags. Signed-off-by: Alex Williamson <alex.williamson@hp.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com>
| * virtio-net: reorganize receive_filter()Alex Williamson2009-06-091-8/+11
| | | | | | | | | | | | | | | | | | | | Reorganize receive_filter to better handle the split between unicast and multicast filtering. This allows us to skip the broadcast check on unicast packets and leads to more opportunities for optimization. Signed-off-by: Alex Williamson <alex.williamson@hp.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com>
| * virtio-net: Use a byte to store RX mode flagsAlex Williamson2009-06-091-7/+12
| | | | | | | | | | | | | | | | There's no need to save 4 bytes for promisc and allmulti. Use one byte each just to avoid the overhead of a bitmap. Signed-off-by: Alex Williamson <alex.williamson@hp.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com>
| * virtio-net: Add version_id 7 placeholder for vnet header supportAlex Williamson2009-06-091-1/+8
| | | | | | | | | | Signed-off-by: Alex Williamson <alex.williamson@hp.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com>
| * virtio-net: implement rx packet queueingMark McLoughlin2009-06-091-1/+4
| | | | | | | | | | | | | | | | If we don't have room to receive a packet, we return zero from virtio_net_receive() and call qemu_flush_queued_packets() as soon as space becomes available. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
| * net: make use of async packet sending API in tap clientMark McLoughlin2009-06-091-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | 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: Mark McLoughlin <markmc@redhat.com>
| * net: add qemu_send_packet_async()Mark McLoughlin2009-06-092-21/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Mark McLoughlin <markmc@redhat.com>
| * net: split out packet queueing and flushing into separate functionsMark McLoughlin2009-06-091-57/+98
| | | | | | | | | | | | We'll be doing more packet queueing in later commits. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
| * net: return status from qemu_deliver_packet()Mark McLoughlin2009-06-091-3/+17
| | | | | | | | | | | | Will allow qemu_send_packet() handle queue full condition. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
| * net: add return value to packet receive handlerMark McLoughlin2009-06-0918-95/+126
| | | | | | | | | | | | | | This allows us to handle queue full conditions rather than dropping the packet on the floor. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
| * net: pass VLANClientState* as first arg to receive handlersMark McLoughlin2009-06-0919-90/+90
| | | | | | | | | | | | Give static type checking a chance to catch errors. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
| * net: re-name vc->fd_read() to vc->receive()Mark McLoughlin2009-06-0920-56/+57
| | | | | | | | | | | | | | | | | | 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 <markmc@redhat.com>
| * net: add fd_readv() handler to qemu_new_vlan_client() argsMark McLoughlin2009-06-0919-35/+40
| | | | | | | | | | | | | | This, apparently, is the style we prefer - all VLANClientState should be an argument to qemu_new_vlan_client(). Signed-off-by: Mark McLoughlin <markmc@redhat.com>
| * net: only read from tapfd when we can sendMark McLoughlin2009-06-091-1/+8
| | | | | | | | | | | | | | | | 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 <markmc@redhat.com>
| * net: vlan clients with no fd_can_read() can always receiveMark McLoughlin2009-06-091-6/+10
| | | | | | | | | | | | | | | | 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 <markmc@redhat.com>
OpenPOWER on IntegriCloud