sdk/emulator/qemu.git
13 years agoremove smb380 emulation
munkyu.im [Tue, 31 May 2011 12:35:03 +0000 (21:35 +0900)]
remove smb380 emulation

13 years agochange configure file to fix windows build
munkyu.im [Mon, 30 May 2011 05:45:18 +0000 (14:45 +0900)]
change configure file to fix windows build

13 years agoget rid of opengl module
munkyu.im [Thu, 26 May 2011 16:55:07 +0000 (01:55 +0900)]
get rid of opengl module

13 years agoadd jpeg option for mingw build
munkyu.im [Tue, 24 May 2011 07:14:24 +0000 (16:14 +0900)]
add jpeg option for mingw build

13 years agofix "simulator save state" by adding qemu_monitor logs
munkyu.im [Thu, 19 May 2011 13:27:04 +0000 (22:27 +0900)]
fix "simulator save state" by adding qemu_monitor logs

13 years agochange vgabios-stdvga.bin to vgabios.bin in 0.13
dk77.yun [Wed, 18 May 2011 18:21:26 +0000 (03:21 +0900)]
change vgabios-stdvga.bin to vgabios.bin in 0.13

13 years agoupdate for SDL screen problem
dk77.yun [Wed, 18 May 2011 17:35:33 +0000 (02:35 +0900)]
update for SDL screen problem

13 years agofix kvm_mce_broadcast_rest() undefined error
munkyu.im [Tue, 17 May 2011 11:50:59 +0000 (20:50 +0900)]
fix kvm_mce_broadcast_rest() undefined error

13 years agosd: Don't complain about SDIO commands CMD52/CMD53
munkyu.im [Tue, 17 May 2011 08:27:08 +0000 (17:27 +0900)]
sd: Don't complain about SDIO commands CMD52/CMD53
52, 53 commands are new command of SPIO spec.

13 years agofix TCG optimization
munkyu.im [Tue, 17 May 2011 08:23:08 +0000 (17:23 +0900)]
fix TCG optimization
- 32-bit operation for 64-bit host

13 years agochange kvm.c 0.13 version to 0.14.1 version(it was skipped by mistake)
munkyu.im [Tue, 17 May 2011 05:51:30 +0000 (14:51 +0900)]
change kvm.c 0.13 version to 0.14.1 version(it was skipped by mistake)
change kvm_arch_required_capabilities(struct) definition

13 years agoadd SDL libraries link in configure file(unless you'll see the error "undefined refer...
munkyu.im [Mon, 16 May 2011 06:32:41 +0000 (15:32 +0900)]
add SDL libraries link in configure file(unless you'll see the error "undefined reference to rotozoomSurface()")

13 years agoadd sdl_rotate ( enable rotation on simualtor)
munkyu.im [Mon, 16 May 2011 05:02:08 +0000 (14:02 +0900)]
add sdl_rotate ( enable rotation on simualtor)

13 years agofix main() duplicated defintion error between qemu and simulator
munkyu.im [Mon, 16 May 2011 04:59:42 +0000 (13:59 +0900)]
fix main() duplicated defintion error between qemu and simulator

13 years agoadd qemu_configure.sh (It enables to add option to the configure file)
munkyu.im [Mon, 16 May 2011 04:31:20 +0000 (13:31 +0900)]
add qemu_configure.sh (It enables to add option to the configure file)

13 years agoFix sdl display to fix link error(sdl.c,console.h) and redefined error(sdl_keysym.h).
munkyu.im [Mon, 16 May 2011 02:47:55 +0000 (11:47 +0900)]
Fix sdl display to fix link error(sdl.c,console.h) and redefined error(sdl_keysym.h).
Add sdl_rotate.o at Makefile.

13 years agoAdd opengl module to avoid call opengl_exec_set_parent_window() from simulator/qemu_g...
munkyu.im [Mon, 16 May 2011 02:32:49 +0000 (11:32 +0900)]
Add opengl module to avoid call opengl_exec_set_parent_window() from simulator/qemu_gtk_widget.c .
It's temporary. Opengl for x86 has problem now.

13 years agoadd svibe(Haptic vibrator) and smb380(Accelerometer) library
munkyu.im [Mon, 16 May 2011 02:24:36 +0000 (11:24 +0900)]
add svibe(Haptic vibrator) and smb380(Accelerometer) library

13 years agoinitialize to 0.14.1 qemu
munkyu.im [Mon, 16 May 2011 01:27:56 +0000 (10:27 +0900)]
initialize to 0.14.1 qemu

13 years agocleanup x86_simulator branch
dk77.yun [Wed, 11 May 2011 11:06:34 +0000 (20:06 +0900)]
cleanup x86_simulator branch

13 years agoMerge remote branch 'upstream/master'
Rafal Krypa [Wed, 24 Nov 2010 07:22:50 +0000 (16:22 +0900)]
Merge remote branch 'upstream/master'

13 years agomicroblaze: target-ify target_ucontext
Richard Henderson [Mon, 22 Nov 2010 22:57:52 +0000 (14:57 -0800)]
microblaze: target-ify target_ucontext

Rename the members of target_ucontext so that they don't conflict
with possible host macros for ucontext members.  This has already
been done for the other targets.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
13 years agovirtio-pci: Convert fprintf() to error_report()
Stefan Hajnoczi [Mon, 15 Nov 2010 20:44:38 +0000 (20:44 +0000)]
virtio-pci: Convert fprintf() to error_report()

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovirtio-net: Convert fprintf() to error_report()
Stefan Hajnoczi [Mon, 15 Nov 2010 20:44:37 +0000 (20:44 +0000)]
virtio-net: Convert fprintf() to error_report()

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovirtio: Convert fprintf() to error_report()
Stefan Hajnoczi [Mon, 15 Nov 2010 20:44:36 +0000 (20:44 +0000)]
virtio: Convert fprintf() to error_report()

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovirtio-blk: Convert fprintf() to error_report()
Stefan Hajnoczi [Mon, 15 Nov 2010 20:44:35 +0000 (20:44 +0000)]
virtio-blk: Convert fprintf() to error_report()

Errors should be logged using error_report() so they go to the
appropriate monitor.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovgabios update: handle compatibility with older qemu versions
Gerd Hoffmann [Wed, 17 Nov 2010 11:06:44 +0000 (12:06 +0100)]
vgabios update: handle compatibility with older qemu versions

As pointed out by avi the vgabios update is guest-visible and thus has
migration implications.

One change is that the vga has a valid pci rom bar now.  We already have
a pci bus property to enable/disable the rom bar and we'll load the bios
via fw_cfg as fallback for the no-rom-bar case.  So we just have to add
compat properties to handle this case.

A second change is that the magic bochs lfb @ 0xe0000000 is gone.  When
live-migrating a guest from a older qemu version it might be using the
lfb though, so we have to keep it for the old machine types.  The patch
enables the bochs lfb in case we don't have the pci rom bar enabled
(i.e. we are in 0.13+older compat mode).

This patch depends on these patches which add (and use) the pc-0.13
machine type:
  http://patchwork.ozlabs.org/patch/70797/
  http://patchwork.ozlabs.org/patch/70798/

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: avi@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agopcnet: Do not receive external frames in loopback mode
Jan Kiszka [Tue, 19 Oct 2010 15:03:24 +0000 (17:03 +0200)]
pcnet: Do not receive external frames in loopback mode

While not explicitly stated in the spec, it was observed on real systems
that enabling loopback testing on the pcnet controller disables
reception of external frames. And some legacy software relies on it, so
provide this behavior.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agopiix4 acpi: convert io BAR to type-safe ioport callbacks
Avi Kivity [Wed, 17 Nov 2010 09:50:10 +0000 (11:50 +0200)]
piix4 acpi: convert io BAR to type-safe ioport callbacks

Acked-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoType-safe ioport callbacks
Avi Kivity [Wed, 17 Nov 2010 09:50:09 +0000 (11:50 +0200)]
Type-safe ioport callbacks

The current ioport callbacks are not type-safe, in that they accept an "opaque"
pointer as an argument whose type must match the argument to the registration
function; this is not checked by the compiler.

This patch adds an alternative that is type-safe.  Instead of an opaque
argument, both registation and the callback use a new IOPort type.  The
callback then uses container_of() to access its main structures.

Currently the old and new methods exist side by side; once the old way is gone,
we can also save a bunch of memory since the new method requires one pointer
per ioport instead of 6.

Acked-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agotrace: Trace vm_start()/vm_stop()
Stefan Hajnoczi [Tue, 16 Nov 2010 12:20:25 +0000 (12:20 +0000)]
trace: Trace vm_start()/vm_stop()

VM state change notifications are invoked from vm_start()/vm_stop().
Trace these state changes so we can reason about the state of the VM
from trace output.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovirtfs: enable MSI-X
Gerd Hoffmann [Thu, 11 Nov 2010 11:59:26 +0000 (12:59 +0100)]
virtfs: enable MSI-X

This patch enables MSI-X for virtfs-9p-pci.  It also adds a
compat property to pc-0.13 which turns it of there to stay
compatible to 0.13-stable.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agopc: add 0.13 pc machine type
Gerd Hoffmann [Thu, 11 Nov 2010 11:59:25 +0000 (12:59 +0100)]
pc: add 0.13 pc machine type

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agotrace: Use fprintf_function (format checking)
Stefan Weil [Mon, 15 Nov 2010 20:17:06 +0000 (21:17 +0100)]
trace: Use fprintf_function (format checking)

fprintf_function adds format checking with GCC_FMT_ATTR.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoslirp: Remove unused code for bad sprintf
Stefan Weil [Mon, 15 Nov 2010 20:15:26 +0000 (21:15 +0100)]
slirp: Remove unused code for bad sprintf

Neither DECLARE_SPRINTF nor BAD_SPRINTF are needed for QEMU.

QEMU won't support systems with missing or bad declarations
for sprintf. The unused code was detected while looking for
functions with missing format checking. Instead of adding
GCC_FMT_ATTR, the unused code was removed.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agopc: disable the BOCHS BIOS panic port
Bernhard Kohl [Tue, 16 Nov 2010 12:28:37 +0000 (13:28 +0100)]
pc: disable the BOCHS BIOS panic port

We have an OS which writes to port 0x400 when probing for special hardware.
This causes an exit of the VM. With SeaBIOS this port isn't used anyway.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-By: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agooptionrom: fix bugs in signrom.sh
Avi Kivity [Tue, 16 Nov 2010 14:33:17 +0000 (16:33 +0200)]
optionrom: fix bugs in signrom.sh

signrom.sh has multiple bugs:

- the last byte is considered when calculating the existing checksum, but not
  when computing the correction
- apprently the 'expr' expression overflows and produces incorrect results with
  larger roms
- if the checksum happened to be zero, we calculated the correction byte to be
  256

Instead of rewriting this in half a line of python, this patch fixes the bugs.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoMakefile: Fix check dependency breakage
Luiz Capitulino [Fri, 12 Nov 2010 14:55:46 +0000 (12:55 -0200)]
Makefile: Fix check dependency breakage

Commit b152aa84d52882bb1846485a89baf13aa07c86bc broke the unit-tests
build, fix it.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoblock migration: do not submit multiple AIOs for same sector
Marcelo Tosatti [Mon, 8 Nov 2010 19:02:56 +0000 (17:02 -0200)]
block migration: do not submit multiple AIOs for same sector

Block migration can submit multiple AIO reads for the same sector/chunk, but
completion of such reads can happen out of order:

migration               guest
- get_dirty(N)
- aio_read(N)
- clear_dirty(N)
                        write(N)
                        set_dirty(N)
- get_dirty(N)
- aio_read(N)

If the first aio_read completes after the second, stale data will be
migrated to the destination.

Fix by not allowing multiple AIOs inflight for the same sector.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoblock: set sector dirty on AIO write completion
Marcelo Tosatti [Mon, 8 Nov 2010 19:02:55 +0000 (17:02 -0200)]
block: set sector dirty on AIO write completion

Sectors are marked dirty in the bitmap on AIO submission. This is wrong
since data has not reached storage.

Set a given sector as dirty in the dirty bitmap on AIO completion, so that
reading a sector marked as dirty is guaranteed to return uptodate data.

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoblock: fix shift in dirty bitmap calculation
Marcelo Tosatti [Mon, 8 Nov 2010 19:02:54 +0000 (17:02 -0200)]
block: fix shift in dirty bitmap calculation

Otherwise upper 32 bits of bitmap entries are not correctly calculated.

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoAdd support for generating a systemtap tapset static probes
Daniel P. Berrange [Fri, 12 Nov 2010 13:20:25 +0000 (13:20 +0000)]
Add support for generating a systemtap tapset static probes

This introduces generation of a qemu.stp/qemu-system-XXX.stp
files which provides tapsets with friendly names for static
probes & their arguments. Instead of

    probe process("qemu").mark("qemu_malloc") {
        printf("Malloc %d %p\n", $arg1, $arg2);
    }

It is now possible todo

    probe qemu.system.i386.qemu_malloc {
        printf("Malloc %d %p\n", size, ptr);
    }

There is one tapset defined per target arch, for both
user and system emulators.

* Makefile.target: Generate stp files for each target
* tracetool: Support for generating systemtap tapsets
* configure: Check for whether systemtap is available
  with the DTrace backend

Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoAdd a DTrace tracing backend targetted for SystemTAP compatability
Daniel P. Berrange [Fri, 12 Nov 2010 13:20:24 +0000 (13:20 +0000)]
Add a DTrace tracing backend targetted for SystemTAP compatability

This introduces a new tracing backend that targets the SystemTAP
implementation of DTrace userspace tracing. The core functionality
should be applicable and standard across any DTrace implementation
on Solaris, OS-X, *BSD, but the Makefile rules will likely need
some small additional changes to cope with OS specific build
requirements.

This backend builds a little differently from the other tracing
backends. Specifically there is no 'trace.c' file, because the
'dtrace' command line tool generates a '.o' file directly from
the dtrace probe definition file. The probe definition is usually
named with a '.d' extension but QEMU uses '.d' files for its
external makefile dependancy tracking, so this uses '.dtrace' as
the extension for the probe definition file.

The 'tracetool' program gains the ability to generate a trace.h
file for DTrace, and also to generate the trace.d file containing
the dtrace probe definition.

Example usage of a dtrace probe in systemtap looks like:

  probe process("qemu").mark("qemu_malloc") {
    printf("Malloc %d %p\n", $arg1, $arg2);
  }

* .gitignore: Ignore trace-dtrace.*
* Makefile: Extra rules for generating DTrace files
* Makefile.obj: Don't build trace.o for DTrace, use
  trace-dtrace.o generated by 'dtrace' instead
* tracetool: Support for generating DTrace data files

Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoRevert "Add a DTrace tracing backend targetted for SystemTAP compatability"
Anthony Liguori [Thu, 18 Nov 2010 00:06:06 +0000 (18:06 -0600)]
Revert "Add a DTrace tracing backend targetted for SystemTAP compatability"

This reverts commit 4addb1127f6327c7ebcbd150a6b589e7677adc92.

13 years agoRevert "Add support for generating a systemtap tapset static probes"
Anthony Liguori [Thu, 18 Nov 2010 00:05:58 +0000 (18:05 -0600)]
Revert "Add support for generating a systemtap tapset static probes"

This reverts commit 2834c3e0140c3b0ed4422909dfa0607b7213d95d.

Conflicts:

Makefile.target

13 years agoaudio: Only use audio timer when necessary
malc [Thu, 18 Nov 2010 11:30:12 +0000 (14:30 +0300)]
audio: Only use audio timer when necessary

Originally proposed by Gerd Hoffmann.

Signed-off-by: malc <av1474@comtv.ru>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agopc: Fix e820 fw_cfg for big endian
Alex Williamson [Mon, 8 Nov 2010 03:57:00 +0000 (20:57 -0700)]
pc: Fix e820 fw_cfg for big endian

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agopc: e820 qemu_cfg tables need to be packed
Alex Williamson [Fri, 5 Nov 2010 21:40:38 +0000 (15:40 -0600)]
pc: e820 qemu_cfg tables need to be packed

We can't let the compiler define the alignment for qemu_cfg data.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoFix compilation failure with simple trace when srcdir==objdir
Peter Maydell [Tue, 16 Nov 2010 20:07:07 +0000 (20:07 +0000)]
Fix compilation failure with simple trace when srcdir==objdir

Fix a makefile error that meant that qemu would not compile if
the source and object directories were the same.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoDelete IOHandlers after potentially running them
Stefan Hajnoczi [Wed, 3 Nov 2010 14:29:44 +0000 (14:29 +0000)]
Delete IOHandlers after potentially running them

Since commit 4bed9837309e58d208183f81d8344996744292cf an .fd_read()
handler that deletes its IOHandler is exposed to .fd_write() being
called on the deleted IOHandler.

This patch fixes deletion so that .fd_read() and .fd_write() are never
called on an IOHandler that is marked for deletion.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agousb-linux: Get the active configuration from sysfs rather then asking the dev
Hans de Goede [Wed, 10 Nov 2010 09:06:25 +0000 (10:06 +0100)]
usb-linux: Get the active configuration from sysfs rather then asking the dev

Some devices seem to choke on receiving a USB_REQ_GET_CONFIGURATION ctrl msg
(witnessed with a digital picture frame usb id 1908:1320).
When usb_fs_type == USB_FS_SYS, the active configuration can be read directly
from sysfs, which allows using this device through qemu's usb redirection.
More in general it seems a good idea to not send needless control msg's to
devices, esp. as the code in question is called every time a set_interface
is done. Which happens multiple times during virtual machine startup, and
when device drivers are activating the usb device.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agousb-linux: introduce a usb_linux_get_configuration function
Hans de Goede [Wed, 10 Nov 2010 09:06:24 +0000 (10:06 +0100)]
usb-linux: introduce a usb_linux_get_configuration function

The next patch in this series introduces multiple ways to get the
configuration dependent upon usb_fs_type, it is cleaner to put this
into its own function.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agousb-linux: Store devpath into USBHostDevice when usb_fs_type == USB_FS_SYS
Hans de Goede [Wed, 10 Nov 2010 09:06:23 +0000 (10:06 +0100)]
usb-linux: Store devpath into USBHostDevice when usb_fs_type == USB_FS_SYS

This allows us to recreate the sysfspath used during scanning later
(which will be used in a later patch in this series).

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoAdd missing braces
Jes Sorensen [Thu, 11 Nov 2010 15:10:04 +0000 (16:10 +0100)]
Add missing braces

This patch adds missing braces around if/else statements that call
macros which are likely to result in errors if the macro is
changed. It also makes the code comply better with CODING_STYLE.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoOut off array access in usb-net
Gleb Natapov [Tue, 9 Nov 2010 07:36:53 +0000 (09:36 +0200)]
Out off array access in usb-net

Properly check array bounds before accessing array element.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoMerge remote branch 'spice/bugfix.2' into staging
Anthony Liguori [Tue, 16 Nov 2010 20:11:05 +0000 (14:11 -0600)]
Merge remote branch 'spice/bugfix.2' into staging

13 years agoAdd support for generating a systemtap tapset static probes
Daniel P. Berrange [Mon, 8 Nov 2010 19:33:08 +0000 (19:33 +0000)]
Add support for generating a systemtap tapset static probes

This introduces generation of a qemu.stp/qemu-system-XXX.stp
files which provides tapsets with friendly names for static
probes & their arguments. Instead of

    probe process("qemu").mark("qemu_malloc") {
        printf("Malloc %d %p\n", $arg1, $arg2);
    }

It is now possible todo

    probe qemu.system.i386.qemu_malloc {
        printf("Malloc %d %p\n", size, ptr);
    }

There is one tapset defined per target arch.

* Makefile: Generate a qemu.stp file for systemtap
* tracetool: Support for generating systemtap tapsets

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoAdd a DTrace tracing backend targetted for SystemTAP compatability
Daniel P. Berrange [Mon, 8 Nov 2010 19:33:07 +0000 (19:33 +0000)]
Add a DTrace tracing backend targetted for SystemTAP compatability

This introduces a new tracing backend that targets the SystemTAP
implementation of DTrace userspace tracing. The core functionality
should be applicable and standard across any DTrace implementation
on Solaris, OS-X, *BSD, but the Makefile rules will likely need
some small additional changes to cope with OS specific build
requirements.

This backend builds a little differently from the other tracing
backends. Specifically there is no 'trace.c' file, because the
'dtrace' command line tool generates a '.o' file directly from
the dtrace probe definition file. The probe definition is usually
named with a '.d' extension but QEMU uses '.d' files for its
external makefile dependancy tracking, so this uses '.dtrace' as
the extension for the probe definition file.

The 'tracetool' program gains the ability to generate a trace.h
file for DTrace, and also to generate the trace.d file containing
the dtrace probe definition.

Example usage of a dtrace probe in systemtap looks like:

  probe process("qemu").mark("qemu_malloc") {
    printf("Malloc %d %p\n", $arg1, $arg2);
  }

* .gitignore: Ignore trace-dtrace.*
* Makefile: Extra rules for generating DTrace files
* Makefile.obj: Don't build trace.o for DTrace, use
  trace-dtrace.o generated by 'dtrace' instead
* tracetool: Support for generating DTrace data files

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomultiboot: Prevent loading of x86_64 images
Adam Lackorzynski [Thu, 4 Nov 2010 22:22:15 +0000 (23:22 +0100)]
multiboot: Prevent loading of x86_64 images

A via -kernel supplied x86_64 ELF image is being started in 32bit mode.
Detect and exit if a 64bit image has been supplied.

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoapic: Don't iterate past last used apic
Alex Williamson [Fri, 5 Nov 2010 22:01:29 +0000 (16:01 -0600)]
apic: Don't iterate past last used apic

local_apics are allocated sequentially and never removed, so
we can stop any iterations that go to MAX_APICS as soon as we
hit the first NULL.  Looking at a small guest running a virtio-net
workload with oprofile, this drops apic_get_delivery_bitmask()
from #3 in the profile to down in the noise.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agopci: allow hotplug removal of cold-plugged devices
Michael S. Tsirkin [Fri, 12 Nov 2010 07:21:35 +0000 (16:21 +0900)]
pci: allow hotplug removal of cold-plugged devices

This patch fixes hot unplug of cold plugged devices
(those present at system start), which got broken by
5beb8ad503c88a76f2b8106c3b74b4ce485a60e1 .

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Cam Macdonell <cam@cs.ualberta.ca>
Tested-by: Cam Macdonell <cam@cs.ualberta.ca>
Reported-by: Cam Macdonell <cam@cs.ualberta.ca>.
13 years agoPCI: Bus number from the bridge, not the device
Alex Williamson [Mon, 4 Oct 2010 21:53:11 +0000 (15:53 -0600)]
PCI: Bus number from the bridge, not the device

pcibus_dev_print() was erroneously retrieving the device bus
number from the secondary bus number offset of the device
instead of the bridge above the device.  This ends of landing
in the 2nd byte of the 3rd BAR for devices, which thankfully
is usually zero.

Note: pcibus_get_dev_path() copied this code,
inheriting the same bug.  pcibus_get_dev_path() is used for
ramblock naming, so changing it can effect migration.  However,
I've only seen this byte be non-zero for an assigned device,
which can't migrate anyway, so hopefully we won't run into
any issues.

This patch does not touch pcibus_get_dev_path, as
bus number is guest assigned for nested buses,
so using it for migration is broken anyway.
Fix it properly later.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoe1000: Fix TCP checksum overflow with TSO
Alex Williamson [Fri, 5 Nov 2010 20:52:08 +0000 (14:52 -0600)]
e1000: Fix TCP checksum overflow with TSO

When adding the length to the pseudo header, we're not properly
accounting for overflow.

From: Mark Wu <dwu@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agotap: make set_offload a nop after netdev cleanup
Michael S. Tsirkin [Sun, 31 Oct 2010 17:06:47 +0000 (19:06 +0200)]
tap: make set_offload a nop after netdev cleanup

virtio-net expects set_offload to succeed after
peer cleanup.
Since we don't have an open fd anymore, make it so.
Fixes warning about the failure of offload setting.

Reported-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoAdd support for async page fault to qemu
Gleb Natapov [Sun, 24 Oct 2010 12:27:55 +0000 (14:27 +0200)]
Add support for async page fault to qemu

Add save/restore of MSR for migration and cpuid bit.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agotap: clear vhost_net backend on cleanup
Michael S. Tsirkin [Wed, 27 Oct 2010 18:03:43 +0000 (20:03 +0200)]
tap: clear vhost_net backend on cleanup

Frontends calling tap_get_vhost_net get an invalid pointer after the
peer backend has been deleted. Jason Wang <jasowang@redhat.com> reports
this leading to a crash in ack_features when we remove the vhost-net
bakend of a virtio nic.

The fix is simply to clear the backend pointer.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agomore stdvga cleanups.
Gerd Hoffmann [Fri, 15 Oct 2010 09:45:13 +0000 (11:45 +0200)]
more stdvga cleanups.

video.x is gone now.  It was the only user of the
vga bios_offset + bios_size logic.  Zap it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agoswitch vmware_vga to pci vgabios
Gerd Hoffmann [Thu, 6 May 2010 09:14:11 +0000 (11:14 +0200)]
switch vmware_vga to pci vgabios

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agoswitch stdvga to pci vgabios
Gerd Hoffmann [Thu, 6 May 2010 09:13:11 +0000 (11:13 +0200)]
switch stdvga to pci vgabios

Make stdvga provide the new vgabios binary (with pcibios support)
using the PCI option rom bar.  Seabios will happily load it from
there.  The new vga bios will also lookup the framebuffer address
in pci config space, so the magic bochs lfb @ 0xe0000000 is not
needed any more -> zap it.

Without the patch:

  # dmesg | grep framebuffer
  vesafb: framebuffer at 0xe0000000, mapped to 0xf7e80000, using 1875k, total 8192k
  # lspci -vs2
  00:02.0 VGA compatible controller: Technical Corp. Device 1111 (prog-if 00 [VGA controller])
Subsystem: Qumranet, Inc. Device 1100
Physical Slot: 2
Flags: fast devsel
Memory at f0000000 (32-bit, prefetchable) [size=8M]
Expansion ROM at <unassigned> [disabled]

With patch applied:

  # dmesg | grep framebuffer
  vesafb: framebuffer at 0xf0000000, mapped to 0xf7e80000, using 1875k, total 8192k
  # lspci -vs2
  00:02.0 VGA compatible controller: Technical Corp. Device 1111 (prog-if 00 [VGA controller])
Subsystem: Qumranet, Inc. Device 1100
Physical Slot: 2
Flags: fast devsel
Memory at f0000000 (32-bit, prefetchable) [size=8M]
Expansion ROM at f0800000 [disabled] [size=64K]

cheers,
  Gerd

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agoAdd new vgabios binaries to blobs list.
Gerd Hoffmann [Mon, 23 Aug 2010 10:10:46 +0000 (12:10 +0200)]
Add new vgabios binaries to blobs list.

aliguori: update VGA BIOS

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoadd copyright to spiceaudio
Gerd Hoffmann [Thu, 11 Nov 2010 12:07:52 +0000 (13:07 +0100)]
add copyright to spiceaudio

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
14 years agospice: add audio
Gerd Hoffmann [Tue, 9 Nov 2010 16:29:46 +0000 (17:29 +0100)]
spice: add audio

Add support for the spice audio interface.  With this patch applied
audio can be forwarded over the network from/to the spice client.  Both
recording and playback is supported.

The driver is first in the driver list, but the can_be_default flag is
set only in case spice is active.  So if you have the spice protocol
enabled the spice audio driver is the default one, otherwise whatever
comes first after spice in the list.  Overriding the default using
QEMU_AUDIO_DRV works in any case.

[ v2: audio codestyle: add spaces before open parenthesis ]
[ v2: add const to silence array ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: malc <av1474@comtv.ru>
Signed-off-by: malc <av1474@comtv.ru>
14 years agointel-hda: fix codec addressing.
Gerd Hoffmann [Tue, 9 Nov 2010 16:28:38 +0000 (17:28 +0100)]
intel-hda: fix codec addressing.

The HDA bus supports up to 15 codecs, with addresses 0 ... 14.
We get that wrong in two places:

 * When handing out addresses we accept address 15 as valid.
 * The bitmasks for two registers (WAKEEN and STATESTS) don't
   have bit 14 set.

This patch fixes it.

[ v2: codestyle: add braces ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
14 years agoRevert "intel-hda: fix codec addressing."
malc [Tue, 9 Nov 2010 16:14:15 +0000 (19:14 +0300)]
Revert "intel-hda: fix codec addressing."

Misses braces

This reverts commit acc086837e49b44f15eff6007bb1726844df7aec.

14 years agointel-hda: fix codec addressing.
Gerd Hoffmann [Tue, 9 Nov 2010 10:47:49 +0000 (11:47 +0100)]
intel-hda: fix codec addressing.

The HDA bus supports up to 15 codecs, with addresses 0 ... 14.
We get that wrong in two places:

 * When handing out addresses we accept address 15 as valid.
 * The bitmasks for two registers (WAKEEN and STATESTS) don't
   have bit 14 set.

This patch fixes it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
14 years agointel-hda: add msi support
Gerd Hoffmann [Tue, 9 Nov 2010 10:47:48 +0000 (11:47 +0100)]
intel-hda: add msi support

This patch adds MSI support to the intel hda audio driver.  It is
enabled by default, use '-device intel-hda,msi=0' to disable it.

[ v2: codestyle: add braces ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
14 years agointel-hda: update irq status on WAKEEN changes.
Gerd Hoffmann [Tue, 9 Nov 2010 10:47:47 +0000 (11:47 +0100)]
intel-hda: update irq status on WAKEEN changes.

When the guest updates the WAKEEN register we
must re-calculate the IRQ status.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
14 years agointel-hda: Honor WAKEEN bits.
François Revol [Tue, 9 Nov 2010 10:47:46 +0000 (11:47 +0100)]
intel-hda: Honor WAKEEN bits.

HDA: Honor WAKEEN bits when deciding to raise an interrupt on codec
status change.  This prevents an interrupt storm with the Haiku HDA
driver which does not handle codec status changes in the irq handler.

Signed-off-by: François Revol <revol@free.fr>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
14 years agohda-audio: exit cleanup
Gerd Hoffmann [Tue, 9 Nov 2010 10:47:45 +0000 (11:47 +0100)]
hda-audio: exit cleanup

Add exit callback to the driver.  Unregister the sound card properly
on exit.

[ v2: codestyle: add braces ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
14 years agointel-hda: exit cleanup
Gerd Hoffmann [Tue, 9 Nov 2010 10:47:44 +0000 (11:47 +0100)]
intel-hda: exit cleanup

Add pci exit callback for the intel-hda device and cleanup properly.
Also add an exit callback to the HDA bus implementation and make sure
it is called on qdev_free().

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
14 years agoFix win32 build
Blue Swirl [Sun, 7 Nov 2010 15:10:40 +0000 (15:10 +0000)]
Fix win32 build

Fix a return value change missed by
205ef7961f781496366e0a93a4ec621ad3724bd7.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoscsi-disk: Fix immediate failure of bdrv_aio_*
Kevin Wolf [Wed, 27 Oct 2010 11:15:27 +0000 (13:15 +0200)]
scsi-disk: Fix immediate failure of bdrv_aio_*

Fix scsi-disk to use the usual completion paths that involve rerror/werror
handling instead of directly completing the requests in cases where
bdrv_aio_readv/writev returns NULL.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agovirtio-blk: Handle immediate flush failure properly
Kevin Wolf [Wed, 27 Oct 2010 11:10:15 +0000 (13:10 +0200)]
virtio-blk: Handle immediate flush failure properly

Fix virtio-blk to use the usual completion path that involves werror handling
instead of directly completing the request in cases where bdrv_aio_flush
returns NULL.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoide: Handle immediate bdrv_aio_flush failure
Kevin Wolf [Wed, 27 Oct 2010 11:04:15 +0000 (13:04 +0200)]
ide: Handle immediate bdrv_aio_flush failure

If bdrv_aio_flush returns NULL, this should be treated as an error.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoblock: avoid a warning on 64 bit hosts with long as int64_t
Blue Swirl [Sat, 30 Oct 2010 16:46:27 +0000 (16:46 +0000)]
block: avoid a warning on 64 bit hosts with long as int64_t

When building on a 64 bit host which uses 'long' for int64_t,
GCC emits a warning:
  CC    block/blkverify.o
/src/qemu/block/blkverify.c: In function `blkverify_verify_readv':
/src/qemu/block/blkverify.c:304: warning: long long int format, long
unsigned int arg (arg 3)

Rework a77cffe7e916f4dd28f2048982ea2e0d98143b11 to avoid the warning.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoqcow2: Invalidate cache after failed read
Kevin Wolf [Thu, 28 Oct 2010 14:16:00 +0000 (16:16 +0200)]
qcow2: Invalidate cache after failed read

The cache content may be destroyed after a failed read, better not use it any
more.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
14 years agovpc: Implement bdrv_flush
Kevin Wolf [Fri, 22 Oct 2010 14:17:57 +0000 (16:17 +0200)]
vpc: Implement bdrv_flush

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoscsi-disk: Implement werror for flushes
Kevin Wolf [Mon, 25 Oct 2010 14:40:17 +0000 (16:40 +0200)]
scsi-disk: Implement werror for flushes

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
14 years agoscsi-disk: Complete failed requests in scsi_disk_emulate_command
Kevin Wolf [Mon, 25 Oct 2010 10:43:22 +0000 (12:43 +0200)]
scsi-disk: Complete failed requests in scsi_disk_emulate_command

This pulls the request completion for error cases from the caller to
scsi_disk_emulate_command. This should not change semantics, but allows to
reuse scsi_handle_write_error() for flushes in the next patch.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
14 years agoblock: Allow bdrv_flush to return errors
Kevin Wolf [Thu, 21 Oct 2010 14:43:43 +0000 (16:43 +0200)]
block: Allow bdrv_flush to return errors

This changes bdrv_flush to return 0 on success and -errno in case of failure.
It's a requirement for implementing proper error handle in users of bdrv_flush.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
14 years agoscsi-disk: Implement rerror option
Kevin Wolf [Mon, 25 Oct 2010 12:52:21 +0000 (14:52 +0200)]
scsi-disk: Implement rerror option

This implements the rerror option for SCSI disks.

It also includes minor changes to the write path where the same code is used
that was criticized in the review for the changes to the read path required for
rerror support.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
14 years agoFold send_all() wrapper unix_write() into one function
Jes Sorensen [Mon, 1 Nov 2010 19:02:23 +0000 (20:02 +0100)]
Fold send_all() wrapper unix_write() into one function

The current send_all() wrapper for POSIX calls does nothing but call
unix_write(). Merge them to simplify the code.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoRemove obsolete 'f' double parameter type
Jes Sorensen [Thu, 21 Oct 2010 15:15:49 +0000 (17:15 +0200)]
Remove obsolete 'f' double parameter type

'f' double is no longer used, and we should be using floating point
variables to store byte sizes. Remove it.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoSwitch migrate_set_speed() to take an 'o' argument rather than a float.
Jes Sorensen [Thu, 21 Oct 2010 15:15:48 +0000 (17:15 +0200)]
Switch migrate_set_speed() to take an 'o' argument rather than a float.

Clarify default value of MB in migration speed argument in monitor, if
no suffix is specified. This differ from previous default of bytes,
but is consistent with the rest of the places where we accept a size
argument.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoAdd support for 'o' octet (bytes) format as monitor parameter.
Jes Sorensen [Thu, 21 Oct 2010 15:15:47 +0000 (17:15 +0200)]
Add support for 'o' octet (bytes) format as monitor parameter.

Octet format relies on strtosz which supports K/k, M/m, G/g, T/t
suffixes and unit support for humans, like 1.3G

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoIntroduce strtosz() library function to convert a string to a byte count.
Jes Sorensen [Thu, 21 Oct 2010 15:15:46 +0000 (17:15 +0200)]
Introduce strtosz() library function to convert a string to a byte count.

strtosz() returns -1 on error. It now supports human unit formats in
eg. 1.0G, with better error handling.

The following suffixes are supported:
B/b = bytes
K/k = KB
M/m = MB
G/g = GB
T/t = TB

This patch changes -numa and -m input to use strtosz().

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agospice-display: replace private lock with qemu mutex.
Gerd Hoffmann [Thu, 14 Oct 2010 14:55:01 +0000 (16:55 +0200)]
spice-display: replace private lock with qemu mutex.

qemu_spice_create_update() must aquire the global qemu mutex to
make sure DisplayState doesn't change while we are accessing it.

Once this is in place the private lock is pretty pointless as
everything it protects is covered by the global qemu mutex now.
Drop it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
14 years agospice-core: fix warning when building with spice < 0.6.0
Gerd Hoffmann [Tue, 2 Nov 2010 11:21:50 +0000 (12:21 +0100)]
spice-core: fix warning when building with spice < 0.6.0

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
14 years agospice-core: fix watching for write events
Hans de Goede [Fri, 15 Oct 2010 07:47:53 +0000 (09:47 +0200)]
spice-core: fix watching for write events

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
14 years agointel-hda: documentation update
Gerd Hoffmann [Mon, 1 Nov 2010 15:57:48 +0000 (16:57 +0100)]
intel-hda: documentation update

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>