Commit Graph

7643 Commits

Author SHA1 Message Date
Gleb Natapov
c4f31a0a0c Apic creation should not depend on pci
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>
2009-06-13 19:18:54 -05:00
Eduardo Habkost
df97b92060 Add -no-virtio-balloon command-line option
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>
2009-06-13 19:17:28 -05:00
Stefan Weil
6693665ace Fix SDL include path.
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>
2009-06-13 19:17:11 -05:00
Blue Swirl
1172f65362 Really enable -Werror
487fefdb.. did not actually enable -Werror despite the claims made by
configure output.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-13 15:37:55 +00:00
Blue Swirl
e99a22cc20 Avoid collision with system NGROUPS definition
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-13 15:10:28 +00:00
Blue Swirl
95bed64367 Fix a warning: uint_fast8_t is not 8 bits on OpenBSD/Sparc64
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-13 15:09:38 +00:00
Blue Swirl
a8b7063b1f Avoid a gcc 3 format warning
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-13 15:08:49 +00:00
Blue Swirl
c7085da726 Avoid gcc 4.4 warning about uninitialized field
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-13 13:20:25 +00:00
Blue Swirl
4f72c4dded Fix signedness problems
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-13 13:19:25 +00:00
Gerd Hoffmann
3e3cabcff9 xen nic: check tx queue after connect.
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>
2009-06-13 16:18:59 +03:00
Gerd Hoffmann
23327f7542 include inttypes.h in xen.h
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-06-13 16:18:31 +03:00
Gerd Hoffmann
a85d68877f xen: adapt to qemu_machine changes
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-06-13 16:18:13 +03:00
Gerd Hoffmann
908c7b9f78 xen_disk: move sanity check to the correct place
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-06-13 16:11:07 +03:00
Stefan Weil
705032644f 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 <weil@mail.berlios.de>
2009-06-13 14:22:03 +03:00
Blue Swirl
c5b76b3810 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 <blauwirbel@gmail.com>
2009-06-13 08:44:31 +00:00
Anthony Liguori
487fefdb1e Enable -Werror by default for git builds on Linux hosts
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>
2009-06-12 13:56:34 -05:00
Edgar E. Iglesias
ce24e07b7d CRIS: Prettify sizes for the internal disasm.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-06-12 15:55:36 +02:00
Edgar E. Iglesias
41107bcbc2 ETRAX: DMA fixes for 64bit hosts.
Mainly to remove warnings.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-06-12 15:41:25 +02:00
Edgar E. Iglesias
562183de2e ETRAX: Correct PIC creation for the bare FS board.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-06-11 15:11:48 +02:00
Gerd Hoffmann
074f2fff79 qdev: move name+size into DeviceInfo (v2)
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>
2009-06-11 13:47:36 +01:00
Paul Brook
57b452a848 Fix stellaris ethernet
Revert bogus part of e3f5ec2b
(pass VLANClientState* as first arg to receive handlers)

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-06-11 13:22:27 +01:00
Jan Kiszka
df12c1f543 Fix xilinx_ethlite breakage by 4f1c942b7f
Namely the new xilinx_ethlite used by mircoblaze.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2009-06-11 12:33:19 +01:00
Anthony Liguori
068daedd7d Fix build breakage when using VDE introduced by 4f1c942
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-10 20:24:44 -05:00
Anthony Liguori
f8e76fbf51 Merge branch 'net-queue'
* 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>
2009-06-10 18:08:35 -05:00
Luiz Capitulino
b319820d40 Fix "defined but not used" warning
The function qemu_calculate_timeout() is only used when CONFIG_IOTHREAD
is not defined. When CONFIG_IOTHREAD is defined, we have the following
warning:

vl.c:4389: warning: ‘qemu_calculate_timeout’ defined but not used

This change fixes that by moving the #ifdef/#endif from main_loop()
into qemu_calculate_timeout(). This encapsulates the logic and allow
us to use qemu_calculate_timeout() when CONFIG_IOTHREAD is defined
or not (suggested by Glauber Costa).

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2009-06-10 19:54:33 +03:00
Luiz Capitulino
4590fd80b8 monitor: Introduce get_command_name()
Move code to extract command name into a function of its own, this
clearifies the code and let us remove two variables from
monitor_handle_command().

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2009-06-10 19:46:49 +03:00
Luiz Capitulino
7869001b8f monitor: Remove unused variable
The local pointer 'q' is not used by monitor_handle_command().

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2009-06-10 19:46:11 +03:00
Luiz Capitulino
a84b785e93 monitor: Remove uneeded 'return' statement
The 'return' statement at the of monitor_handle_command() is not
needed and can be removed.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2009-06-10 19:46:08 +03:00
Luiz Capitulino
d91d9bf617 monitor: Remove uneeded goto
The 'found' goto in monitor_handle_command() can be dropped if we check
for 'cmd->name' after looking up for the command to execute.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2009-06-10 19:45:49 +03:00
Blue Swirl
3a41759da3 Use snprintf to avoid OpenBSD warning
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-09 19:12:21 +00:00
Blue Swirl
bab7944cf3 Fix Sparse warning
Fix this warning:
./qemu-options.h:198:1: error: expected preprocessor identifier

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-09 21:50:02 +03:00
Blue Swirl
07b44ce99e Clean up generated qemu-img-cmds.h
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-09 18:45:16 +00:00
Blue Swirl
b9aaf7f859 Fix Sparse warning
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-09 18:38:51 +00:00
Blue Swirl
cec9fac15d microblaze-dis.c does not need to be executable
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-09 18:27:02 +00:00
Blue Swirl
c5947808ef Fix warning
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-09 20:51:21 +03:00
Blue Swirl
8238467045 Remove unused and misnamed field and variable
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-09 17:25:00 +00:00
Blue Swirl
3dcd219f09 Update irqs on reset and device load
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-09 17:11:48 +00:00
Blue Swirl
32c86e95b2 Register reset functions for e1000 and rtl8139
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-09 15:02:00 +00:00
Alex Williamson
4ffb17f5c3 virtio-net: Increase filter and control limits
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>
2009-06-09 11:38:50 +01:00
Alex Williamson
015cb16699 virtio-net: Add new RX filter controls
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>
2009-06-09 11:38:50 +01:00
Alex Williamson
2d9aba3961 virtio-net: MAC filter optimization
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>
2009-06-09 11:38:50 +01:00
Alex Williamson
8fd2a2f1a9 virtio-net: Fix MAC filter overflow handling
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>
2009-06-09 11:38:50 +01:00
Alex Williamson
bbe2f399b2 virtio-net: reorganize receive_filter()
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>
2009-06-09 11:38:50 +01:00
Alex Williamson
f10c592e8d virtio-net: Use a byte to store RX mode flags
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>
2009-06-09 11:38:50 +01:00
Alex Williamson
6c042c16fc virtio-net: Add version_id 7 placeholder for vnet header support
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-06-09 11:38:50 +01:00
Mark McLoughlin
8aeff62d75 virtio-net: implement rx packet queueing
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>
2009-06-09 11:38:50 +01:00
Mark McLoughlin
e19eb22486 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
being dropped.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-06-09 11:38:50 +01:00
Mark McLoughlin
f3b6c7fcf8 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
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>
2009-06-09 11:38:50 +01:00
Mark McLoughlin
e94667b91c 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 <markmc@redhat.com>
2009-06-09 11:38:50 +01:00
Mark McLoughlin
3e021d40b7 net: return status from qemu_deliver_packet()
Will allow qemu_send_packet() handle queue full condition.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-06-09 11:38:50 +01:00