]> git.proxmox.com Git - qemu.git/log
qemu.git
10 years agoMerge remote-tracking branch 'luiz/queue/qmp' into staging
Anthony Liguori [Wed, 13 Nov 2013 19:49:27 +0000 (11:49 -0800)]
Merge remote-tracking branch 'luiz/queue/qmp' into staging

# By Luiz Capitulino (1) and Richard Henderson (1)
# Via Luiz Capitulino
* luiz/queue/qmp:
  MAINTAINERS: add git tree info for HMP, QMP and QAPI
  Adjust qapi-visit for python-2.4.3

Message-id: 1384281985-11100-1-git-send-email-lcapitulino@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoMerge remote-tracking branch 'mst/tags/for_anthony' into staging
Anthony Liguori [Wed, 13 Nov 2013 19:48:35 +0000 (11:48 -0800)]
Merge remote-tracking branch 'mst/tags/for_anthony' into staging

pci, pc, virtio bug fixes

This reverts PCI master abort support - we'll want it
eventually but it exposes too many core bugs to be safe for 1.7.
This also reverts a recent exec.c change that was an
attempt to work-around some of these core bugs.

Also included are small fixes in pc and virtio,
and a core loader fix for PPC bamboo.

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

# By Michael S. Tsirkin (3) and others
# Via Michael S. Tsirkin
* mst/tags/for_anthony:
  Revert "exec: limit system memory size"
  Revert "hw/pci: partially handle pci master abort"
  loader: drop return value for rom_add_blob_fixed
  acpi-build: disable with -no-acpi
  virtio-net: only delete bh that existed
  Fix pc migration from qemu <= 1.5

Message-id: 1384159176-31662-1-git-send-email-mst@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoMerge remote-tracking branch 'stefanha/net' into staging
Anthony Liguori [Wed, 13 Nov 2013 19:48:02 +0000 (11:48 -0800)]
Merge remote-tracking branch 'stefanha/net' into staging

# By Dmitry Fleytman (1) and others
# Via Stefan Hajnoczi
* stefanha/net:
  virtio-net: broken RX filtering logic fixed
  net: fix qemu_flush_queued_packets() in presence of a hub
  net: disallow to specify multicast MAC address

Message-id: 1383928804-28866-1-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoMerge remote-tracking branch 'stefanha/block' into staging
Anthony Liguori [Wed, 13 Nov 2013 19:47:44 +0000 (11:47 -0800)]
Merge remote-tracking branch 'stefanha/block' into staging

# By Jeff Cody (26) and others
# Via Stefan Hajnoczi
* stefanha/block: (37 commits)
  block: Round up total_sectors
  block: vhdx qemu-iotest - log replay of data sector
  block: qemu-iotests for vhdx, add write test support
  block: vhdx - update _make_test_img() to filter out vhdx options
  block: vhdx - add .bdrv_create() support
  block: vhdx - fix comment typos in header, fix incorrect struct fields
  block: vhdx - break out code operations to functions
  block: vhdx - move more endian translations to vhdx-endian.c
  block: vhdx - remove BAT file offset bit shifting
  block: vhdx write support
  block: vhdx - add log write support
  block: vhdx - add region overlap detection for image files
  block: vhdx - log parsing, replay, and flush support
  block: vhdx code movement - move vhdx_close() above vhdx_open()
  block: vhdx - update log guid in header, and first write tracker
  block: vhdx - break endian translation functions out
  block: vhdx - log support struct and defines
  block: vhdx code movement - VHDXMetadataEntries and BDRVVHDXState to header.
  block: vhdx - add header update capability.
  block: vhdx - minor comments and typo correction.
  ...

Message-id: 1383905551-16411-1-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoMerge remote-tracking branch 'filippov/tags/20131108-xtensa' into staging
Anthony Liguori [Wed, 13 Nov 2013 19:47:06 +0000 (11:47 -0800)]
Merge remote-tracking branch 'filippov/tags/20131108-xtensa' into staging

Two small fixes for 1.7:

- add missing debug feature to dc233c xtensa core;
- fix qemu abort caused by gdb attempt to invalidate a breakpoint by
  virtual address for which there's no mapping.

# gpg: Signature made Thu 07 Nov 2013 09:32:19 PM PST using RSA key ID F83FA044
# gpg: Can't check signature: public key not found

# By Max Filippov
# Via Max Filippov
* filippov/tags/20131108-xtensa:
  target-xtensa: add missing DEBUG section to dc233c config
  exec: fix breakpoint_invalidate when pc may not be translated

Message-id: 1383889643-21621-1-git-send-email-jcmvbkbc@gmail.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoMerge remote-tracking branch 'kraxel/audio.3' into staging
Anthony Liguori [Wed, 13 Nov 2013 19:46:23 +0000 (11:46 -0800)]
Merge remote-tracking branch 'kraxel/audio.3' into staging

# By Gerd Hoffmann
# Via Gerd Hoffmann
* kraxel/audio.3:
  ossaudio: check for oss support in oss_audio_init
  Revert "ossaudio: do not enable by default"

Message-id: 1383823947-5132-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoMerge remote-tracking branch 'sweil/mingw' into staging
Anthony Liguori [Wed, 13 Nov 2013 19:45:58 +0000 (11:45 -0800)]
Merge remote-tracking branch 'sweil/mingw' into staging

# By Stefan Weil
# Via Stefan Weil
* sweil/mingw:
  linux-user: Fix stat64 syscall for SPARC64
  configure: Add config.status to recreate the current configuration
  nsis: Improved support for parallel installation of 32 and 64 bit code

Message-id: 1383804909-376-1-git-send-email-sw@weilnetz.de
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoconsole: Remove unused debug code
Stefan Weil [Sun, 10 Nov 2013 14:58:19 +0000 (15:58 +0100)]
console: Remove unused debug code

The local function console_print_text_attributes is no longer used since
commit 7d6ba01c3741bc32ae252bf64a5fd3f930c2df4f.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoqga: Fix compilation for old versions of MinGW
Stefan Weil [Sun, 10 Nov 2013 17:49:11 +0000 (18:49 +0100)]
qga: Fix compilation for old versions of MinGW

While MinGW-w64 can compile the qga code, MinGW from Debian lenny
(gcc-mingw32 4.4.2-3) shows these errors:

In file included from qga/vss-win32.c:17:
qga/vss-win32/requester.h:31:
 error: expected »=«, »,«, »;«, »asm« or »__attribute__« before »requester_init«
qga/vss-win32/requester.h:32:
 error: expected »=«, »,«, »;«, »asm« or »__attribute__« before »requester_deinit«

The macro STDAPI is unknown, so add the missing include file which
defines it.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years ago.travis.yml: basic compile and check recipes
Alex Bennée [Wed, 6 Nov 2013 10:43:37 +0000 (10:43 +0000)]
.travis.yml: basic compile and check recipes

This adds a build matrix definition for travis-ci.org continuous
integration service. It is usable on any public repository hosted on
GitHub. Once you have created an account signed into Travis you can
enable it on selected projects via travis-ci.org/profile. Alternatively
you can configure the service hooks on GitHub via the repository
Settings tab,then Service Hooks and selecting Travis.

Once setup Travis will automatically test every push as well as any pull
requests submitted to that repository.

The build matrix is currently split by target architecture (see TARGETS
environment variable) because a full build of QEMU can take some time.
This way you get quick feedback for any obvious errors. The additional
environment variables exist to allow additional builds to tweak the
environment. These are:

EXTRA_CONFIG - extra terms passed to configure
EXTRA_PKGS - extra dev packages to install
TEST_CMD - default "make check", can be overridden

I've confined the additional stuff to x86/x86_64 for convenience.

As Travis supports clang the main builds are done twice (once for gcc
and once for clang). However clang is disabled for the debug/trace
builds for the purposes of brevity.

Other wrinkles:

 * The lttng user-space tracing back-end is disabled
   (it is currently horribly broken)
 * The ftrace back-end doesn't run "make check"
   (it requires a mounted debugfs to work)
 * There are two debug enabled build (with and without TCG interpreter)

Signed-off-by: Alex Bennée <alex@bennee.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agopci-assign: Fix error_report of pci-stub message
Cole Robinson [Fri, 11 Oct 2013 15:52:30 +0000 (11:52 -0400)]
pci-assign: Fix error_report of pci-stub message

Using multiple calls to error_report here means every line is
prefaced with the (potentially long) pci-assign command line
arguments.

Use a single error_printf to preserve the intended formatting.
Since this code path is always preceded by an error_report call,
we don't lose the command line reporting.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
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: Michael Tokarev <mjt@tls.msk.ru>
10 years agovl: fix build when configured with no graphic support
Antony Pavlov [Tue, 29 Oct 2013 04:36:31 +0000 (08:36 +0400)]
vl: fix build when configured with no graphic support

The following error occurs when building with no graphic output support:

  vl.c: In function ‘main’:
  vl.c:2829:19: error: variable ‘ds’ set but not used [-Werror=unused-but-set-variable]
       DisplayState *ds;
                     ^
  cc1: all warnings being treated as errors

To reproduce this issue, just run:

  $ ./configure \
      --disable-curses \
      --disable-sdl \
      --disable-cocoa \
      --disable-gtk \
      --disable-vnc \
      --enable-werror
  $ make vl.o

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agousb: drop unused USBNetState.inpkt field
Stefan Hajnoczi [Tue, 29 Oct 2013 14:44:31 +0000 (15:44 +0100)]
usb: drop unused USBNetState.inpkt field

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoqemu-char: add missing characters used in keymaps
Jan Krupa [Wed, 16 Oct 2013 12:40:06 +0000 (14:40 +0200)]
qemu-char: add missing characters used in keymaps

This patch adds all missing characters used in regional keymap
files which already exist in QEMU. I checked for the missing
characters by going through all of the keymaps and matching that
with records in vnc_keysym.h. If the key wasn't found I looked
it up in libxkbcommon library [1]. If I understood it correctly
this is also the same place where most of the keymaps were
exported from according to the comment on the first line in those
files. I was able to find all symbols except "quotebl" used
in Netherland keymap.

I tested this update with Czech keyboard by myself. I also asked
Matej Serc to test Slovenian keyboard layout - he reported problems
with it few days ago on this mailing list. Both layouts seems
to work fine. I wasn't able to test the remaining layouts but
since this change doesn't modify any existing symbols, just adds
new ones, I don't expect any sideeffects.

[1] http://cgit.freedesktop.org/xorg/lib/libxkbcommon

Signed-off-by: Jan Krupa <jkrupa@suse.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoqemu-char: add support for U-prefixed symbols
Jan Krupa [Wed, 16 Oct 2013 12:40:05 +0000 (14:40 +0200)]
qemu-char: add support for U-prefixed symbols

This patch adds support for Unicode symbols in keymap files. This
feature was already used in some keyboard layouts in QEMU generated
from XKB (e.g. Arabic) but it wasn't implemented in QEMU source code.

There is no need for check of validity of the hex string after U character
because strtol returns 0 in case the conversion was unsuccessful.

Signed-off-by: Jan Krupa <jkrupa@suse.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoqemu-char: add Czech keymap file
Jan Krupa [Wed, 16 Oct 2013 12:40:04 +0000 (14:40 +0200)]
qemu-char: add Czech keymap file

This patch adds Czech keyboard layout to available keymap files
and Makefile.

Signed-off-by: Jan Krupa <jkrupa@suse.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoqemu-char: add Czech characters to VNC keysyms
Jan Krupa [Wed, 16 Oct 2013 12:40:03 +0000 (14:40 +0200)]
qemu-char: add Czech characters to VNC keysyms

This patch adds missing Czech characters to the VNC keysym table.

Signed-off-by: Jan Krupa <jkrupa@suse.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoMAINTAINERS: add git tree info for HMP, QMP and QAPI
Luiz Capitulino [Tue, 5 Nov 2013 21:09:37 +0000 (16:09 -0500)]
MAINTAINERS: add git tree info for HMP, QMP and QAPI

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agoAdjust qapi-visit for python-2.4.3
Richard Henderson [Thu, 31 Oct 2013 20:26:01 +0000 (13:26 -0700)]
Adjust qapi-visit for python-2.4.3

We say we support python 2.4, but python 2.4.3 does not
support the "expr if test else expr" syntax used here.

This allows QEMU to compile on RHEL 5.3, the last release for ia64.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agoRevert "exec: limit system memory size"
Michael S. Tsirkin [Sun, 10 Nov 2013 09:54:33 +0000 (11:54 +0200)]
Revert "exec: limit system memory size"

This reverts commit 818f86b88394b7b2b59d313e51043fe15a8004db.

This was a work-around for bugs elsewhere in the system,
exposed by commit a53ae8e934cd54686875b5bcfc2f434244ee55d6:
    "hw/pci: partially handle pci master abort"
since that's reverted now, the work-around is not required for 1.7
anymore.
The proper fix is supporting full 64 bit addresses in the radix tree.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Marcel Apfelbaum <marcel.a@redhat.com>
10 years agoRevert "hw/pci: partially handle pci master abort"
Marcel Apfelbaum [Sun, 10 Nov 2013 09:49:57 +0000 (11:49 +0200)]
Revert "hw/pci: partially handle pci master abort"

This reverts commit a53ae8e934cd54686875b5bcfc2f434244ee55d6.

The patch being reverted introduced a low-priority memory region
covering all 64 bit pci address space.  This exposed the following bugs
elsewhere in the code:
 1. Some memory regions have INT64_MAX size, where the
    intent was all 64 bit address space.
    This results in a sub-page region, should be UINT64_MAX.
 2. page table rendering in exec.c ignores physical address bits
    above TARGET_PHYS_ADDR_SPACE_BITS.
    Access outside this range (e.g. from device DMA, or gdb stub)
    ends up with a wrong region.  Registering a region outside this
    range leads to page table corruption.
 3. Some regions overlap PCI hole and have same priority.
    This only works as long as no device uses the overlapping address.

It doesn't look like we can resolve all issues in time for 1.7.
Let's fix the bugs first and apply afterwards for 1.8.

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoloader: drop return value for rom_add_blob_fixed
Michael S. Tsirkin [Sun, 10 Nov 2013 09:53:30 +0000 (11:53 +0200)]
loader: drop return value for rom_add_blob_fixed

rom_add_blob never fails, and neither does rom_add_blob_fixed,
so there's no need to return value from it.

In fact, rom_add_blob_fixed was erroneously returning -1 unconditionally
which made the only system that checked the return value -M bamboo fail
to start.

Drop the return value and drop checks from ppc440_bamboo to
fix this failure.

Reported-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoacpi-build: disable with -no-acpi
Michael S. Tsirkin [Thu, 7 Nov 2013 12:12:05 +0000 (14:12 +0200)]
acpi-build: disable with -no-acpi

QEMU will currently crash if started with -no-acpi flag
since acpi build code probes the PM device which isn't present
in this configuration.

To fix, don't expose ACPI tables to guest when acpi has been
disabled from command line.

Fixes LP# 1248854
https://bugs.launchpad.net/qemu/+bug/1248854

Reported-by: chao zhou <chao.zhou@intel.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.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>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoFix pc migration from qemu <= 1.5
Cole Robinson [Tue, 5 Nov 2013 23:46:27 +0000 (18:46 -0500)]
Fix pc migration from qemu <= 1.5

The following commit introduced a migration incompatibility:

commit 568f0690fd9aa4d39d84b04c1a5dbb53a915c3fe
Author: David Gibson <david@gibson.dropbear.id.au>
Date:   Thu Jun 6 18:48:49 2013 +1000

    pci: Replace pci_find_domain() with more general pci_root_bus_path()

The issue is that i440fx savevm idstr went from 0000:00:00.0/I440FX to
0000:00.0/I440FX. Unfortunately we are stuck with the breakage for
1.6 machine types.

Add a compat property to maintain the busted idstr for the 1.6 machine
types, but revert to the old style format for 1.7+, and <= 1.5.

Tested with migration from qemu 1.5, qemu 1.6, and qemu.git.

Cc: qemu-stable@nongnu.org
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agovirtio-net: broken RX filtering logic fixed
Dmitry Fleytman [Sun, 22 Sep 2013 15:09:13 +0000 (18:09 +0300)]
virtio-net: broken RX filtering logic fixed

Upon processing of VIRTIO_NET_CTRL_MAC_TABLE_SET command
multicast list overwrites unicast list in mac_table.
This leads to broken logic for both unicast and multicast RX filtering.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agonet: fix qemu_flush_queued_packets() in presence of a hub
Sergey Fedorov [Tue, 5 Nov 2013 06:54:29 +0000 (10:54 +0400)]
net: fix qemu_flush_queued_packets() in presence of a hub

Do not return after net_hub_flush(). Always flush callee network client
incoming queue.

Signed-off-by: Sergey Fedorov <s.fedorov@samsung.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agonet: disallow to specify multicast MAC address
Dmitry Krivenok [Mon, 21 Oct 2013 08:08:44 +0000 (12:08 +0400)]
net: disallow to specify multicast MAC address

[Assigning a multicast MAC address to a NIC leads to confusing behavior.
Reject multicast MAC addresses so users are alerted to their error
straight away.

The "net/eth.h" in6_addr rename prevents a name collision with
<netinet/in.h> on Linux.
-- Stefan]

Signed-off-by: Dmitry V. Krivenok <krivenok.dmitry@gmail.com>
Reviewed-by: Amos Kong <kongjianjun@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: Round up total_sectors
Fam Zheng [Wed, 6 Nov 2013 11:48:06 +0000 (19:48 +0800)]
block: Round up total_sectors

Since b94a2610, bdrv_getlength() is omitted when probing image. VMDK
monolithicFlat is broken by that because a file < 512 bytes can't be
read with its total_sectors truncated to 0. This patch round up the size
to BDRV_SECTOR_SIZE, when a image size is not sector aligned.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agotarget-xtensa: add missing DEBUG section to dc233c config
Max Filippov [Sun, 20 Oct 2013 00:15:23 +0000 (04:15 +0400)]
target-xtensa: add missing DEBUG section to dc233c config

This fixes missing debug feature opcodes of dc233c core variant.

Cc: qemu-stable@nongnu.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
10 years agoexec: fix breakpoint_invalidate when pc may not be translated
Max Filippov [Fri, 27 Sep 2013 18:29:17 +0000 (22:29 +0400)]
exec: fix breakpoint_invalidate when pc may not be translated

This fixes qemu abort with the following message:

    include/qemu/int128.h:22: int128_get64: Assertion `!a.hi' failed.

which happens due to attempt to invalidate breakpoint by virtual address
for which get_phys_page_debug couldn't find mapping.

For more details see
http://lists.nongnu.org/archive/html/qemu-devel/2013-09/msg04582.html

Cc: qemu-stable@nongnu.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agopseries: Update SLOF firmware image
Alexey Kardashevskiy [Tue, 15 Oct 2013 05:00:33 +0000 (16:00 +1100)]
pseries: Update SLOF firmware image

SLOF git commit is e2e8ac901e617573ea383f9cffd136146d0675a4

The main changes are:
* fixed bug with not passing arguments from -append
* client-architecture-support hypercall
* netboot
* USB stack fixes

The full list of changes:
  > client-architecture-support: fix wrong version read
  > client-architecture-support: fix redundant stack drop
  > Update device tree returned by CAS hypercall
  > fdt: introduce fdt-init
  > Add ibm,client-architecture-support method
  > Kernel parameter passed from qemu commandline ignored
  > Allow more than one client to open net devices simultaneously
  > ci: add missing close in else condition
  > Add GPT support
  > pci: fix interrupt-map for bridges
  > usb-ohci: preserve the toggleCarry bit in ED
  > usb-ohci: done_head processing fixes
  > usb-ohci: update init and rationalize timings
  > usb-msc: handle stall and other fixes
  > scsi: make probe more error resilient
  > usb-core: Add CLEAR FEATURE api
  > Implement range allocator
  > Remove bcm57xx network driver as module
  > Remove e1000 network driver as module
  > Remove virtio-net network driver as module
  > Remove veth network driver as module
  > Add missing close-dev in ping
  > Remove lodable network driver modules and related functions
  > Add bcm57xx network driver in libbcm
  > Add e1000 network driver in libe1k
  > Add virtio-net driver in libvirtio
  > Add veth driver in libveth
  > Get MAC address for client interface module
  > Add SLOF usleep wrapper
  > Add SLOF pci wrapper functions
  > Fix 'canon' client interface

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agospapr: add vio-bus devices to categories
Alexey Kardashevskiy [Fri, 11 Oct 2013 03:08:20 +0000 (14:08 +1100)]
spapr: add vio-bus devices to categories

In order to get devices appear in output of
"./qemu-system-ppc64 -device ?",
they must be assigned to one of DEVICE_CATEGORY_XXXX.

This puts VIO devices classes to corresponding categories.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoblock: vhdx qemu-iotest - log replay of data sector
Jeff Cody [Wed, 30 Oct 2013 14:44:56 +0000 (10:44 -0400)]
block: vhdx qemu-iotest - log replay of data sector

This tests the replay of a data sector in a VHDX image file.

The image file is a 10G dynamic image, with 4MB block size.  The
image was created with qemu-img, and the log left unplayed by
modification of the vhdx image format driver.

It was verified under both QEMU and Hyper-V that the image file,
post log replay, matched.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: qemu-iotests for vhdx, add write test support
Jeff Cody [Wed, 30 Oct 2013 14:44:55 +0000 (10:44 -0400)]
block: qemu-iotests for vhdx, add write test support

This removes the IMGFMT_GENERIC blocker for read-only, so existing
iotests run read/write tests for vhdx images created by qemu-img (e.g.
tests 001, 002, 003).

In addition, this updates the sample image test for the Hyper-V
created image, to verify we can write it as well.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: vhdx - update _make_test_img() to filter out vhdx options
Jeff Cody [Wed, 30 Oct 2013 14:44:54 +0000 (10:44 -0400)]
block: vhdx - update _make_test_img() to filter out vhdx options

The non-global option output is suppresed in _make_test_img() for
output verification in the 0?? tests.  This adds suppression for
the vhdx-unique options as well.  This allows check -vhdx to run
successfully.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: vhdx - add .bdrv_create() support
Jeff Cody [Wed, 30 Oct 2013 14:44:53 +0000 (10:44 -0400)]
block: vhdx - add .bdrv_create() support

This adds support for VHDX image creation, for images of type "Fixed"
and "Dynamic".  "Differencing" types (i.e., VHDX images with backing
files) are currently not supported.

Options for image creation include:
    * log size:
        The size of the journaling log for VHDX.  Minimum is 1MB,
        and it must be a multiple of 1MB. Invalid log sizes will be
        silently fixed by rounding up to the nearest MB.

        Default is 1MB.

    * block size:
        This is the size of a payload block.  The range is 1MB to 256MB,
        inclusive, and must be a multiple of 1MB as well.  Invalid sizes
        and multiples will be silently fixed.  If '0' is passed, then
        a sane size is chosen (depending on virtual image size).

        Default is 0 (Auto-select).

    * subformat:
        - "dynamic"
            An image without data pre-allocated.
        - "fixed"
            An image with data pre-allocated.

        Default is "dynamic"

When creating the image file, the lettered sections are created:

-----------------------------------------------------------------.
|   (A)    |   (B)    |    (C)    |     (D)       |     (E)
|  File ID |  Header1 |  Header 2 |  Region Tbl 1 |  Region Tbl 2
|          |          |           |               |
.-----------------------------------------------------------------.
0         64KB      128KB       192KB           256KB          320KB

.---- ~ ----------- ~ ------------ ~ ---------------- ~ -----------.
|     (F)     |     (G)       |    (H)    |
| Journal Log |  BAT / Bitmap |  Metadata |  .... data ......
|             |               |           |
.---- ~ ----------- ~ ------------ ~ ---------------- ~ -----------.
1MB         (var.)          (var.)      (var.)

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: vhdx - fix comment typos in header, fix incorrect struct fields
Jeff Cody [Wed, 30 Oct 2013 14:44:52 +0000 (10:44 -0400)]
block: vhdx - fix comment typos in header, fix incorrect struct fields

VHDXPage83Data and VHDXParentLocatorHeader both incorrectly had their
MSGUID fields set as arrays of 16.  This is incorrect (it stems from
an early version where those fields were uint_8 arrays).  Those fields
were, up to this patch, unused.

Also, there were a couple of typos and incorrect wording in comments,
and those have been fixed up as well.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: vhdx - break out code operations to functions
Jeff Cody [Wed, 30 Oct 2013 14:44:51 +0000 (10:44 -0400)]
block: vhdx - break out code operations to functions

This is preperation for vhdx_create().  The ability to write headers,
and calculate the number of BAT entries will be needed within the
create() functions, so move this relevant code into helper functions.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: vhdx - move more endian translations to vhdx-endian.c
Jeff Cody [Wed, 30 Oct 2013 14:44:50 +0000 (10:44 -0400)]
block: vhdx - move more endian translations to vhdx-endian.c

In preparation for vhdx_create(), move more endian translation
functions out to vhdx-endian.c.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: vhdx - remove BAT file offset bit shifting
Jeff Cody [Wed, 30 Oct 2013 14:44:49 +0000 (10:44 -0400)]
block: vhdx - remove BAT file offset bit shifting

Bit shifting can be fun, but in this case it was unnecessary.  The
upper 44 bits of the 64-bit BAT entry is specifies the File Offset,
so we shifted the bits to get access to the value.

However, per the spec the value is in MB.  So we dutifully shifted back
to the left by 20 bits, to convert to a true uint64_t file offset.

This replaces those steps with just a bit mask, to get rid of the lower
20 bits instead.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: vhdx write support
Jeff Cody [Wed, 30 Oct 2013 14:44:48 +0000 (10:44 -0400)]
block: vhdx write support

This adds support for writing to VHDX image files, using coroutines.
Writes into the BAT table goes through the VHDX log.  Currently, BAT
table writes occur when expanding a dynamic VHDX file, and allocating a
new BAT entry.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: vhdx - add log write support
Jeff Cody [Wed, 30 Oct 2013 14:44:47 +0000 (10:44 -0400)]
block: vhdx - add log write support

This adds support for writing to the VHDX log.

For spec details, see VHDX Specification Format v1.00:
https://www.microsoft.com/en-us/download/details.aspx?id=34750

There are a few limitations to this log support:
1.) There is no caching yet
2.) The log is flushed after each entry

The primary write interface, vhdx_log_write_and_flush(), performs a log
write followed by an immediate flush of the log.

As each log entry sector is a minimum of 4KB, partial sector writes are
filled in with data from the disk write destination.

If the current file log GUID is 0, a new GUID is generated and updated
in the header.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: vhdx - add region overlap detection for image files
Jeff Cody [Wed, 30 Oct 2013 14:44:46 +0000 (10:44 -0400)]
block: vhdx - add region overlap detection for image files

Regions in the image file cannot overlap - the log, region tables,
and metdata must all be unique and non-overlapping.

This adds region checking by means of a QLIST; there can be a variable
number of regions and metadata (there may be metadata or region tables
that we do not recognize / know about, but are not required).

This adds the capability to register a region for later checking, and
to check against registered regions for any overlap.

Also, if neither the BAT or Metadata region tables are found, return
error.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: vhdx - log parsing, replay, and flush support
Jeff Cody [Wed, 30 Oct 2013 14:44:45 +0000 (10:44 -0400)]
block: vhdx - log parsing, replay, and flush support

This adds support for VHDX v0 logs, as specified in Microsoft's
VHDX Specification Format v1.00:
https://www.microsoft.com/en-us/download/details.aspx?id=34750

The following support is added:

* Log parsing, and validation - validate that an existing log
  is correct.

* Log search - search through an existing log, to find any valid
  sequence of entries.

* Log replay and flush - replay an existing log, and flush/clear
  the log when complete.

The VHDX log is a circular buffer, with elements (sectors) of 4KB.

A log entry is a variably-length number of sectors, that is
comprised of a header and 'descriptors', that describe each sector.

A log may contain multiple entries, know as a log sequence.  In a log
sequence, each log entry immediately follows the previous entry, with an
incrementing sequence number.  There can only ever be one active and
valid sequence in the log.

Each log entry must match the file log GUID in order to be valid (along
with other criteria).  Once we have flushed all valid log entries, we
marked the file log GUID to be zero, which indicates a buffer with no
valid entries.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: vhdx code movement - move vhdx_close() above vhdx_open()
Jeff Cody [Wed, 30 Oct 2013 14:44:44 +0000 (10:44 -0400)]
block: vhdx code movement - move vhdx_close() above vhdx_open()

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: vhdx - update log guid in header, and first write tracker
Jeff Cody [Wed, 30 Oct 2013 14:44:43 +0000 (10:44 -0400)]
block: vhdx - update log guid in header, and first write tracker

Allow tracking of first file write in the VHDX image, as well as
the ability to update the GUID in the header.  This is in preparation
for log support.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: vhdx - break endian translation functions out
Jeff Cody [Wed, 30 Oct 2013 14:44:42 +0000 (10:44 -0400)]
block: vhdx - break endian translation functions out

This moves the endian translation functions out from the vhdx.c source,
into a separate source file. In addition to the previously defined
endian functions, new endian translation functions for log support are
added as well.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: vhdx - log support struct and defines
Jeff Cody [Wed, 30 Oct 2013 14:44:41 +0000 (10:44 -0400)]
block: vhdx - log support struct and defines

This adds some magic number defines, and internal structure definitions
for VHDX log replay support.  The struct VHDXLogEntries does not reflect
an on-disk data structure, and thus does not need to be packed.

Some minor code style fixes are applied as well.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: vhdx code movement - VHDXMetadataEntries and BDRVVHDXState to header.
Jeff Cody [Wed, 30 Oct 2013 14:44:40 +0000 (10:44 -0400)]
block: vhdx code movement - VHDXMetadataEntries and BDRVVHDXState to header.

In preparation for VHDX log support, move these structures to the
header.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: vhdx - add header update capability.
Jeff Cody [Wed, 30 Oct 2013 14:44:39 +0000 (10:44 -0400)]
block: vhdx - add header update capability.

This adds the ability to update the headers in a VHDX image, including
generating a new MS-compatible GUID.

As VHDX depends on uuid.h, VHDX is now a configurable build option.  If
VHDX support is enabled, that will also enable uuid as well.  The
default is to have VHDX enabled.

To enable/disable VHDX:  --enable-vhdx, --disable-vhdx

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: vhdx - minor comments and typo correction.
Jeff Cody [Wed, 30 Oct 2013 14:44:38 +0000 (10:44 -0400)]
block: vhdx - minor comments and typo correction.

Just a couple of minor comments to help note where allocated
buffers are freed, and a typo fix.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/vpc: fix virtual size for images created with disk2vhd
Peter Lieven [Mon, 21 Oct 2013 14:00:18 +0000 (16:00 +0200)]
block/vpc: fix virtual size for images created with disk2vhd

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
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 agoossaudio: check for oss support in oss_audio_init
Gerd Hoffmann [Thu, 7 Nov 2013 11:24:41 +0000 (12:24 +0100)]
ossaudio: check for oss support in oss_audio_init

Check whenever the device path (/dev/dsp by default) exists and qemu is
allowed to access it.  Return NULL if it isn't, so ossaudio will not
be used on systems wihtout oss support (increasinly common on modern
linux systems).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoRevert "ossaudio: do not enable by default"
Gerd Hoffmann [Thu, 7 Nov 2013 11:25:02 +0000 (12:25 +0100)]
Revert "ossaudio: do not enable by default"

This reverts commit c905c5012ac0c6fde3b8094d2206a3139deddba2.

There is a better fix for the issue at hand.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agokvm: Fix uninitialized cpuid_data
Stefan Weil [Wed, 6 Nov 2013 21:35:27 +0000 (22:35 +0100)]
kvm: Fix uninitialized cpuid_data

This error was reported by valgrind when running qemu-system-x86_64
with kvm:

==975== Conditional jump or move depends on uninitialised value(s)
==975==    at 0x521C38: cpuid_find_entry (kvm.c:176)
==975==    by 0x5235BA: kvm_arch_init_vcpu (kvm.c:686)
==975==    by 0x4D5175: kvm_init_vcpu (kvm-all.c:267)
==975==    by 0x45035B: qemu_kvm_cpu_thread_fn (cpus.c:858)
==975==    by 0xD361E0D: start_thread (pthread_create.c:311)
==975==    by 0xD65E9EC: clone (clone.S:113)
==975==  Uninitialised value was created by a stack allocation
==975==    at 0x5226E4: kvm_arch_init_vcpu (kvm.c:446)

Instead of adding more memset calls for parts of cpuid_data, the existing
calls were removed and cpuid_data is now initialized completely in one
call.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
10 years agopci-assign: Remove dead code for direct I/O region access from userspace
Jan Kiszka [Mon, 4 Nov 2013 13:42:55 +0000 (14:42 +0100)]
pci-assign: Remove dead code for direct I/O region access from userspace

This feature was already deprecated back then in qemu-kvm, ie. before
pci-assign went upstream. assigned_dev_ioport_rw will never be invoked
with resource_fd < 0.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
10 years agolinux-user: Fix stat64 syscall for SPARC64
Stefan Weil [Wed, 30 Oct 2013 21:52:24 +0000 (22:52 +0100)]
linux-user: Fix stat64 syscall for SPARC64

Some targets use a stat64 structure for the stat64 syscall while others
use a stat structure. SPARC64 used the wrong kind.

Instead of extending the conditional compilation in syscall.c, now a
macro TARGET_HAS_STRUCT_STAT64 is defined whenever a target has a
target_stat64.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Erik de Castro Lopo <erikd@mega-nerd.com>
10 years agoconfigure: Add config.status to recreate the current configuration
Stefan Weil [Sun, 20 Oct 2013 16:39:21 +0000 (18:39 +0200)]
configure: Add config.status to recreate the current configuration

The latest configure invocation was saved in config-host.mak and could
be extracted from that file to recreate the configuration.

Now it is saved in a new file config.status which can be directly executed
to recreate the configuration. The file name and the comments were copied
from GNU autoconf.

Makefile now uses config.status, but also includes transitional code
for the old mechanism.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Fam Zheng <famz@redhat.com>
10 years agonsis: Improved support for parallel installation of 32 and 64 bit code
Stefan Weil [Sat, 28 Sep 2013 08:34:30 +0000 (10:34 +0200)]
nsis: Improved support for parallel installation of 32 and 64 bit code

32 and 64 bit variants of QEMU already had different default installation
directories, but used a common registry key for saving the choosen
directory. This is confusing for users who want to install both variants,
so fix it by using different registry keys.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
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>