]> git.proxmox.com Git - qemu.git/log
qemu.git
10 years agoblock: Save errno before error_setg_errno
Max Reitz [Tue, 5 Nov 2013 19:03:33 +0000 (20:03 +0100)]
block: Save errno before error_setg_errno

error_setg_errno() may overwrite errno; therefore, its value should be
read before calling that function and not afterwards.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqdev-monitor-test: add device_add leak test cases
Stefan Hajnoczi [Wed, 30 Oct 2013 13:54:35 +0000 (14:54 +0100)]
qdev-monitor-test: add device_add leak test cases

Ensure that the device_add error code path deletes device objects.
Failure to do so not only leaks the objects but can also keep other
objects (like drive or netdev) alive due to qdev properties holding
references.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
10 years agoblockdev-test: add test case for drive_add duplicate IDs
Stefan Hajnoczi [Wed, 30 Oct 2013 13:54:34 +0000 (14:54 +0100)]
blockdev-test: add test case for drive_add duplicate IDs

The following should work:

  (qemu) drive_add if=none,id=drive0
  (qemu) drive_del drive0
  (qemu) drive_add if=none,id=drive0

Previous versions of QEMU produced a duplicate ID error because
drive_add leaked the options.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
10 years agolibqtest: add qmp(fmt, ...) -> QDict* function
Stefan Hajnoczi [Wed, 30 Oct 2013 13:54:33 +0000 (14:54 +0100)]
libqtest: add qmp(fmt, ...) -> QDict* function

Add a qtest qmp() function that returns the response object.  This
allows test cases to verify the result or to check for error responses.
It also allows waiting for QMP events.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
10 years agolibqtest: rename qmp() to qmp_discard_response()
Stefan Hajnoczi [Wed, 30 Oct 2013 13:54:32 +0000 (14:54 +0100)]
libqtest: rename qmp() to qmp_discard_response()

Existing qmp() callers do not expect a response object.  In order to
implement real QMP test cases it will be necessary to inspect the
response object.

Rename qmp() to qmp_discard_response().  Later patches will introduce a
qmp() function that returns the response object and tests that use it.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
10 years agoblockdev: fix drive_init() opts and bs_opts leaks
Stefan Hajnoczi [Wed, 30 Oct 2013 13:54:30 +0000 (14:54 +0100)]
blockdev: fix drive_init() opts and bs_opts leaks

These memory leaks also make drive_add if=none,id=drive0 without a file=
option leak the options list.  This keeps ID "drive0" around forever.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
10 years agoblock: qemu-iotests, add quotes to $TEST_IMG usage in 061
Jeff Cody [Thu, 31 Oct 2013 15:57:42 +0000 (11:57 -0400)]
block: qemu-iotests, add quotes to $TEST_IMG usage in 061

When creating images with backing files in the test, the backing
file argument was not quoted properly.  This caused the test to fail
when run from a pathname with a space.  Pass the backing argument in
with the -b option to _make_test_img, so it can be properly quoted.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: qemu-iotests, add quotes to $TEST_IMG usage for 051
Jeff Cody [Thu, 31 Oct 2013 15:57:41 +0000 (11:57 -0400)]
block: qemu-iotests, add quotes to $TEST_IMG usage for 051

There were still a couple of instances of unquoted usage of
$TEST_IMG and $TEST_IMG.orig.  Quoted these so they will not fail
on pathnames with spaces in them.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: qemu-iotests, removes duplicate double quotes in 039
Jeff Cody [Thu, 31 Oct 2013 15:57:40 +0000 (11:57 -0400)]
block: qemu-iotests, removes duplicate double quotes in 039

Test 039 had $TEST_IMG with duplicate double quotes - remove duplicate.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: qemu-iotests, add quotes to $TEST_IMG usage in 019
Jeff Cody [Thu, 31 Oct 2013 15:57:39 +0000 (11:57 -0400)]
block: qemu-iotests, add quotes to $TEST_IMG usage in 019

There were still instances of $TEST_IMG not being properly quoted.
This was in the usage of a string built up for a 'for' loop; modify
the loop so we can quote $TEST_IMG properly.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: qemu-iotests, add quotes to $TEST_IMG.base usage in 017
Jeff Cody [Thu, 31 Oct 2013 15:57:38 +0000 (11:57 -0400)]
block: qemu-iotests, add quotes to $TEST_IMG.base usage in 017

$TEST_IMG.base is used unquoted. Add quotes so that pathnames with
spaces are supported.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: qemu-iotests, fix _make_test_img() to work with spaced pathnames
Jeff Cody [Thu, 31 Oct 2013 15:57:37 +0000 (11:57 -0400)]
block: qemu-iotests, fix _make_test_img() to work with spaced pathnames

_make_test_img() currently works with spaced pathnames only when not
specifying a backing file.  This fixes it so that the backing file
argument is properly quoted.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: qemu-iotests, add quotes to $TEST_IMG usage io pattern tests
Jeff Cody [Thu, 31 Oct 2013 15:57:36 +0000 (11:57 -0400)]
block: qemu-iotests, add quotes to $TEST_IMG usage io pattern tests

The usage of $TEST_IMG was not properly quoted everywhere in
common.pattern.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/raw-posix: fix FreeBSD compilation
Andreas Tobler [Thu, 31 Oct 2013 21:41:46 +0000 (22:41 +0100)]
block/raw-posix: fix FreeBSD compilation

The below patch is needed to compile qemu trunk on FreeBSD with gcc48,
clang will fail.... ;). Host x84_64-freebsd.

Signed-off-by: Andreas Tobler <andreast@FreeBSD.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqemu-iotests: Filter out actual image size in 067
Max Reitz [Sat, 2 Nov 2013 13:52:11 +0000 (14:52 +0100)]
qemu-iotests: Filter out actual image size in 067

The actual size of the image file may differ depending on the Linux
kernel currently running on the host. Filtering out this value makes
this test pass in such cases.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqapi: Fix comment for create-type to match code.
Fam Zheng [Fri, 1 Nov 2013 09:35:29 +0000 (17:35 +0800)]
qapi: Fix comment for create-type to match code.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoUpdate version for 1.7.0-rc0 release v1.7.0-rc0
Anthony Liguori [Thu, 7 Nov 2013 05:49:39 +0000 (21:49 -0800)]
Update version for 1.7.0-rc0 release

Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agosdl: Reverse support for video mode setting
Lei Li [Wed, 4 Sep 2013 09:07:16 +0000 (17:07 +0800)]
sdl: Reverse support for video mode setting

Currently, If the setting of video mode failed, qemu will exit. It
should go back to the previous setting if the new screen resolution
failed. This patch fixes LP#1216368, add support to revert to existing
surface for the failure of video mode setting.

Reported-by: Sascha Krissler <sascha@srlabs.de>
Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1378285636-7091-1-git-send-email-lilei@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agotimers: fix stop/cont with -icount
Paolo Bonzini [Mon, 28 Oct 2013 16:32:18 +0000 (17:32 +0100)]
timers: fix stop/cont with -icount

Stop/cont commands are broken with -icount due to a deadlock.  The
real problem is that the computation of timers_state.cpu_ticks_offset
makes no sense with -icount enabled: we set it to an icount clock value
in cpu_disable_ticks, and subtract a TSC (or similar, whatever
cpu_get_real_ticks happens to return) value in cpu_enable_ticks.

The fix is simple.  timers_state.cpu_ticks_offset is only used
together with cpu_get_real_ticks, so we can use cpu_get_real_ticks
in cpu_disable_ticks.  There is no need to update cpu_ticks_prev
at the time cpu_disable_ticks is called; instead, we can do it
the next time cpu_get_ticks is called.

The change to cpu_disable_ticks is the important part of the patch.
The rest modifies the code to always check timers_state.cpu_ticks_prev,
even when the ticks are not advancing (i.e. the VM is stopped).  It also
makes a similar change to cpu_get_clock_locked, so that the code remains
similar for cpu_get_ticks and cpu_get_clock_locked.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1382977938-13844-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoe1000/rtl8139: update HMP NIC when every bit is written
Amos Kong [Tue, 5 Nov 2013 11:17:18 +0000 (19:17 +0800)]
e1000/rtl8139: update HMP NIC when every bit is written

We currently just update the HMP NIC info when the last bit of macaddr
is written. This assumes that guest driver will write all the macaddr
from bit 0 to bit 5 when it changes the macaddr, this is the current
behavior of linux driver (e1000/rtl8139cp), but we can't do this
assumption.

The macaddr that is used for rx-filter will be updated when every bit
is changed. This patch updates the e1000/rtl8139 nic to update HMP NIC
info when every bit is changed. It will be same as virtio-net.

Signed-off-by: Amos Kong <akong@redhat.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Message-id: 1383650238-16015-1-git-send-email-akong@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agovirtio-net: only delete bh that existed
Jason Wang [Wed, 6 Nov 2013 08:58:08 +0000 (16:58 +0800)]
virtio-net: only delete bh that existed

We delete without check whether it existed during exit. This will lead NULL
pointer deference since it was created conditionally depends on guest driver
status and features. So add a check of existence before trying to delete it.

Cc: qemu-stable@nongnu.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1383728288-28469-1-git-send-email-jasowang@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agortc: remove dead SQW IRQ code
Jan Kiszka [Wed, 14 Aug 2013 11:29:43 +0000 (13:29 +0200)]
rtc: remove dead SQW IRQ code

This was once introduced by commit 100d9891d6 but was never used in-tree
and then got broken by commit 32e0c8260d. Time to clean up.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Message-id: 520B6A27.4040207@siemens.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agovga: fix invalid read after free
Marc-André Lureau [Tue, 5 Nov 2013 15:15:54 +0000 (16:15 +0100)]
vga: fix invalid read after free

After calling dpy_gfx_replace_surface(s->con, surface), the outer
surface is invalid.

==5370== Invalid read of size 4
==5370==    at 0x460229: surface_bits_per_pixel (console.h:250)
==5370==    by 0x466A81: get_depth_index (vga.c:1173)
==5370==    by 0x467EC2: vga_draw_graphic (vga.c:1718)
==5370==    by 0x4687A5: vga_update_display (vga.c:1914)
==5370==    by 0x2A782E: qxl_hw_update (qxl.c:1766)
==5370==    by 0x3EB83B: graphic_hw_update (console.c:254)
==5370==    by 0x3FBE31: qemu_spice_display_refresh (spice-display.c:418)
==5370==    by 0x2A7D01: display_refresh (qxl.c:1886)
==5370==    by 0x3EEE1C: dpy_refresh (console.c:1436)
==5370==    by 0x3EB543: gui_update (console.c:192)
==5370==    by 0x3C43B3: timerlist_run_timers (qemu-timer.c:488)
==5370==    by 0x3C4416: qemu_clock_run_timers (qemu-timer.c:499)
==5370==  Address 0x22ffb1e0 is 0 bytes inside a block of size 56 free'd
==5370==    at 0x4A074C4: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==5370==    by 0x4245FC: free_and_trace (vl.c:2771)
==5370==    by 0x50899AE: g_free (gmem.c:252)
==5370==    by 0x3EE8D3: qemu_free_displaysurface (console.c:1332)
==5370==    by 0x3EEDB7: dpy_gfx_replace_surface (console.c:1427)
==5370==    by 0x467EB6: vga_draw_graphic (vga.c:1714)
==5370==    by 0x4687A5: vga_update_display (vga.c:1914)
==5370==    by 0x2A782E: qxl_hw_update (qxl.c:1766)
==5370==    by 0x3EB83B: graphic_hw_update (console.c:254)
==5370==    by 0x3FBE31: qemu_spice_display_refresh (spice-display.c:418)
==5370==    by 0x2A7D01: display_refresh (qxl.c:1886)
==5370==    by 0x3EEE1C: dpy_refresh (console.c:1436)

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 1383664554-15248-1-git-send-email-marcandre.lureau@gmail.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agotests: fix 64-bit int literals for 32-bit hosts
Stefan Hajnoczi [Tue, 5 Nov 2013 16:42:48 +0000 (17:42 +0100)]
tests: fix 64-bit int literals for 32-bit hosts

On 32-bit hosts:

  CC    tests/test-opts-visitor.o
tests/test-opts-visitor.c: In function 'test_value':
tests/test-opts-visitor.c:128: warning: integer constant is too large for 'long' type
  CC    tests/test-bitops.o
tests/test-bitops.c:34: warning: integer constant is too large for 'long' type
tests/test-bitops.c:35: warning: integer constant is too large for 'long' type
tests/test-bitops.c:35: warning: integer constant is too large for 'long' type
  CC    tests/endianness-test.o
tests/endianness-test.c:47: warning: integer constant is too large for 'long' type

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1383669768-23926-1-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agodocs/memory.txt: Clarify and expand priority/overlap documentation
Peter Maydell [Tue, 15 Oct 2013 14:42:34 +0000 (15:42 +0100)]
docs/memory.txt: Clarify and expand priority/overlap documentation

The documentation of how overlapping memory regions behave and how
the priority system works was rather brief, and confusion about
priorities seems to be quite common for developers trying to understand
how the memory region system works, so expand and clarify it.
This includes a worked example with overlaps, documentation of the
behaviour when an overlapped container has "holes", and mention
that it's valid for a region to have both MMIO callbacks and
subregions (and how this interacts with priorities when it does).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1381848154-31602-1-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoconfigure: detect endian via compile test
Mike Frysinger [Mon, 1 Jul 2013 03:30:18 +0000 (23:30 -0400)]
configure: detect endian via compile test

This avoids needing to execute a program and keeping an (incomplete)
list when cross-compiling.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Tested-by: James Hogan <james.hogan@imgtec.com> [mips]
Message-id: 1372649418-4987-1-git-send-email-vapier@gentoo.org
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agotests: fix memleak in error path test for input visitor
Wenchao Xia [Tue, 5 Nov 2013 18:35:51 +0000 (02:35 +0800)]
tests: fix memleak in error path test for input visitor

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1383676551-18806-3-git-send-email-xiawenc@linux.vnet.ibm.com
Cc: qemu-stable@nongnu.org
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoqapi: fix memleak by adding implict struct functions in dealloc visitor
Wenchao Xia [Tue, 5 Nov 2013 18:35:50 +0000 (02:35 +0800)]
qapi: fix memleak by adding implict struct functions in dealloc visitor

Otherwise member "base" is leaked in a qapi_free_STRUCTURE() call.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1383676551-18806-2-git-send-email-xiawenc@linux.vnet.ibm.com
Cc: qemu-stable@nongnu.org
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agobswap.h: Remove cpu_to_32wu()
Peter Maydell [Tue, 5 Nov 2013 16:38:37 +0000 (16:38 +0000)]
bswap.h: Remove cpu_to_32wu()

Replace the legacy cpu_to_32wu() with stl_p().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1383669517-25598-10-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agobswap.h: Remove cpu_to_be64wu()
Peter Maydell [Tue, 5 Nov 2013 16:38:36 +0000 (16:38 +0000)]
bswap.h: Remove cpu_to_be64wu()

Replace the legacy cpu_to_be64wu() with stq_be_p().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1383669517-25598-9-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agobswap.h: Remove cpu_to_be32wu()
Peter Maydell [Tue, 5 Nov 2013 16:38:35 +0000 (16:38 +0000)]
bswap.h: Remove cpu_to_be32wu()

Replace the legacy cpu_to_be32wu() with stl_be_p().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1383669517-25598-8-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agobswap.h: Remove cpu_to_be16wu()
Peter Maydell [Tue, 5 Nov 2013 16:38:34 +0000 (16:38 +0000)]
bswap.h: Remove cpu_to_be16wu()

Replace the legacy cpu_to_be16wu() with stw_be_p().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1383669517-25598-7-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agobswap.h: Remove be32_to_cpupu()
Peter Maydell [Tue, 5 Nov 2013 16:38:33 +0000 (16:38 +0000)]
bswap.h: Remove be32_to_cpupu()

Replace the legacy be32_to_cpupu() with ldl_be_p().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1383669517-25598-6-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agobswap.h: Remove le32_to_cpupu()
Peter Maydell [Tue, 5 Nov 2013 16:38:32 +0000 (16:38 +0000)]
bswap.h: Remove le32_to_cpupu()

Replace the legacy le32_to_cpupu() with ldl_le_p().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1383669517-25598-5-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agobswap.h: Remove le16_to_cpupu()
Peter Maydell [Tue, 5 Nov 2013 16:38:31 +0000 (16:38 +0000)]
bswap.h: Remove le16_to_cpupu()

Replace the legacy le16_to_cpupu() with lduw_le_p().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1383669517-25598-4-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agobswap.h: Remove cpu_to_le32wu()
Peter Maydell [Tue, 5 Nov 2013 16:38:30 +0000 (16:38 +0000)]
bswap.h: Remove cpu_to_le32wu()

Replace the legacy cpu_to_le32wu() with stl_le_p().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1383669517-25598-3-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agobswap.h: Remove cpu_to_le16wu()
Peter Maydell [Tue, 5 Nov 2013 16:38:29 +0000 (16:38 +0000)]
bswap.h: Remove cpu_to_le16wu()

Replace the legacy cpu_to_le16wu() with stw_le_p().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1383669517-25598-2-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoMerge remote-tracking branch 'afaerber/tags/qom-devices-for-anthony' into staging
Anthony Liguori [Tue, 5 Nov 2013 18:33:32 +0000 (10:33 -0800)]
Merge remote-tracking branch 'afaerber/tags/qom-devices-for-anthony' into staging

QOM device refactorings

* QTest coverage for all machines
* QOM realize for Milkymist UART
* QOM realize for ARM MPCore
* device_add bug fixes and cleanups
* QOM for PCMCIA/MicroDrive (last legacy IDE device)

# gpg: Signature made Tue 05 Nov 2013 09:07:03 AM PST using RSA key ID 3E7E013F
# gpg: Can't check signature: public key not found

# By Andreas Färber (49) and others
# Via Andreas Färber
* afaerber/tags/qom-devices-for-anthony: (54 commits)
  pcmcia/pxa2xx: QOM'ify PXA2xxPCMCIAState
  ide: Drop ide_init2_with_non_qdev_drives()
  microdrive: Coding Style cleanups
  pcmcia: QOM'ify PCMCIACardState and MicroDriveState
  pxa: Fix typo "dettach"
  qom: Fix pointer to int property helpers' documentation
  qdev-monitor: Inline qdev_init() for device_add
  qdev-monitor: Avoid qdev as variable name
  qdev: Drop misleading qdev_free() function
  qdev-monitor: Unref device when device_add fails
  qdev-monitor: Fix crash when device_add is called with abstract driver
  qdev-monitor: Clean up qdev_device_add() variable naming
  arm11mpcore: Split off RealView MPCore
  arm11mpcore: Prepare for QOM embedding
  arm11mpcore: Convert mpcore_rirq_state to QOM realize
  realview_gic: Prepare for QOM embedding
  realview_gic: Convert to QOM realize
  arm11mpcore: Convert ARM11MPCorePriveState to QOM realize
  arm11mpcore: Split off SCU device
  arm11mpcore: Create container MemoryRegion in instance_init
  ...

10 years agopcmcia/pxa2xx: QOM'ify PXA2xxPCMCIAState
Andreas Färber [Sat, 3 Aug 2013 10:23:05 +0000 (12:23 +0200)]
pcmcia/pxa2xx: QOM'ify PXA2xxPCMCIAState

Turn it into a SysBusDevice and use a container MemoryRegion.

Add a link<pcmcia-card> property to the PCMCIACardState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoide: Drop ide_init2_with_non_qdev_drives()
Andreas Färber [Sat, 3 Aug 2013 09:30:50 +0000 (11:30 +0200)]
ide: Drop ide_init2_with_non_qdev_drives()

All its users have finally been converted.

Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agomicrodrive: Coding Style cleanups
Andreas Färber [Sat, 3 Aug 2013 08:32:49 +0000 (10:32 +0200)]
microdrive: Coding Style cleanups

Add missing braces.

Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agopcmcia: QOM'ify PCMCIACardState and MicroDriveState
Andreas Färber [Wed, 17 Jul 2013 17:46:16 +0000 (19:46 +0200)]
pcmcia: QOM'ify PCMCIACardState and MicroDriveState

Turn PCMCIACardState into a device.
Move callbacks to new PCMCIACardClass.

Derive TYPE_MICRODRIVE from TYPE_PCMCIA_CARD.
Replace ide_init2_with_non_qdev_drives().

Signed-off-by: Othmar Pasteka <pasteka@kabsi.at>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agopxa: Fix typo "dettach"
Andreas Färber [Wed, 17 Jul 2013 17:06:47 +0000 (19:06 +0200)]
pxa: Fix typo "dettach"

Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoqom: Fix pointer to int property helpers' documentation
Michael S. Tsirkin [Mon, 7 Oct 2013 09:35:01 +0000 (12:35 +0300)]
qom: Fix pointer to int property helpers' documentation

Relocate to alongside the other object_property_add_* helpers while at it.

Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoqdev-monitor: Inline qdev_init() for device_add
Andreas Färber [Mon, 7 Oct 2013 14:42:34 +0000 (16:42 +0200)]
qdev-monitor: Inline qdev_init() for device_add

For historic reasons, qdev_init() unparents the device on failure.
Inline this to make the error paths clearer and consistent.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoqdev-monitor: Avoid qdev as variable name
Andreas Färber [Mon, 7 Oct 2013 14:17:54 +0000 (16:17 +0200)]
qdev-monitor: Avoid qdev as variable name

Prepares for bringing error cleanup code into canonical QOM form.

Includes a whitespace removal after curly brace by Stefan.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoqdev: Drop misleading qdev_free() function
Stefan Hajnoczi [Wed, 11 Sep 2013 12:54:09 +0000 (14:54 +0200)]
qdev: Drop misleading qdev_free() function

The qdev_free() function name is misleading since all the function does
is unlink the device from its parent.  The device is not necessarily
freed.

The device will be freed when its QObject refcount reaches zero.  It is
usual for the parent (bus) to hold the final reference but there are
cases where something else holds a reference so "free" is a misleading
name.

Call object_unparent(obj) directly instead of having a qdev wrapper
function.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoqdev-monitor: Unref device when device_add fails
Stefan Hajnoczi [Tue, 10 Sep 2013 16:21:08 +0000 (18:21 +0200)]
qdev-monitor: Unref device when device_add fails

qdev_device_add() leaks the created device upon failure.  I suspect this
problem crept in because qdev_free() unparents the device but does not
drop a reference - confusing name.

Cc: qemu-stable@nongnu.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoqdev-monitor: Fix crash when device_add is called with abstract driver
Igor Mammedov [Tue, 17 Sep 2013 13:32:32 +0000 (15:32 +0200)]
qdev-monitor: Fix crash when device_add is called with abstract driver

User is able to crash running QEMU when following monitor
command is called:

 device_add intel-hda-generic

Crash is caused by assertion in object_initialize_with_type()
when type is abstract.

Checking if type is abstract before instance is created in
qdev_device_add() allows to prevent crash on incorrect user input.

Cc: qemu-stable@nongnu.org
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoqdev-monitor: Clean up qdev_device_add() variable naming
Andreas Färber [Fri, 23 Aug 2013 23:21:22 +0000 (01:21 +0200)]
qdev-monitor: Clean up qdev_device_add() variable naming

Avoid confusion between object (obj) and object class (oc).
Tidy DeviceClass variable while at it (k -> dc).

Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoarm11mpcore: Split off RealView MPCore
Andreas Färber [Sun, 18 Aug 2013 23:33:59 +0000 (01:33 +0200)]
arm11mpcore: Split off RealView MPCore

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoarm11mpcore: Prepare for QOM embedding
Andreas Färber [Sun, 18 Aug 2013 23:27:19 +0000 (01:27 +0200)]
arm11mpcore: Prepare for QOM embedding

Move state struct, type constant and cast macro to a new header.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoarm11mpcore: Convert mpcore_rirq_state to QOM realize
Andreas Färber [Sun, 18 Aug 2013 21:38:15 +0000 (23:38 +0200)]
arm11mpcore: Convert mpcore_rirq_state to QOM realize

Embed ARM11MPCorePriveState and RealViewGICState and replace SysBus
initfn with realizefn.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agorealview_gic: Prepare for QOM embedding
Andreas Färber [Sun, 18 Aug 2013 22:48:55 +0000 (00:48 +0200)]
realview_gic: Prepare for QOM embedding

Move state struct, type constant and cast macro to a new header.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agorealview_gic: Convert to QOM realize
Andreas Färber [Sun, 18 Aug 2013 22:37:07 +0000 (00:37 +0200)]
realview_gic: Convert to QOM realize

Embed GICState and replace SysBus initfn with realizefn.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoarm11mpcore: Convert ARM11MPCorePriveState to QOM realize
Andreas Färber [Sun, 18 Aug 2013 20:04:31 +0000 (22:04 +0200)]
arm11mpcore: Convert ARM11MPCorePriveState to QOM realize

Embed child devices and replace SysBus initfn with realizefn.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoarm11mpcore: Split off SCU device
Andreas Färber [Sun, 18 Aug 2013 18:07:36 +0000 (20:07 +0200)]
arm11mpcore: Split off SCU device

Inspired by a9scu.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoarm11mpcore: Create container MemoryRegion in instance_init
Andreas Färber [Sun, 18 Aug 2013 18:48:33 +0000 (20:48 +0200)]
arm11mpcore: Create container MemoryRegion in instance_init

This allows to map the region directly after object initialization.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoarm11mpcore: Drop unused fields
Andreas Färber [Sun, 18 Aug 2013 20:08:59 +0000 (22:08 +0200)]
arm11mpcore: Drop unused fields

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoarm11mpcore: Fix typo in MemoryRegion name
Andreas Färber [Sun, 18 Aug 2013 18:36:33 +0000 (20:36 +0200)]
arm11mpcore: Fix typo in MemoryRegion name

"mpcode" -> "mpcore"

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoa9scu: Build only once
Andreas Färber [Sun, 18 Aug 2013 19:00:29 +0000 (21:00 +0200)]
a9scu: Build only once

It does not have a target or ARMCPU dependency.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoa15mpcore: Prepare for QOM embedding
Andreas Färber [Sun, 30 Jun 2013 19:31:01 +0000 (21:31 +0200)]
a15mpcore: Prepare for QOM embedding

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
10 years agoa15mpcore: Convert to QOM realize
Andreas Färber [Sun, 30 Jun 2013 19:22:54 +0000 (21:22 +0200)]
a15mpcore: Convert to QOM realize

Turn SysBusDevice initfn into a QOM realizefn.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
10 years agoa15mpcore: Embed GICState
Andreas Färber [Sun, 30 Jun 2013 19:20:26 +0000 (21:20 +0200)]
a15mpcore: Embed GICState

This covers both emulated and KVM GIC.

Prepares for QOM realize.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
10 years agoa15mpcore: Split off instance_init
Andreas Färber [Sun, 30 Jun 2013 19:07:31 +0000 (21:07 +0200)]
a15mpcore: Split off instance_init

Prepares for QOM realize.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
10 years agoa9mpcore: Prepare for QOM embedding
Andreas Färber [Sun, 30 Jun 2013 18:44:23 +0000 (20:44 +0200)]
a9mpcore: Prepare for QOM embedding

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
10 years agoa9mpcore: Convert to QOM realize
Andreas Färber [Sun, 30 Jun 2013 18:36:15 +0000 (20:36 +0200)]
a9mpcore: Convert to QOM realize

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
10 years agoa9mpcore: Embed ARMMPTimerState
Andreas Färber [Sun, 30 Jun 2013 18:30:27 +0000 (20:30 +0200)]
a9mpcore: Embed ARMMPTimerState

Prepares for QOM realize.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
10 years agoarm_mptimer: Convert to QOM realize
Andreas Färber [Sun, 30 Jun 2013 17:42:55 +0000 (19:42 +0200)]
arm_mptimer: Convert to QOM realize

Split the SysBusDevice initfn into instance_init and realizefn.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
10 years agoa9mpcore: Embed A9SCUState
Andreas Färber [Sun, 30 Jun 2013 17:29:36 +0000 (19:29 +0200)]
a9mpcore: Embed A9SCUState

Prepares for QOM realize.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
10 years agoa9scu: QOM cleanups
Andreas Färber [Sun, 30 Jun 2013 17:22:12 +0000 (19:22 +0200)]
a9scu: QOM cleanups

Rename A9SCUState::busdev field to parent_obj and turn realizefn into an
instance_init function to allow early MMIO mapping.

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
10 years agoa9mpcore: Embed GICState
Andreas Färber [Sun, 30 Jun 2013 17:01:18 +0000 (19:01 +0200)]
a9mpcore: Embed GICState

Prepares for conversion to QOM realize.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
10 years agoarm_gic: Extract headers hw/intc/arm_gic{,_common}.h
Andreas Färber [Tue, 23 Jul 2013 01:37:49 +0000 (03:37 +0200)]
arm_gic: Extract headers hw/intc/arm_gic{,_common}.h

Rename NCPU to GIC_NCPU and move GICState away from gic_internal.h.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoa9mpcore: Split off instance_init
Andreas Färber [Sun, 30 Jun 2013 17:52:31 +0000 (19:52 +0200)]
a9mpcore: Split off instance_init

Prepares for QOM realize.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
10 years agomilkymist-uart: Use Device::realize instead of SysBusDevice::init
Antony Pavlov [Sat, 31 Aug 2013 17:22:40 +0000 (21:22 +0400)]
milkymist-uart: Use Device::realize instead of SysBusDevice::init

Use of SysBusDevice::init is deprecated. Use Device::realize instead.

Also introduce TypeInfo::instance_init milkymist_uart_init().

Reported-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoqtest: Prepare QOM machine tests
Andreas Färber [Mon, 29 Jul 2013 03:44:47 +0000 (05:44 +0200)]
qtest: Prepare QOM machine tests

Instantiate all [*] machines per target, so that they get a bit of test
coverage at all. This has proven helpful during QOM refactorings.

[*] ppcemb target contains some non-working non-embedded machines, and
ppc405 CPUs are not available there either.
i386 and x86_64 do not cover pc*-x.y or xenfv.

Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoleon3: Don't enforce use of -bios with qtest
Andreas Färber [Sun, 4 Aug 2013 15:58:58 +0000 (17:58 +0200)]
leon3: Don't enforce use of -bios with qtest

Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoshix: Don't require firmware presence for qtest
Andreas Färber [Sun, 4 Aug 2013 15:51:15 +0000 (17:51 +0200)]
shix: Don't require firmware presence for qtest

Adopt error_report() while at it.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoshix: Drop debug output
Andreas Färber [Sun, 4 Aug 2013 15:53:24 +0000 (17:53 +0200)]
shix: Drop debug output

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agomilkymist: Suppress -kernel/-bios/-drive error for qtest
Andreas Färber [Sun, 4 Aug 2013 14:49:28 +0000 (16:49 +0200)]
milkymist: Suppress -kernel/-bios/-drive error for qtest

Acked-by: Michael Walle <michael@walle.cc>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoan5206: Don't enforce use of kernel for qtest
Andreas Färber [Mon, 29 Jul 2013 16:48:58 +0000 (18:48 +0200)]
an5206: Don't enforce use of kernel for qtest

Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agomcf5208: Don't enforce use of kernel for qtest
Andreas Färber [Mon, 29 Jul 2013 16:47:21 +0000 (18:47 +0200)]
mcf5208: Don't enforce use of kernel for qtest

Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoaxis_dev88: Don't enforce use of kernel for qtest
Andreas Färber [Mon, 29 Jul 2013 16:40:20 +0000 (18:40 +0200)]
axis_dev88: Don't enforce use of kernel for qtest

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoarmv7m: Don't enforce use of kernel for qtest
Andreas Färber [Mon, 29 Jul 2013 16:36:59 +0000 (18:36 +0200)]
armv7m: Don't enforce use of kernel for qtest

Adopt error_report().

Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoexynos4_boards: Silence lack of -smp 2 warning for qtest
Andreas Färber [Mon, 29 Jul 2013 16:29:54 +0000 (18:29 +0200)]
exynos4_boards: Silence lack of -smp 2 warning for qtest

Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoomap_sx1: Don't enforce use of kernel or flash for qtest
Andreas Färber [Mon, 29 Jul 2013 16:27:58 +0000 (18:27 +0200)]
omap_sx1: Don't enforce use of kernel or flash for qtest

Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agopalm: Don't enforce loading ROM or kernel for qtest
Andreas Färber [Mon, 29 Jul 2013 16:24:47 +0000 (18:24 +0200)]
palm: Don't enforce loading ROM or kernel for qtest

Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoz2: Don't enforce use of -pflash for qtest
Andreas Färber [Mon, 29 Jul 2013 15:15:55 +0000 (17:15 +0200)]
z2: Don't enforce use of -pflash for qtest

Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agogumstix: Don't enforce use of -pflash for qtest
Andreas Färber [Mon, 29 Jul 2013 15:15:01 +0000 (17:15 +0200)]
gumstix: Don't enforce use of -pflash for qtest

Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agomainstone: Don't enforce use of -pflash for qtest
Andreas Färber [Mon, 29 Jul 2013 15:12:41 +0000 (17:12 +0200)]
mainstone: Don't enforce use of -pflash for qtest

Simply skip flash setup for now.

Also drop useless debug output.

Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agopuv3: Turn puv3_load_kernel() into a no-op for qtest without -kernel
Andreas Färber [Mon, 29 Jul 2013 16:43:57 +0000 (18:43 +0200)]
puv3: Turn puv3_load_kernel() into a no-op for qtest without -kernel

Replacing the assert() with more user-friendly error handling is left
for a follow-up.

Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agomips_mipssim: Silence BIOS loading warning for qtest
Andreas Färber [Mon, 29 Jul 2013 15:01:37 +0000 (17:01 +0200)]
mips_mipssim: Silence BIOS loading warning for qtest

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoMerge tag 'for_anthony' of git://git.kernel.org/pub/scm/virt/kvm/mst/qemu
Andreas Färber [Tue, 5 Nov 2013 16:46:04 +0000 (17:46 +0100)]
Merge tag 'for_anthony' of git://git.kernel.org/pub/scm/virt/kvm/mst/qemu

pci, pc, pvpanic bug fixes

This fixes strange pvpanic behaviour: you had to
pause to let VM continue (and potentially reboot on panic
if enabled).

This also fixes two bugs reported by Andreas.
One is a long-standing bug exposed by recent pci changes,
the other affects old piix machine types and was caused
by recent acpi changes.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoossaudio: do not enable by default
Anthony Liguori [Sun, 3 Nov 2013 16:45:54 +0000 (08:45 -0800)]
ossaudio: do not enable by default

Modern Linux's no longer support /dev/dsp so enabling it by
default causes audio failures on newer Linux distros.

Signed-off-by: Anthony Liguori <aliguori@amazon.com>
Tested-by: Andreas Färber <afaerber@suse.de>
Message-id: 1383497154-9271-1-git-send-email-aliguori@amazon.com

10 years agoMerge remote-tracking branch 'spice/spice.v76' into staging
Anthony Liguori [Tue, 5 Nov 2013 16:39:49 +0000 (08:39 -0800)]
Merge remote-tracking branch 'spice/spice.v76' into staging

# By Gerd Hoffmann
# Via Gerd Hoffmann
* spice/spice.v76:
  qxl: replace pipe signaling with bottom half

Message-id: 1383656322-24150-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoMerge remote-tracking branch 'mst/tags/for_anthony' into staging
Anthony Liguori [Tue, 5 Nov 2013 16:29:56 +0000 (08:29 -0800)]
Merge remote-tracking branch 'mst/tags/for_anthony' into staging

pci, pc, pvpanic bug fixes

This fixes strange pvpanic behaviour: you had to
pause to let VM continue (and potentially reboot on panic
if enabled).

This also fixes two bugs reported by Andreas.
One is a long-standing bug exposed by recent pci changes,
the other affects old piix machine types and was caused
by recent acpi changes.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
# gpg: Signature made Mon 04 Nov 2013 05:42:46 AM PST using RSA key ID D28D5469
# gpg: Can't check signature: public key not found

# By Michael S. Tsirkin (2) and Paolo Bonzini (1)
# Via Michael S. Tsirkin
* mst/tags/for_anthony:
  vl: allow "cont" from panicked state
  exec: limit system memory size
  pc: disable acpi info for isapc and old pc machine

Message-id: 1383572851-28326-1-git-send-email-mst@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoMerge remote-tracking branch 'kraxel/e820.1' into staging
Anthony Liguori [Tue, 5 Nov 2013 16:26:57 +0000 (08:26 -0800)]
Merge remote-tracking branch 'kraxel/e820.1' into staging

# By Gerd Hoffmann
# Via Gerd Hoffmann
* kraxel/e820.1:
  pc: register e820 entries for ram
  pc: add etc/e820 fw_cfg file

Message-id: 1383567431-13540-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agovl: allow "cont" from panicked state
Paolo Bonzini [Mon, 4 Nov 2013 13:30:47 +0000 (14:30 +0100)]
vl: allow "cont" from panicked state

After reporting the GUEST_PANICKED monitor event, QEMU stops the VM.
The reason for this is that events are edge-triggered, and can be lost if
management dies at the wrong time.  Stopping a panicked VM lets management
know of a panic even if it has crashed; management can learn about the
panic when it restarts and queries running QEMU processes.  The downside
is of course that the VM will be paused while management is not running,
but that is acceptable if it only happens with explicit "-device pvpanic".

Upon learning of a panic, management (if configured to do so) can pick a
variety of behaviors: leave the VM paused, reset it, destroy it.  In
addition to all of these behaviors, it is possible to dump the VM core
from the host.

However, right now, the panicked state is irreversible, and can only be
exited by resetting the machine.  This means that any policy decision
is entirely in the hands of the host.  In particular there is no way to
use the "reboot on panic" option together with pvpanic.

This patch makes the panicked state reversible (and removes various
workarounds that were there because of the state being irreversible).
With this change, management has a wider set of possible policies: it
can just log the crash and leave policy to the guest, it can leave the
VM paused.  In particular, the "log the crash and continue" is implemented
simply by sending a "cont" as soon as management learns about the panic.
Management could also implement the "irreversible paused state" itself.
And again, all such actions can be coupled with dumping the VM core.

Unfortunately we cannot change the behavior of 1.6.0.  Thus, even if
it uses "-device pvpanic", management should check for "cont" failures.
If "cont" fails, management can then log that the VM remained paused
and urge the administrator to update QEMU.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoexec: limit system memory size
Michael S. Tsirkin [Mon, 4 Nov 2013 06:06:08 +0000 (08:06 +0200)]
exec: limit system memory size

The page table logic in exec.c assumes
that memory addresses are at most TARGET_PHYS_ADDR_SPACE_BITS.

But pci addresses are full 64 bit so if we try to render them ignoring
the extra bits, we get strange effects with sections overlapping each
other.

To fix, simply limit the system memory size to
 1 << TARGET_PHYS_ADDR_SPACE_BITS,
pci addresses will be rendered within that.

Cc: qemu-stable@nongnu.org
Reported-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agopc: disable acpi info for isapc and old pc machine
Michael S. Tsirkin [Mon, 4 Nov 2013 10:42:46 +0000 (12:42 +0200)]
pc: disable acpi info for isapc and old pc machine

Disable acpi build for isapc and no_kvmclock machine
types (used by xen), since acpi build currently expects pci.

Reported-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>