]> git.proxmox.com Git - qemu.git/log
qemu.git
12 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Thu, 22 Sep 2011 15:29:42 +0000 (10:29 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

12 years agoMerge remote-tracking branch 'qemu-kvm-tmp/memory/batch' into staging
Anthony Liguori [Thu, 22 Sep 2011 15:27:14 +0000 (10:27 -0500)]
Merge remote-tracking branch 'qemu-kvm-tmp/memory/batch' into staging

12 years agouse qemu_* ctype functions
Christoph Egger [Wed, 21 Sep 2011 10:10:52 +0000 (11:10 +0100)]
use qemu_* ctype functions

Fix "warning: array subscript has type 'char'" on NetBSD.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoRemove qemu_host_page_bits
Stefan Weil [Sat, 17 Sep 2011 10:25:30 +0000 (12:25 +0200)]
Remove qemu_host_page_bits

It was introduced with commit 54936004fddc52c321cb3f9a9a51140e782bed5d
as host_page_bits but never used.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoAbort on thread layer errors
Jan Kiszka [Wed, 21 Sep 2011 07:28:31 +0000 (09:28 +0200)]
Abort on thread layer errors

Makes it easier to catch the bug in gdb as there is no need to set an
explicit breakpoint.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoSilence make if nothing is to do for libcacard
Jan Kiszka [Wed, 21 Sep 2011 07:18:32 +0000 (09:18 +0200)]
Silence make if nothing is to do for libcacard

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoDrop unneeded pthread.h inclusions
Jan Kiszka [Tue, 20 Sep 2011 15:11:58 +0000 (17:11 +0200)]
Drop unneeded pthread.h inclusions

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agofix compilation with stderr trace backend
Paolo Bonzini [Tue, 13 Sep 2011 15:47:52 +0000 (17:47 +0200)]
fix compilation with stderr trace backend

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoconfigure: Make missing pkg-config an error rather than a warning
Peter Maydell [Thu, 15 Sep 2011 11:15:56 +0000 (12:15 +0100)]
configure: Make missing pkg-config an error rather than a warning

If pkg-config doesn't exist then make configure fail immediately
with a useful error message. Now that glib is a required dependency,
proceeding despite the missing pkg-config will just cause us to
fail later with a misleading message about glib not being present.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agotarget-i386: Remove data type CCTable
Stefan Weil [Wed, 14 Sep 2011 16:27:54 +0000 (18:27 +0200)]
target-i386: Remove data type CCTable

Remove also two assert statements which were the last remaining users.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoomap1: convert to memory API (part VI)
Avi Kivity [Tue, 30 Aug 2011 11:53:31 +0000 (14:53 +0300)]
omap1: convert to memory API (part VI)

Easy RAM stuff.

Acked-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agosoc_dma: drop soc_dma_port_add_mem_ram()
Avi Kivity [Tue, 30 Aug 2011 11:46:53 +0000 (14:46 +0300)]
soc_dma: drop soc_dma_port_add_mem_ram()

It's a trivial wrapper for soc_dma_port_add_mem(), which makes
the memory API conversion more difficult because it takes a ram
addr_t.  Drop.

Acked-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoomap_lcdc: remove imif, emiff from structure
Avi Kivity [Tue, 30 Aug 2011 08:56:30 +0000 (11:56 +0300)]
omap_lcdc: remove imif, emiff from structure

Not used.

Acked-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoomap1: convert to memory API (part V)
Avi Kivity [Mon, 29 Aug 2011 11:14:06 +0000 (14:14 +0300)]
omap1: convert to memory API (part V)

Tricky aliases.

Acked-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoomap1: convert to memory API (part IV)
Avi Kivity [Mon, 29 Aug 2011 11:14:06 +0000 (14:14 +0300)]
omap1: convert to memory API (part IV)

Acked-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoomap1: convert to memory API (part III)
Avi Kivity [Mon, 29 Aug 2011 11:14:06 +0000 (14:14 +0300)]
omap1: convert to memory API (part III)

Acked-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoomap1: convert to memory API (part II)
Avi Kivity [Tue, 9 Aug 2011 16:35:00 +0000 (19:35 +0300)]
omap1: convert to memory API (part II)

Acked-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoomap1: convert to memory API (part I)
Avi Kivity [Tue, 9 Aug 2011 16:35:00 +0000 (19:35 +0300)]
omap1: convert to memory API (part I)

Acked-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoRevert "alpha-softmmu: Disable for the 0.15 release branch."
Richard Henderson [Tue, 20 Sep 2011 22:36:24 +0000 (15:36 -0700)]
Revert "alpha-softmmu: Disable for the 0.15 release branch."

This reverts commit 46f08792bb4a69ab8aab897c174d82b006026140.

This was not supposed to be applied to mainline.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
12 years agoMerge remote-tracking branch 'mst-tmp/for_anthony' into staging
Anthony Liguori [Tue, 20 Sep 2011 20:22:10 +0000 (15:22 -0500)]
Merge remote-tracking branch 'mst-tmp/for_anthony' into staging

12 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Tue, 20 Sep 2011 20:21:03 +0000 (15:21 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

12 years agoMerge remote-tracking branch 'kiszka/queues/slirp' into staging
Anthony Liguori [Tue, 20 Sep 2011 20:18:10 +0000 (15:18 -0500)]
Merge remote-tracking branch 'kiszka/queues/slirp' into staging

12 years agoMerge remote-tracking branch 'qmp/queue/qmp' into staging
Anthony Liguori [Tue, 20 Sep 2011 20:16:00 +0000 (15:16 -0500)]
Merge remote-tracking branch 'qmp/queue/qmp' into staging

12 years agopci_bridge: simplify memory regions some more
Michael S. Tsirkin [Tue, 6 Sep 2011 17:58:22 +0000 (20:58 +0300)]
pci_bridge: simplify memory regions some more

replace alloc/free with struct members.
todo: smash with initial implementation after
testing.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
12 years agowavaudio: Use stdio instead of QEMUFile
Juan Quintela [Tue, 20 Sep 2011 13:16:27 +0000 (15:16 +0200)]
wavaudio: Use stdio instead of QEMUFile

QEMUFile * is only intended for migration nowadays.  Using it for
anything else just adds pain and a layer of buffers for no good
reason.

Signed-off-by: Juan Quintela <quintela@redhat.com>
CC: malc <av1474@comtv.ru>
Signed-off-by: malc <av1474@comtv.ru>
12 years agowavcapture: Use stdio instead of QEMUFile
Juan Quintela [Tue, 20 Sep 2011 13:16:28 +0000 (15:16 +0200)]
wavcapture: Use stdio instead of QEMUFile

QEMUFile * is only intended for migration nowadays.  Using it for
anything else just adds pain and a layer of buffers for no good
reason.

Signed-off-by: Juan Quintela <quintela@redhat.com>
CC: malc <av1474@comtv.ru>
Signed-off-by: malc <av1474@comtv.ru>
12 years agorbd: allow escaping in config string
Sage Weil [Mon, 19 Sep 2011 20:35:26 +0000 (13:35 -0700)]
rbd: allow escaping in config string

The config string is variously delimited by =, @, and /, depending on the
field.  Allow these characters to be escaped by preceeding them with \.

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agolinux-aio: remove process requests callback
Paolo Bonzini [Mon, 19 Sep 2011 15:05:12 +0000 (17:05 +0200)]
linux-aio: remove process requests callback

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: avoid SIGUSR2
Frediano Ziglio [Mon, 19 Sep 2011 14:37:13 +0000 (16:37 +0200)]
block: avoid SIGUSR2

Now that iothread is always compiled sending a signal seems only an
additional step. This patch also avoid writing to two pipe (one from signal
and one in qemu_service_io).

Work with kvm enabled or disabled. strace output is more readable (less syscalls).

[ kwolf: Merged build fix by Paolo Bonzini ]

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoscsi: fix sign extension problems
Paolo Bonzini [Fri, 9 Sep 2011 14:47:26 +0000 (16:47 +0200)]
scsi: fix sign extension problems

When assigning a 32-bit value to cmd->xfer (which is 64-bits)
it can be erroneously sign extended because the intermediate
32-bit computation is signed.  Fix this by standardizing on
the ld*_be_p functions.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agorbd: call flush, if available
Sage Weil [Thu, 15 Sep 2011 21:11:11 +0000 (14:11 -0700)]
rbd: call flush, if available

librbd recently added async writeback and flush support.  If the new
rbd_flush() call is available, call it.

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agorbd: update comment heading
Sage Weil [Thu, 15 Sep 2011 21:11:10 +0000 (14:11 -0700)]
rbd: update comment heading

Properly document the configuration string syntax and semantics.  Remove
(out of date) details about the librbd implementation.

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agorbd: ignore failures when reading from default conf location
Sage Weil [Thu, 15 Sep 2011 21:11:08 +0000 (14:11 -0700)]
rbd: ignore failures when reading from default conf location

If we are reading from the default config location, ignore any failures.
It is perfectly legal for the user to specify exactly the options they need
and to not rely on any config file.

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoAHCI Port Interrupt Enable register cleaning on soft reset
Alexander Motin [Mon, 12 Sep 2011 08:19:25 +0000 (11:19 +0300)]
AHCI Port Interrupt Enable register cleaning on soft reset

I've found that FreeBSD AHCI driver doesn't work with AHCI hardware
emulation of QEMU 0.15.0. I believe the problem is on QEMU's side. As I
see, it clears port's Interrupt Enable register each time when reset of
any level happens. Is is reasonable for the global controller reset. It
is probably not good, but acceptable for FreeBSD driver for the port
hard reset. But it is IMO wrong for the device soft reset. None of real
hardware I know behaves that way.

Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoposix-aio-compat: Removed unused offset variable
Frediano Ziglio [Fri, 16 Sep 2011 11:34:46 +0000 (13:34 +0200)]
posix-aio-compat: Removed unused offset variable

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoVMDK: fix leak of extent_file
Fam Zheng [Mon, 19 Sep 2011 02:26:42 +0000 (10:26 +0800)]
VMDK: fix leak of extent_file

Release extent_file on error in vmdk_parse_extents. Added closing files
in freeing extents.

Signed-off-by: Fam Zheng <famcool@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoscsi-disk: lazily allocate bounce buffer
Paolo Bonzini [Fri, 16 Sep 2011 14:40:04 +0000 (16:40 +0200)]
scsi-disk: lazily allocate bounce buffer

It will not be needed for reads and writes if the HBA provides a sglist.
In addition, this lets scsi-disk refuse commands with an excessive
allocation length, as well as limit memory on usual well-behaved guests.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoscsi-disk: commonize iovec creation between reads and writes
Paolo Bonzini [Fri, 16 Sep 2011 14:40:03 +0000 (16:40 +0200)]
scsi-disk: commonize iovec creation between reads and writes

Also, consistently use qiov.size instead of iov.iov_len.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agodma-helpers: rewrite completion/cancellation
Paolo Bonzini [Fri, 16 Sep 2011 14:40:02 +0000 (16:40 +0200)]
dma-helpers: rewrite completion/cancellation

This fixes various problems with completion/cancellation:

* if the io_func fails to get an AIOCB, the callback wasn't called

* If DMA encounters a bounce buffer conflict, and the DMA operation is
canceled before the bottom half fires, bad things happen.

* memory is not unmapped after cancellation, again causing problems
when doing DMA to I/O areas

* cancellation could leak the iovec

* the callback was missed if the I/O operation failed without returning
an AIOCB

and probably more that I've missed.  The patch fixes them by sharing
the cleanup code between completion and cancellation.  The dma_bdrv_cb
now returns a boolean completed/not completed flag, and the wrapper
dma_continue takes care of tasks to do upon completion.

Most of these are basically impossible in practice, but it is better
to be tidy...

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agodma-helpers: allow including from target-independent code
Paolo Bonzini [Fri, 16 Sep 2011 14:40:01 +0000 (16:40 +0200)]
dma-helpers: allow including from target-independent code

Target-independent code cannot construct sglists, but it can take
them from the outside as a black box.  Allow this.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agopci: implement bridge filtering
Michael S. Tsirkin [Sun, 4 Sep 2011 13:50:55 +0000 (16:50 +0300)]
pci: implement bridge filtering

Support bridge filtering on top of the memory
API as suggested by Avi Kivity:

Create a memory region for the bridge's address space.  This region is
not directly added to system_memory or its descendants.  Devices under
the bridge see this region as its pci_address_space().  The region is
as large as the entire address space - it does not take into account
any windows.

For each of the three windows (pref, non-pref, vga), create an alias
with the appropriate start and size.  Map the alias into the bridge's
parent's pci_address_space(), as subregions.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
12 years agopci_bridge: use parent bus's address space
Wen Congyang [Fri, 26 Aug 2011 10:00:33 +0000 (13:00 +0300)]
pci_bridge: use parent bus's address space

The switch to the new memory API caused the following problem:

The pci device may call pci_register_bar() to use PCI bus's address
space.  But we don't init PCI bus's address space if it is not bus
0.  A crash was reported:
http://lists.gnu.org/archive/html/qemu-devel/2011-08/msg02243.html

More work will be needed to make bridge filtering work correctly
with the memory API.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
12 years agopci: Remove unused mem_base from PCIBus
Jan Kiszka [Mon, 12 Sep 2011 13:17:53 +0000 (15:17 +0200)]
pci: Remove unused mem_base from PCIBus

Obsoleted by f64e02b6cc.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
12 years agopci: interrupt pin documentation update
Michael S. Tsirkin [Sun, 11 Sep 2011 10:40:23 +0000 (13:40 +0300)]
pci: interrupt pin documentation update

Fix up some erroneous comments in code:
interrupt pins are named A-D, the
interrupt pin register is always readonly
and isn't zeroed out on reset.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
12 years agopci: Remove unused pci_reserve_capability
Jan Kiszka [Thu, 8 Sep 2011 10:44:47 +0000 (12:44 +0200)]
pci: Remove unused pci_reserve_capability

eepro100 was the last user. Now pci_add_capability is powerful enough.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
12 years agodma-helpers: rename is_write to to_dev
Paolo Bonzini [Fri, 16 Sep 2011 14:40:00 +0000 (16:40 +0200)]
dma-helpers: rename is_write to to_dev

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoscsi-generic: do not disable FUA
Paolo Bonzini [Wed, 14 Sep 2011 13:25:56 +0000 (15:25 +0200)]
scsi-generic: do not disable FUA

I found no rationale for this in the logs, and it is quite bad because
it will make scsi-generic unsafe WRT power failures.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoraw-posix: Fix bdrv_flush error return values
Kevin Wolf [Wed, 14 Sep 2011 09:22:26 +0000 (11:22 +0200)]
raw-posix: Fix bdrv_flush error return values

bdrv_flush is supposed to use 0/-errno return values

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agonbd: support NBD_SET_FLAGS ioctl
Paolo Bonzini [Thu, 8 Sep 2011 15:24:56 +0000 (17:24 +0200)]
nbd: support NBD_SET_FLAGS ioctl

The nbd kernel module cannot enable DISCARD requests unless it is
informed about it.  The flags field in the header is used for this,
and this patch adds support for it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agonbd: sync API definitions with upstream
Paolo Bonzini [Thu, 8 Sep 2011 15:24:55 +0000 (17:24 +0200)]
nbd: sync API definitions with upstream

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agonbd: support feature negotiation
Paolo Bonzini [Thu, 8 Sep 2011 15:24:54 +0000 (17:24 +0200)]
nbd: support feature negotiation

nbd supports writing flags in bytes 24...27 of the header,
and uses that for the read-only flag.  Add support for it
in qemu-nbd.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agomusicpal: convert to memory API
Avi Kivity [Mon, 8 Aug 2011 19:50:06 +0000 (22:50 +0300)]
musicpal: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agomips_r4k: convert to memory API
Avi Kivity [Mon, 8 Aug 2011 19:22:38 +0000 (22:22 +0300)]
mips_r4k: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agomips_mipssim: convert to memory API
Avi Kivity [Mon, 8 Aug 2011 19:17:28 +0000 (22:17 +0300)]
mips_mipssim: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agomips_malta: convert to memory API
Avi Kivity [Mon, 8 Aug 2011 19:14:25 +0000 (22:14 +0300)]
mips_malta: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agomips_jazz: convert to memory API
Avi Kivity [Mon, 8 Aug 2011 18:59:19 +0000 (21:59 +0300)]
mips_jazz: convert to memory API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agosun4u: don't set up isa_mem_base
Blue Swirl [Sat, 17 Sep 2011 19:16:57 +0000 (19:16 +0000)]
sun4u: don't set up isa_mem_base

Since we use memory API in sun4u.c, after
71579cae30b53c910cd6c47ab4e683f647d36519, setting up isa_mem_base
puts vga.chain4 outside of the physical address space.

Fix by removing obsolete isa_mem_base set up.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotcg/ppc64: Only one call output register needed for 64 bit hosts
Stefan Weil [Mon, 5 Sep 2011 09:07:02 +0000 (11:07 +0200)]
tcg/ppc64: Only one call output register needed for 64 bit hosts

The second register is only needed for 32 bit hosts.

Cc: Vassili Karpov <av1474@comtv.ru>
Fine-with-me'd-by: Vassili Karpov <av1474@comtv.ru>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotcg/sparc: Only one call output register needed for 64 bit hosts
Stefan Weil [Mon, 5 Sep 2011 09:07:01 +0000 (11:07 +0200)]
tcg/sparc: Only one call output register needed for 64 bit hosts

The second register is only needed for 32 bit hosts.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotcg/s390: Only one call output register needed for 64 bit hosts
Stefan Weil [Mon, 5 Sep 2011 09:07:00 +0000 (11:07 +0200)]
tcg/s390: Only one call output register needed for 64 bit hosts

The second register is only needed for 32 bit hosts.

Cc: Alexander Graf <agraf@suse.de>
Acked-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotcg/ia64: Only one call output register needed for 64 bit hosts
Stefan Weil [Mon, 5 Sep 2011 09:06:59 +0000 (11:06 +0200)]
tcg/ia64: Only one call output register needed for 64 bit hosts

The second register is never used for ia64 hosts.

Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotcg/i386: Only one call output register needed for 64 bit hosts
Stefan Weil [Mon, 5 Sep 2011 09:06:58 +0000 (11:06 +0200)]
tcg/i386: Only one call output register needed for 64 bit hosts

The second register is only needed for 32 bit hosts.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-i386: Fix several SSE3 instructions.
Max Reitz [Fri, 16 Sep 2011 15:29:04 +0000 (17:29 +0200)]
target-i386: Fix several SSE3 instructions.

haddp[sd], hsubp[sd] and addsubp[sd] operate on floats, thus it is
necessary to use the appropriate floating point calculation functions.
If this is not done, those functions operate merely on integers, which
is not correct.

Signed-off-by: Max Reitz <max@tyndur.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotrace: add virtio_set_status() trace event
Stefan Hajnoczi [Tue, 13 Sep 2011 12:34:37 +0000 (13:34 +0100)]
trace: add virtio_set_status() trace event

The virtio device lifecycle can be observed by looking at the sequence
of set status operations.  This is especially important for catching the
reset operation (status value 0), which resets the device and all
virtqueues.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotrace: remove trailing double quotes after PRI*64
Stefan Hajnoczi [Tue, 13 Sep 2011 12:34:36 +0000 (13:34 +0100)]
trace: remove trailing double quotes after PRI*64

Now that format strings can end in a PRI*64 macro, remove the
workarounds from the trace-events file.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotrace: allow PRI*64 at beginning and ending of format string
Stefan Hajnoczi [Tue, 13 Sep 2011 12:34:35 +0000 (13:34 +0100)]
trace: allow PRI*64 at beginning and ending of format string

The tracetool parser only picks up PRI*64 and other format string macros
when enclosed between double quoted strings.  Lift this restriction by
extracting everything after the closing ')' as the format string:

  cpu_set_apic_base(uint64_t val) "%016"PRIx64
                                  ^^        ^^

One trick here: it turns out that backslashes in the format string like
"\n" were being interpreted by echo(1).  Fix this by using the POSIX
printf(1) command instead.  Although it normally does not make sense to
include backslashes in trace event format strings, an injected newline
causes tracetool to emit a broken header file and I want to eliminate
cases where broken output is emitted, even if the input was bad.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotrace: remove newline from grlib_irqmp_check_irqs format string
Stefan Hajnoczi [Tue, 13 Sep 2011 12:34:34 +0000 (13:34 +0100)]
trace: remove newline from grlib_irqmp_check_irqs format string

There is no need to put a newline in trace event format strings.  The
backend may use the format string within some context and takes care of
how to display the event.  The stderr backend automatically appends "\n"
whereas the ust backend does not want a newline at all.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoMakefile: Fix broken build
Stefan Weil [Fri, 16 Sep 2011 19:50:43 +0000 (21:50 +0200)]
Makefile: Fix broken build

make -C mybuilddir no longer works (regression caused by commit)
388d475815c23901010a25c845eb078d47ee0740.

PWD is the directory of the caller (not mybuilddir),
so BUILD_DIR is set to the wrong value.

GNU make sets CURDIR to the correct value.
Use this macro instead of PWD.

Cc: Lluís Vilanova <vilanova@ac.upc.edu>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoqdev: print bus properties too
Gerd Hoffmann [Fri, 16 Sep 2011 09:25:05 +0000 (11:25 +0200)]
qdev: print bus properties too

Make qdev_device_help print both device and bus properties.
Helps libvirt to figure whenever bus properties such as
PCI.multifunction are supported present or not.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agovga: Respect isa_mem_base when registering chain4 alias
Jan Kiszka [Thu, 15 Sep 2011 09:26:56 +0000 (11:26 +0200)]
vga: Respect isa_mem_base when registering chain4 alias

This does not yet unbreak PPC (which has its own problems) but
potentially other non-x86 systems where isa_mem_base is != 0.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agohw/integratorcp: Fix bugs in writes to CM_CTRL system register
Peter Maydell [Mon, 12 Sep 2011 14:43:31 +0000 (15:43 +0100)]
hw/integratorcp: Fix bugs in writes to CM_CTRL system register

Fix a number of bugs in the implementation of writes to the CM_CTRL
system register:
 * write to cm_ctrl, not cm_init !
 * an '&' vs '^' typo meant we would write the inverse of the bits
 * handling the LED via printf() meant we spew lots of output
   to stdout when Linux uses the LED as a heartbeat indicator
 * we would hw_error() if a reset was requested rather than
   actually resetting

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agobswap.h: build fix
Christoph Egger [Tue, 13 Sep 2011 13:12:06 +0000 (15:12 +0200)]
bswap.h: build fix

qemu build fails when CONFIG_MACHINE_BSWAP_H is defined
because float32, float64, etc. are not defined.
This makes qemu build.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoconsole: Properly switch consoles for screen dumps
Jan Kiszka [Thu, 15 Sep 2011 22:48:07 +0000 (00:48 +0200)]
console: Properly switch consoles for screen dumps

Do not mess with active_console, use console_select instead. This fixes
corrupt virtual monitor consoles after issuing the screendump command.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agovga: Fix text mode screendumps
Jan Kiszka [Thu, 15 Sep 2011 22:47:55 +0000 (00:47 +0200)]
vga: Fix text mode screendumps

In text mode, even a full refresh of the screen takes multiple updates.
As we reset the dump file pointer after the first call, we only wrote
the first line.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoFix termination by signal with -no-shutdown
Kevin Wolf [Wed, 14 Sep 2011 13:38:40 +0000 (15:38 +0200)]
Fix termination by signal with -no-shutdown

On signals such as SIGTERM qemu should exit instead of just stopping the VM
even with -no-shutdown.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoRemove blanks before \n in output strings
Stefan Weil [Mon, 12 Sep 2011 20:33:01 +0000 (22:33 +0200)]
Remove blanks before \n in output strings

Those blanks violate the coding conventions, see
scripts/checkpatch.pl.

Blanks missing after colons in the changed lines were added.

This patch does not try to fix tabs, long lines and other
problems in the changed lines, therefore checkpatch.pl reports
many violations.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agobuild: Move tracing objects into libuser on usermode emulation targets
Lluís Vilanova [Thu, 15 Sep 2011 20:45:42 +0000 (22:45 +0200)]
build: Move tracing objects into libuser on usermode emulation targets

This will apply libuser-specific compilation flags (like the ones added by
--enable-user-pie), but keep softmmu emulation targets "as-is".

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agobuild: Always have 'BUILD_DIR' variable pointing to the root of the build tree
Lluís Vilanova [Thu, 15 Sep 2011 20:45:35 +0000 (22:45 +0200)]
build: Always have 'BUILD_DIR' variable pointing to the root of the build tree

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoslirp: Fill TCP/IP header template after SYN reception
Jan Kiszka [Thu, 15 Sep 2011 22:10:50 +0000 (00:10 +0200)]
slirp: Fill TCP/IP header template after SYN reception

This ensures we can cleanly signal the drop in case the connection timer
fires. So far we sent those frames to nowhere (target IP 0.0.0.0).

Found by the new assertion on invalid IPs in arp_table_search.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agoHMP: info status: Print the VM state
Luiz Capitulino [Tue, 9 Aug 2011 17:44:25 +0000 (14:44 -0300)]
HMP: info status: Print the VM state

Today our printf format for the "info status" command is:

  VM status: %s

Where the string can be "running", "running (single step mode)" or
"paused".

This commit extends it to:

 VM status: %s (%s)

The second string corresponds to the "status" field as returned
by the query-status QMP command and it's only printed if "status"
is not "running" or "paused".

Example:

 VM status: paused (shutdown)

PS: libvirt uses "info status" when using HMP, but the new format
    should not break it.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
12 years agoQMP: query-status: Introduce 'status' key
Luiz Capitulino [Mon, 29 Aug 2011 19:02:57 +0000 (16:02 -0300)]
QMP: query-status: Introduce 'status' key

This new key reports the current VM status to clients. Please, check
the documentation being added in this commit for more details.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
12 years agoMonitor/QMP: Don't allow cont on bad VM state
Luiz Capitulino [Fri, 29 Jul 2011 18:57:54 +0000 (15:57 -0300)]
Monitor/QMP: Don't allow cont on bad VM state

We have two states where issuing cont before system_reset can
cause problems: RSTATE_SHUTDOWN (when -no-shutdown is used) and
RSTATE_PANICKED (which only happens with kvm).

This commit fixes that by doing the following when state is
RSTATE_SHUTDOWN or RSTATE_PANICKED:

 1. returning an error to the user/client if cont is issued
 2. automatically transition to RSTATE_PAUSED during system_reset

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
12 years agoDrop the vm_running global variable
Luiz Capitulino [Fri, 29 Jul 2011 18:36:43 +0000 (15:36 -0300)]
Drop the vm_running global variable

Use runstate_is_running() instead, which is introduced by this commit.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
12 years agoDrop the incoming_expected global variable
Luiz Capitulino [Fri, 29 Jul 2011 18:15:00 +0000 (15:15 -0300)]
Drop the incoming_expected global variable

Test against RSTATE_IN_MIGRATE instead.

Please, note that the RSTATE_IN_MIGRATE state is only set when all the
initial VM setup is done, while 'incoming_expected' was set right in
the beginning when parsing command-line options. Shouldn't be a problem
as far as I could check.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
12 years agorunstate_set(): Check for valid transitions
Luiz Capitulino [Mon, 5 Sep 2011 19:36:31 +0000 (16:36 -0300)]
runstate_set(): Check for valid transitions

This commit could have been folded with the previous one, however
doing it separately will allow for easy bisect and revert if needed.

Checking and testing all valid transitions wasn't trivial, chances
are this will need broader testing to become more stable.

This is a transition table as suggested by Lluís Vilanova.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
12 years agoRunState: Add additional states
Luiz Capitulino [Fri, 29 Jul 2011 18:04:45 +0000 (15:04 -0300)]
RunState: Add additional states

Currently, only vm_start() and vm_stop() change the VM state.
That's, the state is only changed when starting or stopping the VM.

This commit adds the runstate_set() function, which makes it possible
to also do state transitions when the VM is stopped or running.

Additional states are also added and the current state is stored.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
12 years agoReplace the VMSTOP macros with a proper state type
Luiz Capitulino [Fri, 29 Jul 2011 17:26:33 +0000 (14:26 -0300)]
Replace the VMSTOP macros with a proper state type

Today, when notifying a VM state change with vm_state_notify(),
we pass a VMSTOP macro as the 'reason' argument. This is not ideal
because the VMSTOP macros tell why qemu stopped and not exactly
what the current VM state is.

One example to demonstrate this problem is that vm_start() calls
vm_state_notify() with reason=0, which turns out to be VMSTOP_USER.

This commit fixes that by replacing the VMSTOP macros with a proper
state type called RunState.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
12 years agoMove vm_state_notify() prototype from cpus.h to sysemu.h
Luiz Capitulino [Fri, 29 Jul 2011 16:37:55 +0000 (13:37 -0300)]
Move vm_state_notify() prototype from cpus.h to sysemu.h

It's where all the state handling functions prototypes are located.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
12 years agoMerge remote-tracking branch 'qemu-kvm-tmp/memory/core' into staging
Anthony Liguori [Thu, 15 Sep 2011 18:33:03 +0000 (13:33 -0500)]
Merge remote-tracking branch 'qemu-kvm-tmp/memory/core' into staging

12 years agoMerge remote-tracking branch 'aneesh/for-upstream-4' into staging
Anthony Liguori [Thu, 15 Sep 2011 18:28:28 +0000 (13:28 -0500)]
Merge remote-tracking branch 'aneesh/for-upstream-4' into staging

12 years agoFix subtle integer overflow bug in memory API
David Gibson [Wed, 14 Sep 2011 07:02:49 +0000 (17:02 +1000)]
Fix subtle integer overflow bug in memory API

It is quite common to have a MemoryRegion with size of INT64_MAX.
When processing alias regions in render_memory_region() it's quite
easy to find a case where it will construct a temporary AddrRange with
a non-zero start, and size still of INT64_MAX.  When means attempting
to compute the end of such a range as start + size will result in
signed integer overflow.

This integer overflow means that addrrange_intersects() can
incorrectly report regions as not intersecting when they do.  For
example consider the case of address ranges {0x10000000000,
0x7fffffffffffffff} and {0x10010000000, 0x10000000} where the second
is in fact included completely in the first.

This patch rearranges addrrange_intersects() to avoid the integer
overflow, correcting this behaviour.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoqcow2: fix range check
Frediano Ziglio [Sat, 10 Sep 2011 08:23:56 +0000 (10:23 +0200)]
qcow2: fix range check

QCowL2Meta::offset is not cluster aligned but only sector aligned
however nb_clusters count cluster from cluster start.
This fix range check. Note that old code have no corruption issues
related to this check cause it only cause intersection to occur
when shouldn't.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqcow2: align cluster_data to block to improve performance using O_DIRECT
Frediano Ziglio [Sat, 10 Sep 2011 08:59:16 +0000 (10:59 +0200)]
qcow2: align cluster_data to block to improve performance using O_DIRECT

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoahci: Remove unused struct member
Stefan Weil [Thu, 8 Sep 2011 19:44:15 +0000 (21:44 +0200)]
ahci: Remove unused struct member

Member variable is_read is written, but never read
(contrary to its name). Remove it.

Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqcow2: initialize metadata before inserting in cluster_allocs
Frediano Ziglio [Thu, 8 Sep 2011 11:38:42 +0000 (13:38 +0200)]
qcow2: initialize metadata before inserting in cluster_allocs

QCow2Meta structure was inserted into list before many fields are
initialized. Currently is not a problem cause all occur in a lock
but if qcow2_alloc_clusters would in a future unlock this lock
some issues could arise.
Initializing fields before inserting fix the problem.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoide/atapi scsi-disk: Make monitor eject -f, then change work
Markus Armbruster [Tue, 6 Sep 2011 16:59:00 +0000 (18:59 +0200)]
ide/atapi scsi-disk: Make monitor eject -f, then change work

change fails while the tray is locked by the guest.  eject -f forces
it open and removes any media.  Unfortunately, the tray closes again
instantly.  Since the lock remains as it is, there is no way to insert
another medium unless the guest voluntarily unlocks.

Fix by leaving the tray open after monitor eject.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: New change_media_cb() parameter load
Markus Armbruster [Tue, 6 Sep 2011 16:58:59 +0000 (18:58 +0200)]
block: New change_media_cb() parameter load

To let device models distinguish between eject and load.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agonbd: Clean up use of block_int.h
Markus Armbruster [Tue, 6 Sep 2011 16:58:58 +0000 (18:58 +0200)]
nbd: Clean up use of block_int.h

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: Reset buffer alignment on detach
Markus Armbruster [Tue, 6 Sep 2011 16:58:57 +0000 (18:58 +0200)]
block: Reset buffer alignment on detach

BlockDriverState member buffer_alignment is initially 512.  The device
model may set them, with bdrv_set_buffer_alignment().  If the device
model gets detached (hot unplug), the device's alignment is left
behind.  Only okay because device hot unplug automatically destroys
the BlockDriverState.  But that's a questionable feature, best not to
rely on it.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: New bdrv_set_buffer_alignment()
Markus Armbruster [Tue, 6 Sep 2011 16:58:56 +0000 (18:58 +0200)]
block: New bdrv_set_buffer_alignment()

Device models should be able to set it without an unclean include of
block_int.h.

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