Commit Graph

12581 Commits

Author SHA1 Message Date
Alex Williamson e3f30488e5 virtio-net: Limit number of packets sent per TX flush
If virtio_net_flush_tx() is called with notification disabled, we can
race with the guest, processing packets at the same rate as they
get produced.  The trouble is that this means we have no guaranteed
exit condition from the function and can spend minutes in there.
Currently flush_tx is only called with notification on, which seems
to limit us to one pass through the queue per call.  An upcoming
patch changes this.

Also add an option to set this value on the command line as different
workloads may wish to use different values.  We can't necessarily
support any random value, so this is a developer option: x-txburst=
Usage:

-device virtio-net-pci,x-txburst=64 # 64 packets per tx flush

One pass through the queue (256) seems to be a good default value
for this, balancing latency with throughput.  We use a signed int
for x-txburst because 2^31 packets in a burst would take many, many
minutes to process and it allows us to easily return a negative
value value from virtio_net_flush_tx() to indicate a back-off
or error condition.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-09-07 20:29:26 +03:00
Alex Williamson f0c07c7c7b virtio-net: Make tx_timer timeout configurable
Add an option to make the TX mitigation timer adjustable as a device
option.  The 150us hard coded default used currently is reasonable,
but may not be suitable for all workloads, this gives us a way to
adjust it using a single binary.  We can't support any random option
though, so use the "x-" prefix to indicate this is a developer
option.  Usage:

-device virtio-net-pci,x-txtimer=500000,... # .5ms timeout

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-09-07 20:29:24 +03:00
Michael S. Tsirkin ca736c8e74 vhost_net: mergeable buffers support
use the new tap APIs to set header length

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-09-07 20:27:42 +03:00
Michael S. Tsirkin 445d892f43 tap: add APIs for vnet header length
Add APIs to control host header length. First user
will be vhost-net.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-09-07 20:27:33 +03:00
Michael S. Tsirkin ef4252b149 tap: generalize code for different vnet header len
Make host vnet header length a structure field in
preparation for using this support in linux kernel.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-09-07 20:27:28 +03:00
Alexander Graf 42a8765829 PPC: Change PPC maintainer
Since nobody else seems interested in maintaining PPC, let's change the
maintainer to myself. I keep a staging tree anyways and am probably the
person touching most of that code these days.

This changes the maintainer entry for working ppc targets to myself.

Signed-off-by: Alexander Graf <agraf@suse.de>
2010-09-07 13:46:17 +02:00
Michael S. Tsirkin a05e8a6e90 qemu: e1000 fix TOR math
Patch b0b900070c made
TOR valuer incorrect: the spec says it should always
include the CRC field.
No one seems to use this field, but better to stick to spec.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-09-06 14:47:56 +03:00
Alexander Graf cfb207e643 PPC: Make e500 pci byte swap config data
The config data field on the e500 pci controller is in little endian, so we need
to enable byte swap there.

Signed-off-by: Alexander Graf <agraf@suse.de>
2010-09-05 11:50:48 +02:00
Alexander Graf 13b7fdeffa PPC: Qdev'ify e500 pci
The e500 PCI controller isn't qdev'ified yet. This leads to severe issues
when running with -drive.

To be able to use a virtio disk with an e500 VM, let's convert the PCI
controller over to qdev.

Signed-off-by: Alexander Graf <agraf@suse.de>
2010-09-05 11:50:48 +02:00
Alexander Graf fc87e18530 KVM: PPC: Add level based interrupt logic
KVM on PowerPC used to have completely broken interrupt logic. Usually,
interrupts work by having a PIC that pulls a line up/down, so the CPU knows
that an interrupt is active. This line stays active until some action is
done to the PIC to release the line.

On KVM for PPC, we just checked if there was an interrupt pending and pulled
a line in the kernel module. We never released it though, hoping that kernel
space would just declare an interrupt as released when injected - which is
wrong.

To fix this, we need to completely redesign the interrupt injection logic.
Whenever an interrupt line gets triggered, we need to notify kernel space
that the line is up. Whenever it gets released, we do the same. This way
we can assure that the interrupt state is always known to kernel space.

This fixes random stalls in KVM guests on PowerPC that were waiting for
an interrupt while everyone else thought they received it already.

Signed-off-by: Alexander Graf <agraf@suse.de>
2010-09-05 11:50:48 +02:00
Izumi Tsutsui ba5e7f8216 vnc: use bswapNN() rather than bswap_NN()
bswap_NN() variants are not always available in CONFIG_MACHINE_BSWAP_H case
and bswapNN() are public APIs in "bswap.h".

Signed-off-by: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-04 10:11:32 +00:00
Serge Ziryukin 49e3fcc249 vnc: tight: remove unused variable
Signed-off-by: Serge Ziryukin <ftrvxmtrx@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-04 09:55:10 +00:00
Avi Kivity ad0a4ac1c0 Fix ivshmem build on 32-bit hosts
stat() fields can be more or less anything depending on configuration, cast
explicitly to uint64_t to avoid printf() format mismatches.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-04 09:53:53 +00:00
Aneesh Kumar K.V c93031e56a virtio-9p: Make sure -virtfs option works correctly
When making copy of arguments we were doing partial copy

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-04 09:52:53 +00:00
Jes Sorensen 1b27d7a1e8 hw/ivshmem.c don't check for negative values on unsigned data types
There is no need to check for dest < 0 or vector >= 0 as both are
uint16_t.

This should fix problems with broken build with aggressive compiler
flags. Reported by Xudong Hao <xudong.hao@intel.com>

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Acked-by: Cam Macdonell <cam@cs.ualberta.ca>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-04 09:52:25 +00:00
Jes Sorensen 37a05af069 load_multiboot(): get_image_size() returns int
Do not store return of get_image_size() in a uint32_t as it makes it
impossible to detect error returns from get_image_size.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-04 09:45:54 +00:00
Jes Sorensen 7390cdfbf7 Change DPRINTF() to do{}while(0) to avoid compiler warning
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-04 09:45:54 +00:00
Jes Sorensen 2116eff93c size_t is unsigned, change to ssize_t to handle errors from tight_compress_data()
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-04 09:45:53 +00:00
Jes Sorensen 26056e0c75 Fix repeated typo: was "end if list" instead of "end of list"
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-04 09:45:52 +00:00
Jes Sorensen e301b13d6a Respect return value from nbd_client()
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-04 09:45:51 +00:00
Jes Sorensen 0a4eb864e3 Remove unused argument for nbd_client()
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-04 09:45:50 +00:00
Blue Swirl cb93bbdd7d Fix OpenBSD linker warning
Fix a warning from OpenBSD linker:
../libhw32/vl.o(.text+0x5c3c): In function `main':
/src/qemu/vl.c:2335: warning: sprintf() is often misused, please use snprintf()

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-31 20:16:59 +00:00
Isaku Yamahata d729bb9a77 acpi: fix file size check with -acpitable.
acpi table file can be modified during load so file size check
should be more strict.
pointer calculation should be after qemu_realloc(). not before realloc().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-30 20:06:35 +00:00
Miguel Di Ciurcio Filho 7d631a116a savevm: Generate a name when run without one
When savevm is run without a name, the name stays blank and the snapshot is
saved anyway.

The new behavior is when savevm is run without parameters a name will be
created automaticaly, so the snapshot is accessible to the user without needing
the id when loadvm is run.

(qemu) savevm
(qemu) info snapshots
ID        TAG                 VM SIZE                DATE       VM CLOCK
1         vm-20100728134640      978K 2010-07-28 13:46:40   00:00:08.603

We use a name with the format 'vm-YYYYMMDDHHMMSS'.

This is a first step to hide the internal id, because I don't see a reason to
expose this kind of internals to the user.

Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-08-30 18:29:23 +02:00
Miguel Di Ciurcio Filho f920991574 monitor: make 'info snapshots' show only fully available snapshots
The output generated by 'info snapshots' shows only snapshots that exist on the
block device that saves the VM state. This output can cause an user to
erroneously try to load an snapshot that is not available on all block devices.

$ qemu-img snapshot -l xxtest.qcow2
Snapshot list:
ID        TAG                 VM SIZE                DATE       VM CLOCK
1                                1.5M 2010-07-26 16:51:52   00:00:08.599
2                                1.5M 2010-07-26 16:51:53   00:00:09.719
3                                1.5M 2010-07-26 17:26:49   00:00:13.245
4                                1.5M 2010-07-26 19:01:00   00:00:46.763

$ qemu-img snapshot -l xxtest2.qcow2
Snapshot list:
ID        TAG                 VM SIZE                DATE       VM CLOCK
3                                   0 2010-07-26 17:26:49   00:00:13.245
4                                   0 2010-07-26 19:01:00   00:00:46.763

Current output:
$ qemu -hda xxtest.qcow2 -hdb xxtest2.qcow2 -monitor stdio -vnc :0
QEMU 0.12.4 monitor - type 'help' for more information
(qemu) info snapshots
Snapshot devices: ide0-hd0
Snapshot list (from ide0-hd0):
ID        TAG                 VM SIZE                DATE       VM CLOCK
1                                1.5M 2010-07-26 16:51:52   00:00:08.599
2                                1.5M 2010-07-26 16:51:53   00:00:09.719
3                                1.5M 2010-07-26 17:26:49   00:00:13.245
4                                1.5M 2010-07-26 19:01:00   00:00:46.763

Snapshots 1 and 2 do not exist on xxtest2.qcow, but they are displayed anyway.

This patch sumarizes the output to only show fully available snapshots.

New output:
(qemu) info snapshots
ID        TAG                 VM SIZE                DATE       VM CLOCK
3                                1.5M 2010-07-26 17:26:49   00:00:13.245
4                                1.5M 2010-07-26 19:01:00   00:00:46.763

Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-08-30 18:29:23 +02:00
Andrew de Quincey 34cf008129 posix-aio-compat: Fix async_conmtext for ioctl
Set the async_context_id field when queuing an async ioctl call

Signed-off-by: Andrew de Quincey <adq@lidskialf.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-08-30 18:29:22 +02:00
Laurent Vivier 1d45f8b542 nbd: Introduce NBD named exports.
This patch allows to connect Qemu using NBD protocol to an nbd-server
using named exports.

For instance, if on the host "isoserver", in /etc/nbd-server/config, you have:

[generic]
[debian-500-ppc-netinst]
        exportname = /ISO/debian-500-powerpc-netinst.iso
[Fedora-10-ppc-netinst]
        exportname = /ISO/Fedora-10-ppc-netinst.iso

You can connect to it, using:

    qemu -cdrom nbd:isoserver:exportname=debian-500-ppc-netinst
    qemu -cdrom nbd:isoserver:exportname=Fedora-10-ppc-netinst

NOTE: you need at least nbd-server 2.9.18

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-08-30 18:29:22 +02:00
Loïc Minier 2aa326be0d vvfat: fat_chksum(): fix access above array bounds
Signed-off-by: Loïc Minier <loic.minier@linaro.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-08-30 18:29:22 +02:00
Kevin Wolf cdbae85169 qemu-img rebase: Open new backing file read-only
We never write to a backing file, so opening rw is useless. It just means that
you can't rebase on top of a file for which you don't have write permissions.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-08-30 18:29:22 +02:00
Izumi Tsutsui 010cb2b314 sheepdog: remove unnecessary includes
"qemu_socket.h" includes all necessary files and
including <netinet/tcp.h> without <netinet/in.h>
could cause errors on some systems.

Signed-off-by: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-08-30 18:29:22 +02:00
Kevin Wolf ee1811965f block: Fix image re-open in bdrv_commit
Arguably we should re-open the backing file with the backing file format and
not with the format of the snapshot image.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-08-30 18:29:22 +02:00
Kevin Wolf b6a4805b55 virtio-blk: Fix migration of queued requests
in_sg[].iovec and out_sg[].ioved are pointer to (source) host memory and
therefore invalid after migration. When loading the device state we must
create a new mapping on the destination host.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-08-30 18:29:22 +02:00
Kevin Wolf 42fb2e0720 virtio: Factor virtqueue_map_sg out
Separate the mapping of requests to host memory from the descriptor iteration.
The next patch will make use of it in a different context.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-08-30 18:29:19 +02:00
Isaku Yamahata 02a89b2190 isapc: fix segfault.
https://bugs.launchpad.net/bugs/611646
reports that ./i386-softmmu/qemu -M isapc segfaults.
This patch fixes the segfault introduced by
f885f1eaa8

It's because i440fx_state in pc_init1() isn't initialized.

> Core was generated by `./i386-softmmu/qemu -M isapc'.
> Program terminated with signal 11, Segmentation fault.
> [New process 19686]
>     at qemu/hw/piix_pci.c:136
> (gdb) where
>     at qemu/hw/piix_pci.c:136
>     boot_device=0x7fffe1f5b040 "cad", kernel_filename=0x0,
>     kernel_cmdline=0x6469bf "", initrd_filename=0x0,
>     cpu_model=0x654d10 "486", pci_enabled=0)
>     at qemu/hw/pc_piix.c:178
>     boot_device=0x7fffe1f5b040 "cad", kernel_filename=0x0,
>     kernel_cmdline=0x6469bf "", initrd_filename=0x0, cpu_model=0x654d10 "486")
>     at qemu/hw/pc_piix.c:207
>     envp=0x7fffe1f5b188)
>     at qemu/vl.c:2871

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-28 08:50:40 +00:00
Gleb Natapov 95c318f5e1 Fix segfault in mmio subpage handling code.
It is possible that subpage mmio is registered over existing memory
page. When this happens "memory" will have real memory address and not
index into io_mem array so next access to the page will generate
segfault. It is uncommon to have some part of a page to be accessed as
memory and some as mmio, but qemu shouldn't crash even when guest does
stupid things. So lets just pretend that the rest of the page is
unassigned if guest configure part of the memory page as mmio.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-28 08:47:23 +00:00
Blue Swirl 9e84a4708f etraxfs_eth: correct use of ! and &
Combining bitwise AND and logical NOT is suspicious.

Fixed by this Coccinelle script:
// From http://article.gmane.org/gmane.linux.kernel/646367
@@ expression E1,E2; @@
(
 !E1 & !E2
|
- !E1 & E2
+ !(E1 & E2)
)

Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-26 18:04:18 +00:00
Blue Swirl 8aa80ff82f Sparc: update OpenBIOS images to r859
Update Sparc32 and Sparc64 OpenBIOS images to SVN revision 859.

Bring also pc-bios/README up to date including the update performed by
419ef5f1c6.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-26 17:57:47 +00:00
Hollis Blanchard ceee6da6cf ppc4xx: load Bamboo kernel, initrd, and fdt at fixed addresses
We can't use the return value of load_uimage() for the kernel because it
can't account for BSS size, and the PowerPC kernel does not relocate
blobs before zeroing BSS.

Instead, we now load at the fixed addresses chosen by u-boot (the normal
firmware for the board).

Signed-off-by: Hollis Blanchard <hollis@penguinppc.org>
2010-08-26 18:18:26 +02:00
Hollis Blanchard a86299e53b ppc4xx: don't unregister RAM at reset
The PowerPC 4xx SDRAM controller emulation unregisters RAM in its reset
callback. However, qemu_system_reset() is now called at initialization
time, so all RAM is unregistered before starting the guest (!).

Signed-off-by: Hollis Blanchard <hollis@penguinppc.org>
2010-08-26 18:18:26 +02:00
Hollis Blanchard d23ab92064 ppc4xx: correct SDRAM controller warning message condition
The message "Truncating memory to %d MiB to fit SDRAM controller limits"
should be displayed only when a user chooses an amount of RAM which
can't be represented by the PPC 4xx SDRAM controller (e.g. 129MB, which
would only be valid if the controller supports a bank size of 1MB).

Signed-off-by: Hollis Blanchard <hollis@penguinppc.org>
2010-08-26 18:18:26 +02:00
Hollis Blanchard 52ba784d35 Fix "make install" with a cross toolchain
We must be able to use a non-native strip executable, but not all
versions of 'install' support the --strip-program option (e.g.
OpenBSD). Accordingly, we can't use 'install -s', and we must run strip
separately.

Signed-off-by: Hollis Blanchard <hollis@penguinppc.org>
Cc: blauwirbel@gmail.com
2010-08-26 18:18:26 +02:00
Alexander Graf 419ef5f1c6 PPC: Update openbios binary to r859
This updates the openBIOS binary to r589, adding support for PPC PV feature
pass-through in KVM.

Signed-off-by: Alexander Graf <agraf@suse.de>
2010-08-26 18:15:22 +02:00
Alexander Graf 45024f094c PPC: Add PV hypercall transport through fw_cfg
On KVM for PPC we need to tell the guest which instructions to use when
doing a hypercall. The clean way to do this is to go through an ioctl
from userspace and passing it on to the guest using the device tree.

So let's do the qemu part here: read out the hypercall and pass it on
to the guest's fw_cfg so openBIOS can read it out and expose it again.

Signed-off-by: Alexander Graf <agraf@suse.de>
2010-08-26 18:13:38 +02:00
Blue Swirl 2446333cd5 Rearrange block headers
Changing block.h or blockdev.h resulted in recompiling most objects.

Move DriveInfo typedef and BlockInterfaceType enum definitions
to qemu-common.h and rearrange blockdev.h use to decrease churn.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-24 15:22:24 +00:00
Anthony Liguori e945fb7627 Merge remote branch 'qemu-kvm/uq/master' into staging 2010-08-23 15:10:12 -05:00
Gerd Hoffmann 03b0ba70ab compile -fsdev and -virtfs cmd line options unconditionally.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-22 17:11:06 -05:00
Gerd Hoffmann 3329f07b7a QemuOpts: make most qemu_*_opts static
Switch tree to lookup-by-name using qemu_find_opts().
Also hook up virtfs options so qemu_find_opts works for them too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-22 17:11:06 -05:00
Gerd Hoffmann dfe795e71f QemuOpts: allow new option groups be registered at runtime.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-22 17:11:06 -05:00
Alex Williamson 916452df46 VGA: Don't register deprecated VBE range
Old versions of the BOCHs VGA BIOS (cira 2003) made use of VBE
registers at 0xff80/81.  In VBE API version 0xb0c2 these were
moved to 0x1ce/cf.  Unfortunately, QEMU still registers handlers
for the old range.  If a guest attempts to assign an I/O device
overlapping this region, QEMU exits with a hw_error.  Windows
guests seem to like to assign I/O devices to the high end of
the address space, so it's pretty easy to hot add an rtl8139
to a Win2k8 guest and trigger the bug.  I can't find any reason
to register these handlers, so let's remove the cruft.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-22 17:11:06 -05:00
Luiz Capitulino d29f3196af QMP: Update README file
A number of changes I prefer to do in one shot:

- Fix example
- Small clarifications
- Add multiple monitors example
- Add 'Development Process' section

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-08-22 17:11:06 -05:00