Blue Swirl [Wed, 2 Nov 2011 20:52:13 +0000 (20:52 +0000)]
Merge branch 'tci' of git://qemu.weilnetz.de/qemu
* 'tci' of git://qemu.weilnetz.de/qemu:
tcg: Add tcg interpreter to configure / make
tcg: Add tci disassembler
tcg: Add interpreter for bytecode
tcg: Add bytecode generator for tcg interpreter
tcg: Make ARRAY_SIZE(tcg_op_defs) globally available
tcg: TCG targets may define tcg_qemu_tb_exec
Anthony Liguori [Wed, 2 Nov 2011 17:30:00 +0000 (12:30 -0500)]
Merge remote-tracking branch 'aneesh/for-upstream-8' into staging
Anthony Liguori [Wed, 2 Nov 2011 17:28:59 +0000 (12:28 -0500)]
Merge remote-tracking branch 'qemu-kvm-tmp/memory/int128' into staging
Bharata B Rao [Wed, 2 Nov 2011 08:46:08 +0000 (14:16 +0530)]
Fix X86 CPU topology in KVM mode
apic id returned to guest kernel in ebx for cpuid(function=1) depends on
CPUX86State->cpuid_apic_id which gets populated after the cpuid information
is cached in the host kernel. This results in broken CPU topology in guest.
Fix this by setting cpuid_apic_id before cpuid information is passed to
the host kernel. This is done by moving the setting of cpuid_apic_id
to cpu_x86_init() where it will work for both KVM as well as TCG modes.
Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Bharata B Rao <bharata.rao@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Wed, 2 Nov 2011 11:56:14 +0000 (12:56 +0100)]
intel-hda: fix stream search
commit
ba43d28916c4f51c19bd7366089155ce81bee058 introduces a bug:
The stream-not-found case doesn't error out any more, instead the
code silently uses the first stream. Fix it.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Paolo Bonzini [Wed, 2 Nov 2011 12:19:40 +0000 (13:19 +0100)]
virtio-blk: pass full status to the guest
When SCSI passthrough is being used by the guest with virtio-blk, the
guest is not able to detect disk failures. This is because the status
field is expected by the guest driver to include also the msg_status,
host_status and driver_status fields, but the device is only passing
down the SCSI status.
The patch fixes this, and also makes sure that the guest always sees a
CHECK_CONDITION status when there is valid sense data.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Stefan Hajnoczi [Wed, 2 Nov 2011 07:27:15 +0000 (12:57 +0530)]
hw/9pfs: use g_vasprintf() instead of rolling our own
Markus Armbruster <armbru@redhat.com> sent fixes for va_list vararg
issues in v9fs_string_alloc_printf(). It turns out the function
duplicates g_vasprintf() and can therefore be eliminated entirely.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Anthony Liguori [Wed, 2 Nov 2011 00:37:01 +0000 (19:37 -0500)]
Bump version to 1.0-rc0
Look out 1.0, here we come!
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Anthony Liguori [Wed, 2 Nov 2011 00:32:21 +0000 (19:32 -0500)]
Revert "virtio: Add PCI memory BAR in addition to PIO BAR"
This reverts commit
46d95bfec7f9429d5228078219413d7e33496d65.
Anthony Liguori [Tue, 1 Nov 2011 22:29:24 +0000 (17:29 -0500)]
Merge remote-tracking branch 'afaerber/cocoa-for-upstream' into staging
malc [Tue, 1 Nov 2011 22:16:34 +0000 (02:16 +0400)]
Merge branch 'master' of git://git.qemu.org/qemu
malc [Tue, 1 Nov 2011 22:14:19 +0000 (02:14 +0400)]
Merge branch 'master' of git://git.qemu.org/qemu
Richard Henderson [Tue, 1 Nov 2011 22:06:43 +0000 (15:06 -0700)]
tcg: Fix whitespace in tcg-op.h.
Removing the only tabs in the file.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: malc <av1474@comtv.ru>
Richard Henderson [Tue, 1 Nov 2011 22:06:42 +0000 (15:06 -0700)]
tcg: Fix regression in tcg_gen_deposit_i64.
The error being caused by the failure to copy the other half of
the input to the output after having narrowed the deposit operation.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: malc <av1474@comtv.ru>
Jan Kiszka [Fri, 7 Oct 2011 10:27:25 +0000 (12:27 +0200)]
pcnet: Add link state support
Update lnkst on link state changes so that guests can obtain this
information via reading back the LED output pin. Works for Linux but
not for guests that depend on the missing PHY.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jan Kiszka [Mon, 26 Sep 2011 17:01:45 +0000 (19:01 +0200)]
pcnet-pci: Fix PIO word access to PROM
Implement the various IO access widths according to the spec. This
specifically unbreaks word and dword access to the PROM area that is
mapped into IO space. It also drops redundant upper limit checks and
spurious "return void".
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jan Kiszka [Mon, 26 Sep 2011 17:01:44 +0000 (19:01 +0200)]
pcnet: Move BCR defines to header
This moves BCR defines to the common header and immediately makes use of
them to add BCR_APROMWE, replacing the open-coded write check in
pcnet_aprom_writeb.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Wayne Xia [Wed, 12 Oct 2011 03:32:41 +0000 (11:32 +0800)]
Sort the help info shown in monitor at runtime
This patch would try sort the command list in monitor at runtime. As a result,
command help and help info would show a more friendly sorted command list.
For eg:
(qemu)help
acl_add
acl_policy
acl_remove
acl_reset
acl_show
balloon
block_passwd
...
the command list is sorted.
v3: using qsort function to sort the command list.
Tested-by: Wenyi Gao <wenyi@linux.vnet.ibm.com>
Signed-off-by: Wayne Xia <xiawenc@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Avi Kivity [Tue, 27 Sep 2011 14:26:23 +0000 (17:26 +0300)]
event_notifier: move to top-level directory
Has no business in hw/.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Stefan Berger [Wed, 28 Sep 2011 10:41:32 +0000 (06:41 -0400)]
Move filedescriptor parsing code from net.c into qemu_parse_fd()
Move the parsing of a filedescriptor into a common function
qemu_parse_fd() so others can use it as well. Have net.c call this
function.
v2:
- moving qemu_parse_fd into cutils.c
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Peter Maydell [Tue, 1 Nov 2011 18:32:55 +0000 (18:32 +0000)]
configure: Suppress messages from pkg_config probe for check
Suppress confusing messages from pkg_config when probing for
'check' by sending them to /dev/null as we do with other
similar probes.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
David Gibson [Fri, 30 Sep 2011 05:26:16 +0000 (15:26 +1000)]
virtio: Add PCI memory BAR in addition to PIO BAR
Currently, virtio devices are usually presented to the guest as an
emulated PCI device, virtio_pci. Although the actual IO operations
are done through system memory, the configuration of the virtio device
is done through the one PCI IO space BAR that virtio_pci presents.
But PCI IO space (aka PIO) is deprecated for modern PCI devices, and
on some systems with many PCI domains accessing PIO space can be
problematic. For example on the existing PowerVM implementation of
the PAPR spec, PCI PIO access is not supported at all. We're hoping
that our KVM implementation will support PCI PIO (once we support PCI
at all), but it will probably have some irritating limitations.
This patch, therefore, extends the virtio_pci device to have a PCI
memory space (MMIO) BAR as well as the IO BAR. The MMIO BAR contains
exactly the same registers, in exactly the same layout as the existing
PIO BAR.
Because the PIO BAR is still present, existing guest drivers should
still work fine. With this change in place, future guest drivers can
check for an MMIO BAR and use that if present (falling back to PIO
when possible to support older qemu versions).
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
David Gibson [Mon, 31 Oct 2011 06:06:58 +0000 (17:06 +1100)]
usb-uhci: Use PCI DMA stub functions
This updates the usb-uhci device emulation to use the explicit PCI DMA
wrapper to initialize its scatter/gathjer structure. This means this
driver should not need further changes when the sglist interface is
extended to support IOMMUs.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
David Gibson [Mon, 31 Oct 2011 06:06:57 +0000 (17:06 +1100)]
usb-ehci: Use PCI DMA stub functions
This updates the usb-ehci device emulation to use the explicit PCI DMA
wrapper to initialize its scatter/gathjer structure. This means this
driver should not need further changes when the sglist interface is
extended to support IOMMUs.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
David Gibson [Mon, 31 Oct 2011 06:06:56 +0000 (17:06 +1100)]
PCI IDE: Use PCI DMA stub functions
This updates the PCI IDE device emulation to use the explicit PCI DMA
wrapper to initialize its scatter/gathjer structure. This means this
driver should not need further changes when the sglist interface is
extended to support IOMMUs.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
David Gibson [Mon, 31 Oct 2011 06:06:55 +0000 (17:06 +1100)]
intel-hda: Use PCI DMA stub functions
This updates the intel-hda device emulation to use the explicit PCI DMA
functions, instead of directly calling physical memory access functions.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Eduard - Gabriel Munteanu [Mon, 31 Oct 2011 06:06:54 +0000 (17:06 +1100)]
pcnet-pci: Use PCI DMA stub functions
This updates the pcnet-pci device emulation to use the explicit PCI DMA
functions, instead of directly calling physical memory access functions.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Eduard - Gabriel Munteanu [Mon, 31 Oct 2011 06:06:53 +0000 (17:06 +1100)]
lsi53c895a: Use PCI DMA stub functions
This updates the lsi53c895a device emulation to use the explicit PCI DMA
functions, instead of directly calling physical memory access functions.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Eduard - Gabriel Munteanu [Mon, 31 Oct 2011 06:06:52 +0000 (17:06 +1100)]
e1000: Use PCI DMA stub functions
This updates the e1000 device emulation to use the explicit PCI DMA
functions, instead of directly calling physical memory access functions.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Eduard - Gabriel Munteanu [Mon, 31 Oct 2011 06:06:51 +0000 (17:06 +1100)]
es1370: Use PCI DMA stub functions
This updates the es1370 device emulation to use the explicit PCI DMA
functions, instead of directly calling physical memory access functions.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Eduard - Gabriel Munteanu [Mon, 31 Oct 2011 06:06:50 +0000 (17:06 +1100)]
ac97: Use PCI DMA stub functions
This updates the ac97 device emulation to use the explicit PCI DMA
functions, instead of directly calling physical memory access functions.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Eduard - Gabriel Munteanu [Mon, 31 Oct 2011 06:06:49 +0000 (17:06 +1100)]
eepro100: Use PCI DMA stub functions
This updates the eepro100 device emulation to use the explicit PCI DMA
functions, instead of directly calling physical memory access functions.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Eduard - Gabriel Munteanu [Mon, 31 Oct 2011 06:06:48 +0000 (17:06 +1100)]
rtl8139: Use PCI DMA stub functions
This updates the rtl8139 device emulation to use the explicit PCI DMA
functions, instead of directly calling physical memory access functions.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
David Gibson [Mon, 31 Oct 2011 06:06:47 +0000 (17:06 +1100)]
Add stub functions for PCI device models to do PCI DMA
This patch adds functions to pci.[ch] to perform PCI DMA operations.
At present, these are just stubs which perform directly cpu physical
memory accesses. Stubs are included which are analogous to
cpu_physical_memory_{read,write}(), the stX_phys() and ldX_phys()
functions and cpu_physical_memory_{map,unmap}().
In addition, a wrapper around qemu_sglist_init() is provided, which
also takes a PCIDevice *. It's assumed that _init() is the only
sglist function which will need wrapping, the idea being that once we
have IOMMU support whatever IOMMU context handle the wrapper derives
from the PCI device will be stored within the sglist structure for
later use.
Using these stubs, however, distinguishes PCI device DMA transactions from
other accesses to physical memory, which will allow PCI IOMMU support to
be added in one place, rather than updating every PCI driver at that time.
That is, it allows us to update individual PCI drivers to support an IOMMU
without having yet determined the details of how the IOMMU emulation will
operate. This will let us remove the most bitrot-sensitive part of an
IOMMU patch in advance.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
David Gibson [Mon, 31 Oct 2011 06:06:46 +0000 (17:06 +1100)]
Use dma_addr_t type for scatter/gather code
This patch uses the newly created dma_addr_t type throughout the
scatter/gather handling code in dma-helpers.c whenever we need to
represent a dma bus address. This makes a better distinction as to
what is a bus address and what is a cpu physical address. Since we
don't support IOMMUs yet, they can't be very different for now, but
that will change in future, and this preliminary helps clarify what's
going on.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
David Gibson [Mon, 31 Oct 2011 06:06:45 +0000 (17:06 +1100)]
Define DMA address and direction types
As a preliminary to adding more extensive DMA and IOMMU infrastructure
support into qemu, this patch defines a dma_addr_t for storing DMA bus
addresses and a DMADirection enum which describes whether a DMA is
from an external device to main memory or from main memory to an
external device.
For now dma_addr_t is just defined to be target_phys_addr_t, but in
future, we can change this to support machines where we have bus
addresses which don't necessarily have the same format as CPU physical
addresses.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Christophe Fergeau [Mon, 17 Oct 2011 11:37:34 +0000 (13:37 +0200)]
ps2: migrate ledstate
Make the ps2 device track its ledstate so that we can migrate it.
Otherwise it gets lost across migration, and spice-server gets
confused about the actual keyboard state and sends bogus
caps/scroll/num key events. This fixes RH bug #729294
We only need to migrate the state when it is different of the default
one (0).
Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Stefan Weil [Fri, 7 Oct 2011 19:15:20 +0000 (21:15 +0200)]
ui/vnc: Fix use of free() instead of g_free()
Please note that mechlist still uses malloc / strdup / free.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Paolo Bonzini [Fri, 7 Oct 2011 13:59:01 +0000 (15:59 +0200)]
checkpatch: remove rule on non-indented labels
There are 508 non-indented (non-default) labels, and 511 that are
indented. So the rule is debatable at least. Actually, in the
common case of labels at the outermost scope, there is really just
one place where to put the label, so the rule is just wrong IMHO.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Juan Quintela [Tue, 25 Oct 2011 17:18:58 +0000 (19:18 +0200)]
savevm: qemu_fille_buffer() used to return one error for reads of size 0.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Xu He Jie [Thu, 27 Oct 2011 02:15:13 +0000 (10:15 +0800)]
kvm_init didn't set return value after create vm failed
And kvm_ioctl(s, KVM_CREATE_VM, 0)'s return value can be < -1,
so change the check of vmfd at label 'err'.
Signed-off-by: Xu He Jie <xuhj@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Anthony Liguori [Tue, 1 Nov 2011 21:49:17 +0000 (16:49 -0500)]
spapr: fix build
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Blue Swirl [Tue, 1 Nov 2011 20:59:32 +0000 (20:59 +0000)]
Revert "PPC: Fail configure when libfdt is not available"
This reverts commit
f90a9d02401eeeec18a122b61ccccb91244f321c.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Blue Swirl [Tue, 1 Nov 2011 20:57:01 +0000 (20:57 +0000)]
Merge branch 'ppc-next' of git://repo.or.cz/qemu/agraf
* 'ppc-next' of git://repo.or.cz/qemu/agraf: (24 commits)
pseries: Add partial support for PCI
ppc: Alter CPU state to mask out TCG unimplemented instructions as appropriate
pseries: Allow writes to KVM accelerated TCE table
KVM: PPC: Override host vmx/vsx/dfp only when information known
ppc: Fix up usermode only builds
pseries: Correct vmx/dfp handling in both KVM and TCG cases
PPC: Fail configure when libfdt is not available
ppc: Avoid decrementer related kvm exits
PPC: Disable non-440 CPUs for ppcemb target
PPC: Bump qemu-system-ppc to 64-bit physical address space
pseries: Under kvm use guest cpu = host cpu by default
ppc: Add cpu defs for POWER7 revisions 2.1 and 2.3
ppc: First cut implementation of -cpu host
ppc: Remove broken partial PVR matching
pseries: Update SLOF firmware image
pseries: Add device tree properties for VMX/VSX and DFP under kvm
ppc: Generalize the kvmppc_get_clockfreq() function
Set an invalid-bits mask for each SPE instructions
pseries: Update SLOF firmware image
pseries: Use Book3S-HV TCE acceleration capabilities
...
Andreas Färber [Sun, 30 Oct 2011 22:19:54 +0000 (23:19 +0100)]
cocoa: Close sheet after image file selection
If no disk image is specified, the Cocoa frontend displays a modal sheet
to let the user select an image file to boot from.
This sheet is never closed and it permanently obscures the emulator window.
Close it after obtaining the file name in case the user did select a file.
Otherwise we exit immediately, so no need to close then.
Signed-off-by: Juan Pineda <juan@logician.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Andreas Färber [Mon, 31 Oct 2011 18:14:56 +0000 (19:14 +0100)]
vl.c: Guard against GThread double-initialization
GThread-ERROR **: GThread system may only be initialized once.
aborting...
Making the g_thread_init() call in vl.c conditional resolves an abort on
Mac OS X, where coroutine-gthread.c seems to call it before vl.c.
Reported-by: Juan Pineda <juan@logician.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: Daniel P. Berrange <berrange@redhat.com>
Andreas Färber [Sun, 30 Oct 2011 17:08:01 +0000 (18:08 +0100)]
MAINTAINERS: Add Cocoa maintainer
Degrade cocoa.m from Maintained to Odd Fixes.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Anthony Liguori [Tue, 1 Nov 2011 18:09:31 +0000 (13:09 -0500)]
Merge remote-tracking branch 'kraxel/usb.29' into staging
Anthony Liguori [Tue, 1 Nov 2011 18:08:33 +0000 (13:08 -0500)]
Merge remote-tracking branch 'stefanha/tracing' into staging
Anthony Liguori [Tue, 1 Nov 2011 18:06:46 +0000 (13:06 -0500)]
Merge remote-tracking branch 'spice/spice.v46' into staging
Anthony Liguori [Tue, 1 Nov 2011 18:06:17 +0000 (13:06 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Max Filippov [Thu, 27 Oct 2011 22:10:27 +0000 (02:10 +0400)]
opencores_eth: fix RX path: FCS, padding and TL
OpenCores 10/100 Mbps Ethernet MAC specification doesn't clearly state
whether FCS is counted in the RX frame length or not. Looks like it is.
Append zero FCS to the received frames.
Get rid of big static buffer for RX frame padding, optimize it for the
most common MINFL value range.
Set RXD_TL for the long frames only when HUGEN bit is set.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Thu, 27 Oct 2011 07:12:04 +0000 (09:12 +0200)]
migration: flush migration data to disk.
This patch increases robustness when migrating to a file with
two little changes:
(1) Before closing the migration file handle checks if it happens to be
a regular file and if so it issues a fsync. This way the data is
flushed to disk before qemu sends the migration completed event.
(2) It adds error checking. In case either fsync or close syscall
fails pass up the error (and fail migration).
[ v2: return -errno instead of -1 ]
Cc: Juan Quintela <quintela@redhat.com>
Cc: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Thu, 1 Sep 2011 15:42:19 +0000 (17:42 +0200)]
add test-coroutine to checks
There is a "test-coroutine" which isn't in the list.
Add it so "make check" runs it too.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Thu, 1 Sep 2011 15:42:18 +0000 (17:42 +0200)]
add "make check" target
Add some Makefile glue so we have a simple "make check"
to run the unit tests.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Thu, 1 Sep 2011 15:42:17 +0000 (17:42 +0200)]
move checks to separate variable
Create a new CHECKS variable. Put the checks there instead
of adding them to the TOOLS variable.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Thu, 1 Sep 2011 15:42:16 +0000 (17:42 +0200)]
Probe for libcheck by default.
Probe for libcheck and build checks (if found) by default.
Can be explicitly disabled using --disable-check-utests.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Peter Maydell [Sat, 29 Oct 2011 11:58:26 +0000 (12:58 +0100)]
ia64-dis.c: Undefine ABS to avoid clash with glib
Undefine ABS to avoid a clash with the macro that glib.h
helpfully defines for us (and a resulting build failure
on ia64 hosts).
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Luiz Capitulino [Fri, 28 Oct 2011 16:59:52 +0000 (14:59 -0200)]
Fix segfault on migration completion
A simple migration reproduces it:
1. Start the source VM with:
# qemu [...] -S
2. Start the destination VM with:
# qemu <source VM cmd-line> -incoming tcp:0:4444
3. In the source VM:
(qemu) migrate -d tcp:0:4444
4. The source VM will segfault as soon as migration completes (might not
happen in the first try)
What is happening here is that qemu_file_put_notify() can end up closing
's->file' (in which case it's also set to NULL). The call stack is rather
complex, but Eduardo helped tracking it to:
select loop -> migrate_fd_put_notify() -> qemu_file_put_notify() ->
buffered_put_buffer() -> migrate_fd_put_ready() ->
migrate_fd_completed() -> migrate_fd_cleanup().
To be honest, it's not completely clear to me in which cases 's->file'
is not closed (on error maybe)? But I doubt this fix will make anything
worse.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
David Gibson [Fri, 28 Oct 2011 04:26:18 +0000 (15:26 +1100)]
Add qapi related generated files to .gitignore
.gitignore already lists the qapi-generated subdirectory which includes a
number of files generated during build. However, there are some additional
files generated by the qapi build which go in the top level directory.
This patch adds them to .gitignore, removing the irritating noise from
diffs and the like.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Eric Sunshine [Tue, 1 Nov 2011 09:39:49 +0000 (05:39 -0400)]
qemu-barrier: Fix build failure on PowerPC Mac OS X
qemu-barrier.h tests if macro __powerpc__ is defined, however, the
preprocessor on PowerPC Mac OS X defines only __POWERPC__, not
__powerpc__. Resolve by testing instead for qemu-provided _ARCH_PPC.
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Pavel Borzenkov [Mon, 24 Oct 2011 11:31:30 +0000 (07:31 -0400)]
fw_cfg: Use g_file_get_contents instead of multiple fread() calls
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jan Kiszka [Mon, 26 Sep 2011 07:40:39 +0000 (09:40 +0200)]
Simplify cpu_exec_all to tcg_exec_all
After the removal of the non-threaded mode cpu_exec_all is now only used
by TCG. Refactor it accordingly, also dropping its unused return value.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Paolo Bonzini [Fri, 28 Oct 2011 09:52:42 +0000 (10:52 +0100)]
Make cpu_single_env thread-local
Make cpu_single_env thread-local. This fixes a regression
in handling of multi-threaded programs in linux-user mode
(bug 823902).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[Peter Maydell: rename tls_cpu_single_env to cpu_single_env]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Paolo Bonzini [Fri, 28 Oct 2011 09:52:41 +0000 (10:52 +0100)]
darwin-user/main.c: Drop unused cpu_single_env definition
Drop the cpu_single_env definition as it is unused.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Peter Maydell [Fri, 28 Oct 2011 09:52:40 +0000 (10:52 +0100)]
qemu-tls.h: Add abstraction layer for TLS variables
Add an abstraction layer for defining and using thread-local
variables. For the moment this is implemented only for Linux,
which means they can only be used in restricted circumstances.
The abstraction layer allows us to add POSIX and Win32 support
later.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Alex Williamson [Mon, 31 Oct 2011 14:54:09 +0000 (08:54 -0600)]
Error check find_ram_offset
Spotted via code review, we initialize offset to 0 to avoid a
compiler warning, but in the unlikely case that offset is
never set to something else, we should abort instead of return
a value that will almost certainly cause problems.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Fri, 28 Oct 2011 14:13:50 +0000 (16:13 +0200)]
usb-host: fix host close
The whole usb_host_close() function is skipped in case the device is not
in attached state. This is wrong though, only then usb_device_detach()
must be skipped, all other cleanup (especially device reset and closing
the file handle) still needs to be done. There are code paths where
usb_host_close() is called with the device in detached state already.
This fixes usb-host devices not being released and returned to the host
after removing them with device_del.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Roy Tam [Thu, 15 Sep 2011 03:25:47 +0000 (11:25 +0800)]
usb: change VID/PID for usb-hub and usb-msd to prevent conflict
Some USB drivers, for example USBASPI.SYS, will skip different type of
device which has same VID/PID. The following patch helps preventing
usb-msd being skipped by the driver.
Signed-off-by: Roy Tam <roytam@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Stefan Weil [Mon, 31 Oct 2011 20:29:46 +0000 (21:29 +0100)]
Support running QEMU on Valgrind
Valgrind is a tool which can automatically detect many kinds of bugs.
Running QEMU on Valgrind with x86_64 hosts was not possible because
Valgrind aborts when memalign is called with an alignment larger than
1 MiB. QEMU normally uses 2 MiB on Linux x86_64.
Now the alignment is reduced to the page size when QEMU is running on
Valgrind.
v2:
Instead of using the macro RUNNING_ON_VALGRIND from valgrind.h,
the patch now uses a hack from libvirt which tests for the pre-loaded
vgpreload_*.so shared libraries. This avoids the need for valgrind.h.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Andreas Färber [Mon, 31 Oct 2011 23:03:07 +0000 (00:03 +0100)]
MAINTAINERS: Add PReP maintainer
Officially take on maintainership for PReP and upgrade to Odd Fixes.
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: Alexander Graf <agraf@suse.de>
Cc: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Mark Wu [Mon, 31 Oct 2011 03:29:04 +0000 (11:29 +0800)]
trace: Add wildcard trace event support
A basic wildcard matching is supported in both the monitor command
"trace-event" and the events list file. That means you can enable/disable
the events having a common prefix in a batch. For example, virtio-blk trace
events could be enabled using:
trace-event virtio_blk_* on
Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Gerd Hoffmann [Fri, 14 Oct 2011 09:36:43 +0000 (11:36 +0200)]
usb-hub: wakeup on attach
When attaching a new device we must send a wakeup request to the root
hub, otherwise the guest will not notice the new device in case the
usb hub is suspended.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Alon Levy [Tue, 25 Oct 2011 13:39:50 +0000 (15:39 +0200)]
qxl: create slots on post_load in vga state
RHBZ 740547
If we migrate when the device is in vga state the guest
still believes the slots are created, and will cause operations
that reference the slots, causing a "panic: virtual address out of range"
on the first of them. Easy to see by migrating in vga mode with
a driver loaded, for instance windows cmd window in full screen mode,
and then exiting vga mode back to native mode will cause said panic.
Fixed by doing the slot recreation in post_load for vga mode as well.
Note that compat does not require any changes because it creates it's
only slot by a side effect of QXL_IO_SET_MODE.
Signed-off-by: Alon Levy <alevy@redhat.com>
Gerd Hoffmann [Fri, 21 Oct 2011 19:53:54 +0000 (21:53 +0200)]
qxl: make sure we continue to run with a shared buffer
The qxl renderer works only with a shared displaysurface. So better
make sure we actually have one and restore it when needed.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Fri, 21 Oct 2011 13:59:07 +0000 (15:59 +0200)]
qxl: stride fixup
spice uses negative stride value to signal the bitmap is upside down.
The qxl renderer (used for scl, vnc and screenshots) wants a positive
value because it is easier to work with. The positive value is then
stored in the very same variable, which has the drawback that the
upside-down test works only once. Fix by using two variables.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Markus Armbruster [Fri, 28 Oct 2011 15:07:02 +0000 (17:07 +0200)]
acl: Fix use after free in qemu_acl_reset()
Reproducer:
$ MALLOC_PERTURB_=234 qemu-system-x86_64 -vnc :0,acl,sasl [...]
QEMU 0.15.50 monitor - type 'help' for more information
(qemu) acl_add vnc.username fred allow
acl: added rule at position 1
(qemu) acl_reset vnc.username
Segmentation fault (core dumped)
Spotted by Coverity.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Stefan Hajnoczi [Fri, 28 Oct 2011 14:58:26 +0000 (15:58 +0100)]
qapi: fix typos in documentation JSON examples
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Markus Armbruster [Fri, 28 Oct 2011 08:52:25 +0000 (10:52 +0200)]
sysbus: Supply missing va_end()
C99 7.15.1: Each invocation of the va_start and va_copy macros shall
be matched by a corresponding invocation of the va_end macro in the
same function.
Spotted by Coverity. Harmless on the (common) systems where va_end()
does nothing.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Luiz Capitulino [Fri, 14 Oct 2011 18:05:10 +0000 (15:05 -0300)]
net: tap-linux: Fix unhelpful error message
I'm getting:
could not configure /dev/net/tun (tap%d): Operation not permitted
When the ioctl() fails, ifr.ifr_name will most likely not be overwritten.
So we better only use it when ifname contains a string.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Stefan Weil [Wed, 19 Oct 2011 05:07:18 +0000 (07:07 +0200)]
tcg: Add tcg interpreter to configure / make
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Stefan Weil [Wed, 5 Oct 2011 18:03:53 +0000 (20:03 +0200)]
tcg: Add tci disassembler
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Stefan Weil [Tue, 27 Sep 2011 04:30:58 +0000 (06:30 +0200)]
tcg: Add interpreter for bytecode
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Stefan Weil [Wed, 5 Oct 2011 18:03:02 +0000 (20:03 +0200)]
tcg: Add bytecode generator for tcg interpreter
Unlike other tcg target code generators, this one does not generate
machine code for some cpu. It generates machine independent bytecode
which is interpreted later.
This allows running QEMU on any host.
Interpreted bytecode is slower than direct execution of generated
machine code.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Stefan Weil [Thu, 29 Sep 2011 16:33:21 +0000 (18:33 +0200)]
tcg: Make ARRAY_SIZE(tcg_op_defs) globally available
tcg_op_defs was already a global array.
The tci disassembler also needs ARRAY_SIZE(tcg_op_defs),
so add a new global constant with this value.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Stefan Weil [Fri, 30 Sep 2011 19:23:06 +0000 (21:23 +0200)]
tcg: TCG targets may define tcg_qemu_tb_exec
Targets may use a non standard definition of tcg_tb_exec
by defining this macro in their tcg_target.h.
This is used here by ppc. It will be used by the TCG interpreter, too.
Cc: malc <av1474@comtv.ru>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Anthony Liguori [Mon, 31 Oct 2011 20:05:40 +0000 (15:05 -0500)]
Merge remote-tracking branch 'riku/linux-user-for-upstream' into staging
Anthony Liguori [Mon, 31 Oct 2011 16:09:00 +0000 (11:09 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Conflicts:
block/vmdk.c
Anthony Liguori [Mon, 31 Oct 2011 16:06:02 +0000 (11:06 -0500)]
Merge remote-tracking branch 'aneesh/for-upstream-7' into staging
Anthony Liguori [Mon, 31 Oct 2011 16:02:29 +0000 (11:02 -0500)]
Merge remote-tracking branch 'qmp/queue/qmp' into staging
Conflicts:
ui/spice-core.c
Anthony Liguori [Mon, 31 Oct 2011 16:00:27 +0000 (11:00 -0500)]
Merge remote-tracking branch 'qemu-kvm-tmp/uq/master' into staging
Anthony Liguori [Mon, 31 Oct 2011 15:23:15 +0000 (10:23 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Mon, 31 Oct 2011 15:14:06 +0000 (10:14 -0500)]
Merge remote-tracking branch 'alon/pull-libcacard-assert' into staging
Anthony Liguori [Mon, 31 Oct 2011 15:12:14 +0000 (10:12 -0500)]
Merge remote-tracking branch 'spice/spice.v45' into staging
Harsh Prateek Bora [Thu, 13 Oct 2011 20:35:02 +0000 (02:05 +0530)]
hw/9pfs: Replace rwlocks with RCU variants of interfaces.
Use QLIST_INSERT_HEAD_RCU and rcu_read_lock/unlock instead of rwlocks.
Use v9fs_synth_mutex as a write-only mutex to handle concurrent writers.
Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Harsh Prateek Bora [Tue, 25 Oct 2011 06:40:40 +0000 (12:10 +0530)]
qemu-queue: Introduce QLIST_INSERT_HEAD_RCU and dummy RCU wrappers.
SynthFS needs a QLIST_INSERT_HEAD_RCU to make sure list instructions are not
re-ordered and therefore avoiding a crash. There may be parallel readers which
should be allowed for lock-free access and this variant allows us to get rid
of rwlocks used by readers.
SynthFS is a special case where we dont really need full RCU capabilities as
it doesnt allow list entry deletion but concurrent readers/writers and
instruction re-ordering should not result in a crash.
Also, once the real rcu is available, dummy rcu macro definitions will go away
and the code will still work as expected.
This patchwork is based on inputs from Paolo Bonzini.
Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Aneesh Kumar K.V [Tue, 25 Oct 2011 06:40:40 +0000 (12:10 +0530)]
hw/9pfs: Add synthetic file system support using 9p
This patch create a synthetic file system with mount tag
v_synth when -virtfs_synth command line option is specified
in qemu. The synthetic file system can be mounted in guest
using 9p using the below command line
mount -t 9p -oversion=9p2000.L,trans=virtio v_synth <mountpint>
Synthetic file system enabled different qemu subsystem to register
callbacks for read and write events from guest. The subsystem
can create directories and files in the synthetic file system as show
in ex below
qemu_v9fs_synth_mkdir(NULL, 0777, "test2", &node);
qemu_v9fs_synth_add_file(node, 0777, "testfile",
my_test_read, NULL, NULL);
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Aneesh Kumar K.V [Tue, 25 Oct 2011 06:40:40 +0000 (12:10 +0530)]
hw/9pfs: Abstract open state of fid to V9fsFidOpenState
To implement synthetic file system in Qemu we may not really
require file descriptor and Dir *. Make generic code use
V9fsFidOpenState instead.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
M. Mohan Kumar [Tue, 25 Oct 2011 06:40:39 +0000 (12:10 +0530)]
hw/9pfs: Read-only support for 9p export
A new fsdev parameter "readonly" is introduced to control accessing 9p export.
"readonly" can be used to specify the access type. By default "rw" access
is given to 9p export.
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
M. Mohan Kumar [Tue, 25 Oct 2011 06:40:39 +0000 (12:10 +0530)]
qemu: Add opt_set_bool functionality
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>