Kevin Wolf [Fri, 26 Nov 2010 15:44:53 +0000 (16:44 +0100)]
ide: Ignore double DMA transfer starts/stops
You can only start a DMA transfer if it's not running yet, and you can only
cancel it if it's running.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Kevin Wolf [Fri, 26 Nov 2010 15:47:42 +0000 (16:47 +0100)]
ide: Set bus master inactive on error
BMIDEA in the status register must be cleared on error. This makes FreeBSD
respond (more) correctly to I/O errors.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Kevin Wolf [Fri, 26 Nov 2010 15:31:37 +0000 (16:31 +0100)]
ide: Factor ide_dma_set_inactive out
Several places that stop a DMA transfer duplicate this code. Factor it out into
a common function.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Christoph Hellwig [Fri, 26 Nov 2010 13:32:34 +0000 (14:32 +0100)]
raw-posix: raw_pwrite comment fixup
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Hannes Reinecke [Wed, 24 Nov 2010 11:16:00 +0000 (12:16 +0100)]
scsi-disk: Remove duplicate cdb parsing
We parse the CDB twice, which is completely unnecessary.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Hannes Reinecke [Wed, 24 Nov 2010 11:15:59 +0000 (12:15 +0100)]
scsi: Move sense handling into the driver
The current sense handling in scsi-bus is only used by the
scsi-disk driver; the scsi-generic driver is using its own.
So we should move the current sense handling into the
scsi-disk driver.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Hannes Reinecke [Wed, 24 Nov 2010 11:15:58 +0000 (12:15 +0100)]
scsi: INQUIRY VPD fixes
We should announce and support the block device characterics page
only on block devices, not on CDROMs. And the VPD page 0x83 has
an off-by-one error.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Hannes Reinecke [Wed, 24 Nov 2010 11:15:57 +0000 (12:15 +0100)]
scsi: Return SAM status codes
Traditionally, the linux stack is using SCSI status codes
which are shifted by one as compared to those defined in SAM.
A SCSI emulation should naturally return the SAM defined codes,
not the linux ones.
So to avoid any confusion this patch modifies the existing
definitions to match those found in SAM and removes any
(now obsolete) byte-shift from the returned status codes.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Hannes Reinecke [Wed, 24 Nov 2010 11:15:56 +0000 (12:15 +0100)]
scsi: Increase the number of possible devices
The SCSI parallel interface has a limit of 8 devices, but
not the SCSI stack in general. So we should be removing the
hard-coded limit and use MAX_SCSI_DEVS instead.
And we only need to scan those devices which are allocated
by the bus.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Kevin Wolf [Tue, 16 Nov 2010 17:55:01 +0000 (18:55 +0100)]
block: Remove unused s->hd in various drivers
All drivers use bs->file instead of s->hd for quite a while now, so it's time
to remove s->hd.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Stefano Stabellini [Wed, 24 Nov 2010 13:08:03 +0000 (13:08 +0000)]
qemu and qemu-xen: support empty write barriers in xen_disk
This patch can be applied to both qemu-xen and qemu and adds support
for empty write barriers to xen_disk.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Avi Kivity [Sun, 21 Nov 2010 16:29:52 +0000 (18:29 +0200)]
ide: convert bmdma address ioport to ioport_register()
cmd646, via compile tested, pci lightly boot tested.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Marcelo Tosatti [Fri, 12 Nov 2010 18:07:50 +0000 (16:07 -0200)]
block migration: do not submit multiple AIOs for same sector (v2)
An old version of this patch was applied to master, so this contains the
differences between v1 and v2.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Ryan Harper [Fri, 12 Nov 2010 17:07:13 +0000 (11:07 -0600)]
Implement drive_del to decouple block removal from device removal
Currently device hotplug removal code is tied to device removal via
ACPI. All pci devices that are removable via device_del() require the
guest to respond to the request. In some cases the guest may not
respond leaving the device still accessible to the guest. The management
layer doesn't currently have a reliable way to revoke access to host
resource in the presence of an uncooperative guest.
This patch implements a new monitor command, drive_del, which
provides an explicit command to revoke access to a host block device.
drive_del first quiesces the block device (qemu_aio_flush;
bdrv_flush() and bdrv_close()). This prevents further IO from being
submitted against the host device. Finally, drive_del cleans up
pointers between the drive object (host resource) and the device
object (guest resource).
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Stefan Hajnoczi [Fri, 12 Nov 2010 09:57:11 +0000 (09:57 +0000)]
scsi-disk: Move active request asserts
SCSI read/write requests should not be re-issued before the current
fragment of I/O completes. There are asserts in scsi-disk.c that guard
this constraint but they trigger on SPARC Linux 2.4. It turns out that
the asserts are too early in the code path and don't allow for read
requests to terminate.
Only the read assert needs to be moved but move the write assert too for
consistency.
Reported-by: Nigel Horne <njh@bandsman.co.uk>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Anthony Liguori [Tue, 16 Nov 2010 20:11:05 +0000 (14:11 -0600)]
Merge remote branch 'spice/bugfix.2' into staging
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>
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>
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>
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>
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>.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
malc [Tue, 9 Nov 2010 16:14:15 +0000 (19:14 +0300)]
Revert "intel-hda: fix codec addressing."
Misses braces
This reverts commit
acc086837e49b44f15eff6007bb1726844df7aec.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Blue Swirl [Mon, 1 Nov 2010 18:09:38 +0000 (18:09 +0000)]
Fix out of tree build
df2943ba3c73ca21dbda063f15fa3e80064af864 broke out of tree build.
Fix breakage by adding $(SRC_PATH).
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Anthony Liguori [Mon, 1 Nov 2010 18:02:56 +0000 (13:02 -0500)]
Merge remote branch 'spice/config.2' into staging
Anthony Liguori [Mon, 1 Nov 2010 15:33:45 +0000 (10:33 -0500)]
Merge remote branch 'mst/for_anthony' into staging
malc [Mon, 1 Nov 2010 14:44:23 +0000 (17:44 +0300)]
hda-audio: Zap tabs
Signed-off-by: malc <av1474@comtv.ru>
Gerd Hoffmann [Mon, 1 Nov 2010 12:05:32 +0000 (13:05 +0100)]
Add Intel HD Audio support to qemu.
This patch adds three devices to qemu:
intel-hda
Intel HD Audio Controller, the PCI device. Provides a HDA bus.
Emulates ICH6 at the moment. Adding a ICH9 PCIE
variant shouldn't be hard.
hda-duplex
HDA Codec. Attaches to the HDA bus. Supports 16bit stereo,
rates 16k -> 96k, playback, recording and volume control
(with CONFIG_MIXEMU=y).
hda-output
HDA Codec without recording support. Subset of the hda-duplex
codec. Use this if you don't want your guests access your mic.
Usage: add '-device intel-hda -device hda-duplex' to your command line.
Tested guests:
* Linux works.
* Win7 works.
* DOS (mpxplay) works.
* WinXP doesn't work.
[ v2 changes ]
* Fixed endianess, big endian hosts work now.
* Fixed some emulation bugs.
* Added immediate command emulation.
* Added vmstate support.
* Make it behave like all other sound card drivers:
- can be configured via '--audio-card-list=hda'
- can be added to a VM using '-soundhw hda'
* Code style fixups.
* Zapped guest-triggerable asserts.
* Handle partial reads/writes of audio data correctly.
Cc: malc <av1474@comtv.ru>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
Gerd Hoffmann [Mon, 1 Nov 2010 14:51:54 +0000 (15:51 +0100)]
add VMSTATE_BOOL
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>