qemu
14 years agoqdev: move name+size into DeviceInfo (v2)
Gerd Hoffmann [Wed, 10 Jun 2009 07:41:42 +0000 (09:41 +0200)]
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>

14 years agoFix stellaris ethernet
Paul Brook [Thu, 11 Jun 2009 12:22:27 +0000 (13:22 +0100)]
Fix stellaris ethernet

Revert bogus part of e3f5ec2b
(pass VLANClientState* as first arg to receive handlers)

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoFix xilinx_ethlite breakage by 4f1c942b7f
Jan Kiszka [Thu, 11 Jun 2009 09:42:26 +0000 (11:42 +0200)]
Fix xilinx_ethlite breakage by 4f1c942b7f

Namely the new xilinx_ethlite used by mircoblaze.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

14 years agoFix build breakage when using VDE introduced by 4f1c942
Anthony Liguori [Thu, 11 Jun 2009 01:24:44 +0000 (20:24 -0500)]
Fix build breakage when using VDE introduced by 4f1c942

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoMerge branch 'net-queue'
Anthony Liguori [Wed, 10 Jun 2009 23:05:55 +0000 (18:05 -0500)]
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>

14 years agoFix "defined but not used" warning
Luiz Capitulino [Tue, 9 Jun 2009 21:24:57 +0000 (18:24 -0300)]
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>

14 years agomonitor: Introduce get_command_name()
Luiz Capitulino [Tue, 9 Jun 2009 21:21:30 +0000 (18:21 -0300)]
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>

14 years agomonitor: Remove unused variable
Luiz Capitulino [Tue, 9 Jun 2009 21:20:49 +0000 (18:20 -0300)]
monitor: Remove unused variable

The local pointer 'q' is not used by monitor_handle_command().

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>

14 years agomonitor: Remove uneeded 'return' statement
Luiz Capitulino [Tue, 9 Jun 2009 21:22:20 +0000 (18:22 -0300)]
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>

14 years agomonitor: Remove uneeded goto
Luiz Capitulino [Tue, 9 Jun 2009 21:21:54 +0000 (18:21 -0300)]
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>

14 years agoUse snprintf to avoid OpenBSD warning
Blue Swirl [Tue, 9 Jun 2009 19:12:21 +0000 (19:12 +0000)]
Use snprintf to avoid OpenBSD warning

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

14 years agoFix Sparse warning
Blue Swirl [Tue, 9 Jun 2009 18:50:02 +0000 (21:50 +0300)]
Fix Sparse warning

Fix this warning:
./qemu-options.h:198:1: error: expected preprocessor identifier

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

14 years agoClean up generated qemu-img-cmds.h
Blue Swirl [Tue, 9 Jun 2009 18:45:16 +0000 (18:45 +0000)]
Clean up generated qemu-img-cmds.h

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

14 years agoFix Sparse warning
Blue Swirl [Tue, 9 Jun 2009 18:38:51 +0000 (18:38 +0000)]
Fix Sparse warning

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

14 years agomicroblaze-dis.c does not need to be executable
Blue Swirl [Tue, 9 Jun 2009 18:27:02 +0000 (18:27 +0000)]
microblaze-dis.c does not need to be executable

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

14 years agoFix warning
Blue Swirl [Tue, 9 Jun 2009 17:51:21 +0000 (20:51 +0300)]
Fix warning

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

14 years agoRemove unused and misnamed field and variable
Blue Swirl [Tue, 9 Jun 2009 17:16:53 +0000 (17:16 +0000)]
Remove unused and misnamed field and variable

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

14 years agoUpdate irqs on reset and device load
Blue Swirl [Tue, 9 Jun 2009 17:11:48 +0000 (17:11 +0000)]
Update irqs on reset and device load

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

14 years agoRegister reset functions for e1000 and rtl8139
Blue Swirl [Tue, 9 Jun 2009 15:02:00 +0000 (15:02 +0000)]
Register reset functions for e1000 and rtl8139

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

14 years agovirtio-net: Increase filter and control limits
Alex Williamson [Fri, 5 Jun 2009 20:47:23 +0000 (14:47 -0600)]
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>

14 years agovirtio-net: Add new RX filter controls
Alex Williamson [Fri, 5 Jun 2009 20:47:18 +0000 (14:47 -0600)]
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>

14 years agovirtio-net: MAC filter optimization
Alex Williamson [Fri, 5 Jun 2009 20:47:13 +0000 (14:47 -0600)]
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>

14 years agovirtio-net: Fix MAC filter overflow handling
Alex Williamson [Fri, 5 Jun 2009 20:47:08 +0000 (14:47 -0600)]
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>

14 years agovirtio-net: reorganize receive_filter()
Alex Williamson [Fri, 5 Jun 2009 20:47:02 +0000 (14:47 -0600)]
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>

14 years agovirtio-net: Use a byte to store RX mode flags
Alex Williamson [Fri, 5 Jun 2009 20:46:57 +0000 (14:46 -0600)]
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>

14 years agovirtio-net: Add version_id 7 placeholder for vnet header support
Alex Williamson [Fri, 5 Jun 2009 20:46:52 +0000 (14:46 -0600)]
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>

14 years agovirtio-net: implement rx packet queueing
Mark McLoughlin [Wed, 29 Apr 2009 12:40:02 +0000 (13:40 +0100)]
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>

14 years agonet: make use of async packet sending API in tap client
Mark McLoughlin [Wed, 29 Apr 2009 12:30:24 +0000 (13:30 +0100)]
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>

14 years agonet: add qemu_send_packet_async()
Mark McLoughlin [Wed, 29 Apr 2009 11:15:26 +0000 (12:15 +0100)]
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>

14 years agonet: split out packet queueing and flushing into separate functions
Mark McLoughlin [Wed, 29 Apr 2009 10:48:12 +0000 (11:48 +0100)]
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>

14 years agonet: return status from qemu_deliver_packet()
Mark McLoughlin [Wed, 29 Apr 2009 10:34:52 +0000 (11:34 +0100)]
net: return status from qemu_deliver_packet()

Will allow qemu_send_packet() handle queue full condition.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>

14 years agonet: add return value to packet receive handler
Mark McLoughlin [Mon, 18 May 2009 12:40:55 +0000 (13:40 +0100)]
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 <markmc@redhat.com>

14 years agonet: pass VLANClientState* as first arg to receive handlers
Mark McLoughlin [Mon, 18 May 2009 12:33:03 +0000 (13:33 +0100)]
net: pass VLANClientState* as first arg to receive handlers

Give static type checking a chance to catch errors.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>

14 years agonet: re-name vc->fd_read() to vc->receive()
Mark McLoughlin [Mon, 18 May 2009 12:13:16 +0000 (13:13 +0100)]
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 <markmc@redhat.com>

14 years agonet: add fd_readv() handler to qemu_new_vlan_client() args
Mark McLoughlin [Mon, 18 May 2009 11:55:27 +0000 (12:55 +0100)]
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 <markmc@redhat.com>

14 years agonet: only read from tapfd when we can send
Mark McLoughlin [Wed, 29 Apr 2009 08:50:32 +0000 (09:50 +0100)]
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 <markmc@redhat.com>

14 years agonet: vlan clients with no fd_can_read() can always receive
Mark McLoughlin [Wed, 29 Apr 2009 08:36:43 +0000 (09:36 +0100)]
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 <markmc@redhat.com>

14 years agonet: move the tap buffer into TAPState
Mark McLoughlin [Mon, 18 May 2009 11:05:44 +0000 (12:05 +0100)]
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.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>

14 years agonet: factor tap_read_packet() out of tap_send()
Mark McLoughlin [Wed, 29 Apr 2009 08:43:37 +0000 (09:43 +0100)]
net: factor tap_read_packet() out of tap_send()

Move portability clutter out into its own function.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>

14 years agoslirp: Reorder initialization
Jan Kiszka [Fri, 8 May 2009 10:34:18 +0000 (12:34 +0200)]
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
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: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>

14 years agonet: Improve parameter error reporting
Jan Kiszka [Fri, 8 May 2009 10:34:18 +0000 (12:34 +0200)]
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
a helper to catch both cases and convert net_client_init as well as
net_slirp_redir.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>

14 years agonet: fix error reporting for some net parameter checks
Mark McLoughlin [Thu, 28 May 2009 15:39:54 +0000 (16:39 +0100)]
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'

Signed-off-by: Mark McLoughlin <markmc@redhat.com>

14 years agonet: Real fix for check_params users
Jan Kiszka [Fri, 8 May 2009 10:34:17 +0000 (12:34 +0200)]
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
ones.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>

14 years agoRevert "Fix output of uninitialized strings"
Mark McLoughlin [Thu, 28 May 2009 13:07:31 +0000 (14:07 +0100)]
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

fixed the problem but introduced another problem which
this commit:

  8cf07dcbe7 Fix output of uninitialized strings

fixed that final problem, but causing us to lose some
error reporting information in the process.

Meanwhile Jan posted a patch to mostly re-do ffad4116b9
in a way that fixes the original issue, but without
losing the error reporting information. So, let's revert
8cf07dcbe7 and apply Jan's patch.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>

14 years agoslirp: Avoid zombie processes after fork_exec
Jan Kiszka [Fri, 8 May 2009 10:34:17 +0000 (12:34 +0200)]
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,
but also make sure we disable the signal while waiting on forked network
setup/shutdown scripts.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>

14 years agonet: Fix and improved ordered packet delivery
Jan Kiszka [Fri, 8 May 2009 10:34:17 +0000 (12:34 +0200)]
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 <jan.kiszka@siemens.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>

14 years agonet: Don't deliver to disabled interfaces in qemu_sendv_packet
Jan Kiszka [Fri, 8 May 2009 10:34:17 +0000 (12:34 +0200)]
net: Don't deliver to disabled interfaces in qemu_sendv_packet

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>

14 years agoqdev: c99 initilaizers for bus_type_names
Gerd Hoffmann [Mon, 8 Jun 2009 12:33:57 +0000 (14:33 +0200)]
qdev: c99 initilaizers for bus_type_names

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

14 years agoxen nic: use XC_PAGE_SIZE instead of PAGE_SIZE.
Gerd Hoffmann [Mon, 8 Jun 2009 12:33:27 +0000 (14:33 +0200)]
xen nic: use XC_PAGE_SIZE instead of PAGE_SIZE.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

14 years agoxen nic: use qemu_malloc
Gerd Hoffmann [Mon, 8 Jun 2009 12:33:25 +0000 (14:33 +0200)]
xen nic: use qemu_malloc

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

14 years agokvm: Improve upgrade notes when facing unsupported kernels
Jan Kiszka [Sun, 7 Jun 2009 09:30:25 +0000 (11:30 +0200)]
kvm: Improve upgrade notes when facing unsupported kernels

Users complained that it is not obvious what to do when kvm refuses to
build or run due to an unsupported host kernel, so let's improve the
hints.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

14 years agoFix generation of CONFIG_KVM
Blue Swirl [Sun, 7 Jun 2009 13:29:26 +0000 (13:29 +0000)]
Fix generation of CONFIG_KVM

When configuring for several targets, some with KVM and some without, CONFIG_KVM was accidentally disabled for some of the targets.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

14 years agoUse hxtool for qemu-img command list
Stuart Brady [Sat, 6 Jun 2009 23:42:17 +0000 (00:42 +0100)]
Use hxtool for qemu-img command list

Use hxtool to generate the 'command syntax' section of qemu-img's help
message, and the corresponding section of the texinfo documentation.

This has the side-effect of adding 'check' to this list of commands in
the texinfo documentation.

Signed-off-by: Stuart Brady <stuart.brady@gmail.com>

14 years agodoc: Update information on supported network adapters.
Stefan Weil [Sat, 6 Jun 2009 16:05:58 +0000 (18:05 +0200)]
doc: Update information on supported network adapters.

* There are no ISA PCI network adapters.
* MIPS Malta is supported with any PCI network card.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>

14 years agoxen: net backend doesn't need linux headers.
Gerd Hoffmann [Tue, 2 Jun 2009 07:05:24 +0000 (09:05 +0200)]
xen: net backend doesn't need linux headers.

Drop them to make qemu build on OpenSolaris.

Cc: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

14 years agoDocument changes in qemu-img interface
Kevin Wolf [Thu, 4 Jun 2009 13:39:39 +0000 (15:39 +0200)]
Document changes in qemu-img interface

Update the documentation to reflect the introduction of format specific options
with -o. Don't advertise -e or -6 any more, they exist only for compatibility
reasons and can be replaced by the corresponding -o options.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>

14 years agoqemu-img: Print available options with -o ?
Kevin Wolf [Thu, 4 Jun 2009 13:39:38 +0000 (15:39 +0200)]
qemu-img: Print available options with -o ?

This patch adds a small help text to each of the options in the block drivers
which can be displayed by using qemu-img create -f fmt -o ?

Signed-off-by: Kevin Wolf <kwolf@redhat.com>

14 years agoFix spelling in comment.
Stefan Weil [Sat, 6 Jun 2009 15:00:31 +0000 (17:00 +0200)]
Fix spelling in comment.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>

14 years agoUse hxtool to generate monitor documentation and C structures
Blue Swirl [Sat, 6 Jun 2009 08:22:04 +0000 (08:22 +0000)]
Use hxtool to generate monitor documentation and C structures

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

14 years agoUse correct type for SPARC cpu_cc_op
Paul Brook [Sat, 6 Jun 2009 01:54:03 +0000 (02:54 +0100)]
Use correct type for SPARC cpu_cc_op

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoFix typo
Paul Brook [Sat, 6 Jun 2009 01:49:32 +0000 (02:49 +0100)]
Fix typo

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoqdev: add monitor command to dump the tree.
Gerd Hoffmann [Fri, 5 Jun 2009 14:53:17 +0000 (15:53 +0100)]
qdev: add monitor command to dump the tree.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoRecord device property types
Paul Brook [Fri, 5 Jun 2009 14:52:04 +0000 (15:52 +0100)]
Record device property types

Record device property types, and provide a list of properties at device
registration time.

Add a "device" property type that holds a reference to annother device.

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoFix elf loader range checking
Paul Brook [Fri, 5 Jun 2009 14:16:41 +0000 (15:16 +0100)]
Fix elf loader range checking

The ELF loader tracks the range of addresses used by a binary.
However this incorrectly assumes zero is not a valid address.

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoRemove ARM NVIC initialization hack
Paul Brook [Thu, 4 Jun 2009 12:12:05 +0000 (13:12 +0100)]
Remove ARM NVIC initialization hack

The ARMv7-M NVIC device pokes itself into the CPU state.  Now we have a
proper device model we can have the CPU/SoC code do this.

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoAdd --enable-debug
Paul Brook [Thu, 4 Jun 2009 10:39:04 +0000 (11:39 +0100)]
Add --enable-debug

New configure option for debug builds.

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoqdev: kill DeviceState->name
Gerd Hoffmann [Wed, 27 May 2009 20:54:29 +0000 (22:54 +0200)]
qdev: kill DeviceState->name

is redundant with DeviceState->type->name

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

14 years agofix gdbstub support for multiple threads in usermode, v3
Nathan Froyd [Wed, 3 Jun 2009 18:33:08 +0000 (11:33 -0700)]
fix gdbstub support for multiple threads in usermode, v3

When debugging multi-threaded programs, QEMU's gdb stub would report the
correct number of threads (the qfThreadInfo and qsThreadInfo packets).
However, the stub was unable to actually switch between threads (the T
packet), since it would report every thread except the first as being
dead.  Furthermore, the stub relied upon cpu_index as a reliable means
of assigning IDs to the threads.  This was a bad idea; if you have this
sequence of events:

initial thread created
new thread #1
new thread #2
thread #1 exits
new thread #3

thread #3 will have the same cpu_index as thread #1, which would confuse
GDB.  (This problem is partly due to the remote protocol not having a
good way to send thread creation/destruction events.)

We fix this by using the host thread ID for the identifier passed to GDB
when debugging a multi-threaded userspace program.  The thread ID might
wrap, but the same sort of problems with wrapping thread IDs would come
up with debugging programs natively, so this doesn't represent a
problem.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>

14 years agoCRIS: Remove duplicated flag defines.
Edgar E. Iglesias [Wed, 3 Jun 2009 20:48:05 +0000 (22:48 +0200)]
CRIS: Remove duplicated flag defines.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agomicroblaze: Fix loading of petalogix s3adsp1800 dtb.
Edgar E. Iglesias [Wed, 3 Jun 2009 19:54:31 +0000 (21:54 +0200)]
microblaze: Fix loading of petalogix s3adsp1800 dtb.

Provide a petalogix-s3adsp1800.dtb blob.
Correct loading of the petalogix dtb.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agoStellaris qdev conversion
Paul Brook [Wed, 3 Jun 2009 14:16:49 +0000 (15:16 +0100)]
Stellaris qdev conversion

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoImplement multiple samplers on stellaris ADC
Paul Brook [Tue, 2 Jun 2009 14:30:27 +0000 (15:30 +0100)]
Implement multiple samplers on stellaris ADC

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoUse relative path for bios
Paul Brook [Fri, 29 May 2009 23:52:44 +0000 (00:52 +0100)]
Use relative path for bios

Look for bios and other support files relative to qemu binary, rather than
a hardcoded prefix.

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoUpdate maintainer list.
Edgar E. Iglesias [Thu, 28 May 2009 12:00:49 +0000 (14:00 +0200)]
Update maintainer list.

Add myself as maintainer for the microblaze cpu and boards.
Update list of CRIS machines.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agoInstall keymaps from new location
Anthony Liguori [Thu, 28 May 2009 08:11:42 +0000 (03:11 -0500)]
Install keymaps from new location

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agovvfat: one more missing BlockDriver C99 initializer conversion
Christoph Hellwig [Wed, 27 May 2009 14:14:13 +0000 (16:14 +0200)]
vvfat: one more missing BlockDriver C99 initializer conversion

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoMove keymaps into pc-bios
Anthony Liguori [Wed, 27 May 2009 14:36:33 +0000 (09:36 -0500)]
Move keymaps into pc-bios

This isn't the most ideal layout, but it makes -L /path/to/git/pc-bios Just
Work which is very convenient.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agokvm: Mark full address range dirty on live migration start
Jan Kiszka [Fri, 22 May 2009 21:51:45 +0000 (23:51 +0200)]
kvm: Mark full address range dirty on live migration start

As Avi correctly noted, last_ram_offset does not mark the last physical
RAM address the guest may see (due to non-continuous memory regions).
Ensure that we catch them all by marking the full possible address range
dirty.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoAdd detection of pthread library name
Sebastian Herbszt [Sun, 24 May 2009 20:07:53 +0000 (22:07 +0200)]
Add detection of pthread library name

Try to detect the name of the pthread library.
Currently it looks for "-pthread" and "-pthreadGC2".

Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoUser networking: Show active connections
Alexander Graf [Tue, 26 May 2009 11:03:27 +0000 (13:03 +0200)]
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
patch.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoUser Networking: Enable removal of redirections
Alexander Graf [Tue, 26 May 2009 11:03:26 +0000 (13:03 +0200)]
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.

This patch adds support for removal of redirections.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoAllow monitor interaction when using migrate -exec
Chris Lalancette [Mon, 25 May 2009 14:38:23 +0000 (16:38 +0200)]
Allow monitor interaction when using migrate -exec

All,
     I've recently been playing around with migration via exec.  Unfortunately,
when starting the incoming qemu process with "-incoming exec:cmd", it suffers
the same problem that -incoming tcp used to suffer; namely, that you can't
interact with the monitor until after the migration has happened.  This causes
problems for libvirt usage of -incoming exec, since libvirt expects to be able
to access the monitor ahead of time.  This fairly simple patch allows you to
access the monitor both before and after the migration has completed using exec.

(note: developed/tested with qemu-kvm, but applies perfectly fine to qemu)

Signed-off-by: Chris Lalancette <clalance@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agofully split aio_pool from BlockDriver
Christoph Hellwig [Mon, 25 May 2009 10:37:32 +0000 (12:37 +0200)]
fully split aio_pool from BlockDriver

Now that we have a separate aio pool structure we can remove those
aio pool details from BlockDriver.

Every driver supporting AIO now needs to declare a static AIOPool
with the aiocb size and the cancellation method.  This cleans up the
current code considerably and will make it cleaner and more obvious
to support two different aio implementations behind a single
BlockDriver.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoqcow: add qcow_aio_setup helper
Christoph Hellwig [Mon, 25 May 2009 13:45:37 +0000 (15:45 +0200)]
qcow: add qcow_aio_setup helper

[this one is required for [PATCH] fully split aio_pool from BlockDriver,
 sorry for not sending it out earlier]

Add a qcow_aio_setup helper to qcow to shared common code between
the aio_readv and aio_writev methods.  Based on the function with
the same name in qcow2.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoraw-posix: fix hdev_create
Christoph Hellwig [Mon, 25 May 2009 08:29:13 +0000 (10:29 +0200)]
raw-posix: fix hdev_create

We do need hdev_create unconditionally on all platforms so that qemu-img
create support for host device works on all platforms.

Also relax the check to allow character devices in addition to block
devices.  On many Unix platforms block devices have buffered block
nodes and unbuffered character device nodes, and on FreeBSD the block
nodes don't even exist anymore.  Also on Linux we do support the
/dev/sgN scsi passthrough devices through the host device driver,
and probably the old-style /dev/raw/rawN raw devices although I haven't
tested that.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agofix raw_pread_aligned return value
Christoph Hellwig [Mon, 25 May 2009 08:08:52 +0000 (10:08 +0200)]
fix raw_pread_aligned return value

raw_pread_aligned currently returns the raw return value from
lseek/read, which is always -1 in case of an error.  But the
callers higher up the stack expect it to return the negated
errno just like raw_pwrite_aligned.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoVNC: Fix memory allocation (wrong structure size).
Stefan Weil [Sun, 24 May 2009 20:33:34 +0000 (22:33 +0200)]
VNC: Fix memory allocation (wrong structure size).

Pointer vs addresses a VncDisplay structure,
so it is sufficient to allocate sizeof(VncDisplay)
or sizeof(*vs) bytes instead of the much larger
sizeof(VncState).

Maybe the misleading name should be fixed, too:
the code contains many places where vs is used,
sometimes it is a VncState *, sometimes it is a
VncDisplay *. vd would be a better name.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoDrop bdrv_create2
Kevin Wolf [Wed, 27 May 2009 12:48:06 +0000 (14:48 +0200)]
Drop bdrv_create2

This patch converts the remaining users of bdrv_create2 to bdrv_create and
removes the now unused function.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoqcow2: Update multiple refcounts at once
Kevin Wolf [Tue, 26 May 2009 12:36:03 +0000 (14:36 +0200)]
qcow2: Update multiple refcounts at once

Don't write each single changed refcount block entry to the disk after it is
written, but update all entries of the block and write all of them at once.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoqcow2: Refactor update_refcount
Kevin Wolf [Tue, 26 May 2009 12:36:02 +0000 (14:36 +0200)]
qcow2: Refactor update_refcount

This is a preparation patch with no functional changes. It moves the allocation
of new refcounts block to a new function and makes update_cluster_refcount (for
one cluster) call update_refcount (for multiple clusters) instead the other way
round.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoqcow/qcow2: Drop synchronous qcow_write()
Kevin Wolf [Mon, 25 May 2009 09:38:59 +0000 (11:38 +0200)]
qcow/qcow2: Drop synchronous qcow_write()

There is only one (internal) user left and it can be switched to the normal
emulation provided in block.c

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoe1000: Ignore reset command
Kevin Wolf [Sat, 23 May 2009 09:21:33 +0000 (11:21 +0200)]
e1000: Ignore reset command

When a reset is requested, the current e1000 emulation never clears the
reset bit which may cause a driver to hang. This patch masks the reset
bit out when setting the control registert, so the reset is immediately
completed.

Signed-off-by: Kevin Wolf <mail@kevin-wolf.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoFix output of uninitialized strings
Kevin Wolf [Tue, 19 May 2009 16:51:34 +0000 (18:51 +0200)]
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
is uninitialized, so this patch removes it from the message.

This means that the user is only told the whole parameter string and has to
pick the wrong option by himself as the callers of check_params can't know this
value any more. An alternative approach would be to revert that commit and do
whatever is needed to fix the original problem without changing check_params.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agomicroblaze: Conditionalize FDT features.
Edgar E. Iglesias [Wed, 27 May 2009 08:49:12 +0000 (10:49 +0200)]
microblaze: Conditionalize FDT features.

If libfdt is not available, disable the fdt manipulation features.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agodoc: Briefly mention CRIS and MicroBlaze.
Edgar E. Iglesias [Tue, 26 May 2009 23:34:02 +0000 (01:34 +0200)]
doc: Briefly mention CRIS and MicroBlaze.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agomicroblaze: Make writes to MMU_ZPR flush the TLB.
Edgar E. Iglesias [Tue, 26 May 2009 23:19:58 +0000 (01:19 +0200)]
microblaze: Make writes to MMU_ZPR flush the TLB.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agomicroblaze: Correct typo.
Edgar E. Iglesias [Tue, 26 May 2009 23:10:26 +0000 (01:10 +0200)]
microblaze: Correct typo.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agomicroblaze: Hook into the build-system.
Edgar E. Iglesias [Wed, 20 May 2009 19:17:31 +0000 (21:17 +0200)]
microblaze: Hook into the build-system.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agomicroblaze: Add GDB stub support.
Edgar E. Iglesias [Wed, 20 May 2009 18:16:31 +0000 (20:16 +0200)]
microblaze: Add GDB stub support.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agomicroblaze: Add petalogix s3a1800dsp MMU linux ref-design.
Edgar E. Iglesias [Wed, 20 May 2009 18:16:11 +0000 (20:16 +0200)]
microblaze: Add petalogix s3a1800dsp MMU linux ref-design.

This setup was designed by petalogix and is supported by upstream linux.
The design targets a xilinx spartan-3a-1800 dsp board with MMU.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>