sdk/emulator/qemu.git
11 years agoqdev: Fix 32-bit compilation in print_size
Richard Henderson [Tue, 30 Jul 2013 18:20:42 +0000 (08:20 -1000)]
qdev: Fix 32-bit compilation in print_size

Signed-off-by: Richard Henderson <rth@twiddle.net>
Message-id: 1375208443-17288-2-git-send-email-rth@twiddle.net
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'spice/spice.v72' into staging
Anthony Liguori [Tue, 30 Jul 2013 23:48:58 +0000 (18:48 -0500)]
Merge remote-tracking branch 'spice/spice.v72' into staging

# By Gerd Hoffmann
# Via Gerd Hoffmann
* spice/spice.v72:
  spice: fix display initialization

Message-id: 1375173625-3784-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'kraxel/usb.85' into staging
Anthony Liguori [Tue, 30 Jul 2013 23:48:54 +0000 (18:48 -0500)]
Merge remote-tracking branch 'kraxel/usb.85' into staging

# By Gerd Hoffmann (2) and Alexey Kardashevskiy (1)
# Via Gerd Hoffmann
* kraxel/usb.85:
  hcd-ohci: add dma error handling
  uhci: egsm fix
  xhci: handle USB_RET_IOERROR

Message-id: 1375173371-3378-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'borntraeger/s390-for-1.6' into staging
Anthony Liguori [Tue, 30 Jul 2013 23:48:36 +0000 (18:48 -0500)]
Merge remote-tracking branch 'borntraeger/s390-for-1.6' into staging

* borntraeger/s390-for-1.6:
  s390: Implement dump-guest-memory support for target s390x
  s390x/kvm: Remove redundant return code
  s390x/kvm: Reworked/fixed handling of cc3 in kvm_handle_css_inst()
  s390x/ioinst: Fixed priority of operand exceptions
  s390x/ioinst: Fixed alignment check in SCHM instruction
  s390x/ioinst: Throw addressing exception when memory_map failed
  s390x/ioinst: Add missing alignment checks for IO instructions
  s390/sclpconsole: handle char layer busy conditions

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomips_r4k: Silence BIOS loading warning for qtest
Andreas Färber [Mon, 29 Jul 2013 14:05:33 +0000 (16:05 +0200)]
mips_r4k: Silence BIOS loading warning for qtest

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1375106733-832-6-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomips_jazz: Silence BIOS loading warning for qtest
Andreas Färber [Mon, 29 Jul 2013 14:05:32 +0000 (16:05 +0200)]
mips_jazz: Silence BIOS loading warning for qtest

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1375106733-832-5-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomips_malta: Silence BIOS loading warning for qtest
Andreas Färber [Mon, 29 Jul 2013 14:05:31 +0000 (16:05 +0200)]
mips_malta: Silence BIOS loading warning for qtest

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1375106733-832-4-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomips_fulong2e: Silence BIOS loading warning for qtest
Andreas Färber [Mon, 29 Jul 2013 14:05:30 +0000 (16:05 +0200)]
mips_fulong2e: Silence BIOS loading warning for qtest

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1375106733-832-3-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotarget-ppc: Suppress TCG instruction emulation warnings for qtest
Andreas Färber [Mon, 29 Jul 2013 14:05:29 +0000 (16:05 +0200)]
target-ppc: Suppress TCG instruction emulation warnings for qtest

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1375106733-832-2-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agochardev: fix CHR_EVENT_OPENED events for mux chardevs
Michael Roth [Tue, 30 Jul 2013 18:04:22 +0000 (13:04 -0500)]
chardev: fix CHR_EVENT_OPENED events for mux chardevs

As of bd5c51ee6c4f1c79cae5ad2516d711a27b4ea8ec, chardevs no longer use
bottom-halves to issue CHR_EVENT_OPENED events. To maintain past
semantics, we instead defer the CHR_EVENT_OPENED events toward the end
of chardev initialization.

For muxes, this isn't good enough, since a range of FEs must be able
to attach to the mux prior to any CHR_EVENT_OPENED being issued, else
each FE will immediately print it's initial output (prompts, banners,
etc.) just prior to us switching to the next FE as part of
initialization.

The is new and confusing behavior for users, as they'll see output for
things like the HMP monitor, even though their the current mux focus
may be a guest serial port with potentially no output.

We fix this by further deferring CHR_EVENT_OPENED events for FEs
associated with muxes until after machine init by flagging mux chardevs
with 'explicit_be_open', which suppresses emission of CHR_EVENT_OPENED
events until we explicitly set the mux as opened later.

Currently, we must defer till after machine init since we potentially
associate FEs with muxes as part of realize (for instance,
serial_isa_realizefn).

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Message-id: 1375207462-8141-1-git-send-email-mdroth@linux.vnet.ibm.com
Cc: qemu-stable@nongnu.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotci: Fix broken build (compiler warning caused by redefined macro BIT)
Stefan Weil [Tue, 30 Jul 2013 20:41:23 +0000 (22:41 +0200)]
tci: Fix broken build (compiler warning caused by redefined macro BIT)

The definition of macro BIT in tci/tcg-target.c now conflicts with the
definition of the same macro in includes qemu/bitops.h.

This conflict was triggered by a recent change in the include chain of
tcg.c (probably commit 949fc82314cc84162e64a5323764527a542421ce).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Message-id: 1375216883-23969-1-git-send-email-sw@weilnetz.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotarget-mips: correct the values in the DSP tests
Petar Jovanovic [Mon, 29 Jul 2013 10:49:05 +0000 (12:49 +0200)]
target-mips: correct the values in the DSP tests

Five tests files for DSP instructions had wrong expected values in the tests.
This change fixes this, and this has been cross-checked by running the same
test binaries on Malta 74K board.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agos390: Implement dump-guest-memory support for target s390x
Ekaterina Tumanova [Wed, 10 Jul 2013 13:26:46 +0000 (15:26 +0200)]
s390: Implement dump-guest-memory support for target s390x

With this patch dump-guest-memory on s390 produces an ELF formatted,
crash-readable dump.
In order to implement this, the arch-specific part of dump-guest-memory
was added:
target-s390x/arch_dump.c contains the whole set of function for writing
Elf note sections of all types for s390x.

Signed-off-by: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
[fixed indentation, use CamelCase, rename note_t to Note, use S390CPU]
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
11 years agos390x/kvm: Remove redundant return code
Thomas Huth [Tue, 2 Jul 2013 12:45:16 +0000 (14:45 +0200)]
s390x/kvm: Remove redundant return code

Removed the redundant return code statement from handle_instruction() - it
always returned 0 and never reports any errors to its caller, since errors
from the sub-functions are already reported via program exceptions instead.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
11 years agos390x/kvm: Reworked/fixed handling of cc3 in kvm_handle_css_inst()
Thomas Huth [Mon, 24 Jun 2013 13:17:34 +0000 (15:17 +0200)]
s390x/kvm: Reworked/fixed handling of cc3 in kvm_handle_css_inst()

Consolidated the setting of the condition code in kvm_handle_css_inst().
For the (unhandled) instructions EQBS and SQBS, we have to return
an operation exception instead of cc3. Also removed the is_ioinst()
function to avoid decoding the opcode twice.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
11 years agos390x/ioinst: Fixed priority of operand exceptions
Thomas Huth [Tue, 25 Jun 2013 12:59:12 +0000 (14:59 +0200)]
s390x/ioinst: Fixed priority of operand exceptions

Operand exceptions have a lower priority than specification and address
exceptions. Thus the checks for operand exceptions must be done later.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
11 years agos390x/ioinst: Fixed alignment check in SCHM instruction
Thomas Huth [Fri, 21 Jun 2013 13:57:31 +0000 (15:57 +0200)]
s390x/ioinst: Fixed alignment check in SCHM instruction

Register 2 only has to be aligned to a 32-byte boundary, not a
full page boundary.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
11 years agos390x/ioinst: Throw addressing exception when memory_map failed
Thomas Huth [Fri, 21 Jun 2013 11:12:45 +0000 (13:12 +0200)]
s390x/ioinst: Throw addressing exception when memory_map failed

So far, the IO instructions were throwing specification exceptions when
there was a problem with accessing the memory. However, the better way
is to throw an addressing exception instead.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
11 years agos390x/ioinst: Add missing alignment checks for IO instructions
Thomas Huth [Fri, 21 Jun 2013 08:13:42 +0000 (10:13 +0200)]
s390x/ioinst: Add missing alignment checks for IO instructions

The IO instructions MSCH, SSCH, STSCH, TSCH, STCRW and TPI require
that the second operand address must be aligned on a word boundary.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
11 years agos390/sclpconsole: handle char layer busy conditions
Heinz Graalfs [Tue, 28 May 2013 13:03:55 +0000 (15:03 +0200)]
s390/sclpconsole: handle char layer busy conditions

Handle busy conditions (errno=EAGAIN) in char layer by using
the new char layer in the sclp console.

Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
11 years agohcd-ohci: add dma error handling
Alexey Kardashevskiy [Fri, 26 Jul 2013 10:52:05 +0000 (20:52 +1000)]
hcd-ohci: add dma error handling

Current hcd-ohci does not handle DMA errors. However they may happen
so here we introduce simple error handling.

On such errors, a typical OHCI will stop operating, signal the guest
about the error by sending "UnrecoverableError Event", set itself into
error state and set "Detected Parity Error" in its PCI config space
to signal that it got an error and so does the patch.

This also adds ohci_die() call to ohci_bus_start() to handle possible
failure of qemu_new_timer_ns().

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agouhci: egsm fix
Gerd Hoffmann [Wed, 26 Jun 2013 15:05:06 +0000 (17:05 +0200)]
uhci: egsm fix

When the guest goes suspend the uhci controller while there are
pending resume requests on the ports go signal global resume
instantly.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoxhci: handle USB_RET_IOERROR
Gerd Hoffmann [Thu, 25 Jul 2013 11:12:35 +0000 (13:12 +0200)]
xhci: handle USB_RET_IOERROR

https://bugzilla.redhat.com/show_bug.cgi?id=980377

Cc: qemu-stable@nongnu.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agospice: fix display initialization
Gerd Hoffmann [Mon, 22 Jul 2013 13:34:12 +0000 (15:34 +0200)]
spice: fix display initialization

Spice has two display interface implementations:  One integrated into
the qxl graphics card, and one generic which can operate with every
qemu-emulated graphics card.

The generic one is activated in case spice is used without qxl.  The
logic for that only caught the "-vga qxl" case, "-device qxl-vga" goes
unnoticed.  Fix that by adding a check in the spice interface
registration so we'll notice the qxl card no matter how it is created.

https://bugzilla.redhat.com/show_bug.cgi?id=981094

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoUpdate version for 1.6.0-rc0
Anthony Liguori [Tue, 30 Jul 2013 01:30:29 +0000 (20:30 -0500)]
Update version for 1.6.0-rc0

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoseccomp: add arch_prctl() to the syscall whitelist
Paul Moore [Thu, 18 Jul 2013 13:57:03 +0000 (09:57 -0400)]
seccomp: add arch_prctl() to the syscall whitelist

It appears that even a very simple /etc/qemu-ifup configuration can
require the arch_prctl() syscall, see the example below:

#!/bin/sh
/sbin/ifconfig $1 0.0.0.0 up
/usr/sbin/brctl addif <switch> $1

Signed-off-by: Paul Moore <pmoore@redhat.com>
Reviewed-by: Eduardo Otubo <otubo@linux.vnet.ibm.com>
Message-id: 20130718135703.8247.19213.stgit@localhost
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoseccomp: add additional asynchronous I/O syscalls
Paul Moore [Mon, 15 Jul 2013 19:32:01 +0000 (15:32 -0400)]
seccomp: add additional asynchronous I/O syscalls

A previous commit, "seccomp: add the asynchronous I/O syscalls to the
whitelist", added several asynchronous I/O syscalls but left out the
io_submit() and io_cancel() syscalls.  This patch corrects this by
adding the two missing asynchronous I/O syscalls.

Signed-off-by: Paul Moore <pmoore@redhat.com>
Reviewed-by: Eduardo Otubo <otubo@linux.vnet.ibm.com>
Message-id: 20130715193201.943.4913.stgit@localhost
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agolinux-user: Return success from m68k set_thread_area syscall
Peter Maydell [Mon, 29 Jul 2013 10:31:49 +0000 (11:31 +0100)]
linux-user: Return success from m68k set_thread_area syscall

The m68k set_thread_area syscall implementation failed to set the
return value. Correctly set it zero, since this syscall will always
succeed.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375093909-13653-1-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agolinux-user/signal.c: Avoid using uninitialized data in ARM sigreturn
Peter Maydell [Mon, 29 Jul 2013 11:00:32 +0000 (12:00 +0100)]
linux-user/signal.c: Avoid using uninitialized data in ARM sigreturn

Rephrase code used in ARM sigreturn functions to avoid using
uninitialized variables. This fixes one genuine problem ('frame'
would not be initialized if we took the error-exit path because
our stackpointer was misaligned) and one which is clang being
alarmist (frame_addr wouldn't be initialized, though this is
harmless since unlock_user_struct ignores its second argument
in these cases; however since we don't generally make use of
this not-really-documented effect it's better avoided).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375095632-13735-3-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agolinux-user/signal.c: PPC: Silence clang uninitialized-use warning
Peter Maydell [Mon, 29 Jul 2013 11:00:31 +0000 (12:00 +0100)]
linux-user/signal.c: PPC: Silence clang uninitialized-use warning

Silence a clang warning in a PPC signal return function:

/home/petmay01/linaro/qemu-from-laptop/qemu/linux-user/signal.c:4611:9: error: variable 'sr_addr' is used
      uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
    if (!lock_user_struct(VERIFY_READ, sc, sc_addr, 1))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/petmay01/linaro/qemu-from-laptop/qemu/linux-user/signal.c:4636:28: note: uninitialized use occurs here
    unlock_user_struct(sr, sr_addr, 1);
                           ^~~~~~~
/home/petmay01/linaro/qemu-from-laptop/qemu/linux-user/qemu.h:442:27: note: expanded from macro 'unlock_user_struct'
    unlock_user(host_ptr, guest_addr, (copy) ? sizeof(*host_ptr) : 0)
                          ^

This happens when we unlock a user struct which we never
attempted to lock. Strictly, clang is actually wrong here -- it
hasn't been able to spot that unlock_user_struct() doesn't use
its second argument if the first is NULL. However it doesn't
seem too unreasonable to demand that we pass in initialized
values to it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375095632-13735-2-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agospapr: Rename 'dprintf' to 'DPRINTF'
Peter Maydell [Mon, 29 Jul 2013 12:16:39 +0000 (13:16 +0100)]
spapr: Rename 'dprintf' to 'DPRINTF'

'dprintf' is the name of a POSIX standard function so we should not be
stealing it for our debug macro. Rename to 'DPRINTF' (in line with
a number of other source files.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Acked-by: Richard Henderson <rth@twiddle.net>
Acked-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 1375100199-13934-5-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotarget-ppc/kvm.c: Rename 'dprintf' to 'DPRINTF'
Peter Maydell [Mon, 29 Jul 2013 12:16:38 +0000 (13:16 +0100)]
target-ppc/kvm.c: Rename 'dprintf' to 'DPRINTF'

'dprintf' is the name of a POSIX standard function so we should not be
stealing it for our debug macro. Rename to 'DPRINTF' (in line with
a number of other source files.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Acked-by: Richard Henderson <rth@twiddle.net>
Acked-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 1375100199-13934-4-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agos390x: Rename 'dprintf' to 'DPRINTF'
Peter Maydell [Mon, 29 Jul 2013 12:16:37 +0000 (13:16 +0100)]
s390x: Rename 'dprintf' to 'DPRINTF'

'dprintf' is the name of a POSIX standard function so we should not be
stealing it for our debug macro. Rename to 'DPRINTF' (in line with
a number of other source files.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Acked-by: Richard Henderson <rth@twiddle.net>
Acked-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 1375100199-13934-3-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoblock/sheepdog: Rename 'dprintf' to 'DPRINTF'
Peter Maydell [Mon, 29 Jul 2013 12:16:36 +0000 (13:16 +0100)]
block/sheepdog: Rename 'dprintf' to 'DPRINTF'

'dprintf' is the name of a POSIX standard function so we should not be
stealing it for our debug macro. Rename to 'DPRINTF' (in line with
a number of other source files.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Acked-by: Richard Henderson <rth@twiddle.net>
Acked-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 1375100199-13934-2-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopc: limit 64 bit hole to 2G by default
Igor Mammedov [Mon, 29 Jul 2013 14:47:57 +0000 (16:47 +0200)]
pc: limit 64 bit hole to 2G by default

It turns out that some 32 bit windows guests crash
if 64 bit PCI hole size is >2G.
Limit it to 2G for piix and q35 by default.
User may override default 64-bit PCI hole size by
using "pci-hole64-size" property.

Examples:
-global i440FX-pcihost.pci-hole64-size=4G

-global q35-pcihost.pci-hole64-size=4G

Reported-by: Igor Mammedov <imammedo@redhat.com>,
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Message-id: 1375109277-25561-8-git-send-email-imammedo@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqdev: Add SIZE type to qdev properties
Vasilis Liaskovitis [Mon, 29 Jul 2013 14:47:56 +0000 (16:47 +0200)]
qdev: Add SIZE type to qdev properties

This patch adds a 'SIZE' type property to qdev.

Signed-off-by: Ian Molton <ian.molton@collabora.co.uk>
Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Message-id: 1375109277-25561-7-git-send-email-imammedo@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqapi: make visit_type_size fallback to type_int
Vasilis Liaskovitis [Mon, 29 Jul 2013 14:47:55 +0000 (16:47 +0200)]
qapi: make visit_type_size fallback to type_int

Currently visit_type_size checks if the visitor's type_size function pointer is
NULL. If not, it calls it, otherwise it calls v->type_uint64(). But neither of
these pointers are ever set. Fallback to calling v->type_int() in this third
(default) case.

Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Message-id: 1375109277-25561-6-git-send-email-imammedo@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopc: add Q35 to QOM composition tree under /machine
Igor Mammedov [Mon, 29 Jul 2013 14:47:54 +0000 (16:47 +0200)]
pc: add Q35 to QOM composition tree under /machine

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Message-id: 1375109277-25561-5-git-send-email-imammedo@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopc: replace i440fx_common_init() with i440fx_init()
Igor Mammedov [Mon, 29 Jul 2013 14:47:53 +0000 (16:47 +0200)]
pc: replace i440fx_common_init() with i440fx_init()

It isn't used anywhere else.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Message-id: 1375109277-25561-4-git-send-email-imammedo@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopc: add I440FX QOM cast macro
Igor Mammedov [Mon, 29 Jul 2013 14:47:52 +0000 (16:47 +0200)]
pc: add I440FX QOM cast macro

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Message-id: 1375109277-25561-3-git-send-email-imammedo@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopc: move IO_APIC_DEFAULT_ADDRESS to include/hw/i386/ioapic.h
Michael S. Tsirkin [Mon, 29 Jul 2013 14:47:51 +0000 (16:47 +0200)]
pc: move IO_APIC_DEFAULT_ADDRESS to include/hw/i386/ioapic.h

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Message-id: 1375109277-25561-2-git-send-email-imammedo@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'afaerber/tags/qom-devices-for-anthony' into staging
Anthony Liguori [Mon, 29 Jul 2013 19:39:49 +0000 (14:39 -0500)]
Merge remote-tracking branch 'afaerber/tags/qom-devices-for-anthony' into staging

QOM device refactorings

* Replace all uses of FROM_SYSBUS() macro with QOM cast macros
  i) "QOM cast cleanup for X"
     Indicates a mechanical 1:1 between TYPE_* and *State.
  ii) "QOM'ify X and Y"
      Indicates abstract types may have been inserted or similar changes
      to type hierarchy.
  ii) Renames
      Coding Style fixes such as CamelCase have been applied in some cases.
* Fix for sparc floppy - cf. ii) above
* Change PCI type hierarchy to provide PCI_BRIDGE() casts
* In doing so, prepare for adopting QOM realize

# gpg: Signature made Mon 29 Jul 2013 02:15:22 PM CDT using RSA key ID 3E7E013F
# gpg: Can't check signature: public key not found

# By Andreas Färber (171) and others
# Via Andreas Färber
* afaerber/tags/qom-devices-for-anthony: (173 commits)
  sysbus: QOM parent field cleanup for SysBusDevice
  spapr_pci: QOM cast cleanup
  ioapic: QOM cast cleanup
  kvm/ioapic: QOM cast cleanup
  kvmvapic: QOM cast cleanup
  mipsnet: QOM cast cleanup
  opencores_eth: QOM cast cleanup
  exynos4210_i2c: QOM cast cleanup
  sysbus: Remove unused sysbus_new() prototype
  sysbus: Drop FROM_SYSBUS()
  xilinx_timer: QOM cast cleanup
  tusb6010: QOM cast cleanup
  slavio_timer: QOM cast cleanup
  pxa2xx_timer: QOM'ify pxa25x-timer and pxa27x-timer
  puv3_ost: QOM cast cleanup
  pl031: QOM cast cleanup
  pl031: Rename pl031_state to PL031State
  milkymist-sysctl: QOM cast cleanup
  m48t59: QOM cast cleanup for M48t59SysBusState
  lm32_timer: QOM cast cleanup
  ...

11 years agosysbus: QOM parent field cleanup for SysBusDevice
Andreas Färber [Sat, 27 Jul 2013 14:40:42 +0000 (16:40 +0200)]
sysbus: QOM parent field cleanup for SysBusDevice

Rename the parent field and hide it from gtk-doc.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agospapr_pci: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 14:39:37 +0000 (16:39 +0200)]
spapr_pci: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoioapic: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 14:31:42 +0000 (16:31 +0200)]
ioapic: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agokvm/ioapic: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 14:30:47 +0000 (16:30 +0200)]
kvm/ioapic: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agokvmvapic: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 14:27:41 +0000 (16:27 +0200)]
kvmvapic: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomipsnet: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 13:59:07 +0000 (15:59 +0200)]
mipsnet: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoopencores_eth: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 13:56:28 +0000 (15:56 +0200)]
opencores_eth: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoexynos4210_i2c: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 13:50:02 +0000 (15:50 +0200)]
exynos4210_i2c: QOM cast cleanup

Fix one ->qdev access and rename parent field.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agosysbus: Remove unused sysbus_new() prototype
Andreas Färber [Sat, 27 Jul 2013 13:45:51 +0000 (15:45 +0200)]
sysbus: Remove unused sysbus_new() prototype

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agosysbus: Drop FROM_SYSBUS()
Andreas Färber [Sat, 27 Jul 2013 13:39:20 +0000 (15:39 +0200)]
sysbus: Drop FROM_SYSBUS()

As a replacement, use your own macro based on OBJECT_CHECK().

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoxilinx_timer: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 13:32:47 +0000 (15:32 +0200)]
xilinx_timer: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotusb6010: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 13:30:21 +0000 (15:30 +0200)]
tusb6010: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoslavio_timer: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 13:24:22 +0000 (15:24 +0200)]
slavio_timer: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopxa2xx_timer: QOM'ify pxa25x-timer and pxa27x-timer
Andreas Färber [Sat, 27 Jul 2013 13:20:20 +0000 (15:20 +0200)]
pxa2xx_timer: QOM'ify pxa25x-timer and pxa27x-timer

Introduce type constant for new abstract base type, use QOM casts and
let both non-abstract types inherit from the new base type.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopuv3_ost: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 13:12:40 +0000 (15:12 +0200)]
puv3_ost: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopl031: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 13:10:14 +0000 (15:10 +0200)]
pl031: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopl031: Rename pl031_state to PL031State
Andreas Färber [Sat, 27 Jul 2013 13:07:44 +0000 (15:07 +0200)]
pl031: Rename pl031_state to PL031State

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomilkymist-sysctl: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 13:06:42 +0000 (15:06 +0200)]
milkymist-sysctl: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agom48t59: QOM cast cleanup for M48t59SysBusState
Andreas Färber [Sat, 27 Jul 2013 13:01:49 +0000 (15:01 +0200)]
m48t59: QOM cast cleanup for M48t59SysBusState

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agolm32_timer: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 12:54:54 +0000 (14:54 +0200)]
lm32_timer: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agogrlib_gptimer: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 12:52:32 +0000 (14:52 +0200)]
grlib_gptimer: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoexynos4210_rtc: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 12:49:12 +0000 (14:49 +0200)]
exynos4210_rtc: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoexynos4210_pwm: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 12:45:47 +0000 (14:45 +0200)]
exynos4210_pwm: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoexynos4210_mct: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 12:41:50 +0000 (14:41 +0200)]
exynos4210_mct: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoetraxfs_timer: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 12:34:22 +0000 (14:34 +0200)]
etraxfs_timer: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoetraxfs_timer: Rename etrax_timer to ETRAXTimerState
Andreas Färber [Sat, 27 Jul 2013 12:30:31 +0000 (14:30 +0200)]
etraxfs_timer: Rename etrax_timer to ETRAXTimerState

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocadence_ttc: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 12:28:31 +0000 (14:28 +0200)]
cadence_ttc: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoarm_timer: QOM cast cleanup for icp_pit_state
Andreas Färber [Sat, 27 Jul 2013 12:20:25 +0000 (14:20 +0200)]
arm_timer: QOM cast cleanup for icp_pit_state

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoarm_timer: QOM cast cleanup for SP804State
Andreas Färber [Sat, 27 Jul 2013 12:17:41 +0000 (14:17 +0200)]
arm_timer: QOM cast cleanup for SP804State

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoarm_timer: Rename sp804_state to SP804State
Andreas Färber [Sat, 27 Jul 2013 12:15:46 +0000 (14:15 +0200)]
arm_timer: Rename sp804_state to SP804State

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoxilinx_spi: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 12:07:22 +0000 (14:07 +0200)]
xilinx_spi: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopl022: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 12:03:29 +0000 (14:03 +0200)]
pl022: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopl022: Rename pl022_state to PL022State
Andreas Färber [Sat, 27 Jul 2013 12:00:25 +0000 (14:00 +0200)]
pl022: Rename pl022_state to PL022State

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agosun4u: QOM cast cleanup for RamDevice
Andreas Färber [Sat, 27 Jul 2013 11:50:51 +0000 (13:50 +0200)]
sun4u: QOM cast cleanup for RamDevice

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agosun4u: QOM cast cleanup for PROMState
Andreas Färber [Sat, 27 Jul 2013 11:48:18 +0000 (13:48 +0200)]
sun4u: QOM cast cleanup for PROMState

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agosun4m: QOM cast cleanup for RamDevice
Andreas Färber [Sat, 27 Jul 2013 11:45:23 +0000 (13:45 +0200)]
sun4m: QOM cast cleanup for RamDevice

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agosun4m: QOM cast cleanup for PROMState
Andreas Färber [Sat, 27 Jul 2013 11:42:29 +0000 (13:42 +0200)]
sun4m: QOM cast cleanup for PROMState

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agosun4m: QOM cast cleanup for AFXState
Andreas Färber [Sat, 27 Jul 2013 11:38:44 +0000 (13:38 +0200)]
sun4m: QOM cast cleanup for AFXState

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agosun4m: QOM cast cleanup for IDRegState
Andreas Färber [Sat, 27 Jul 2013 11:33:46 +0000 (13:33 +0200)]
sun4m: QOM cast cleanup for IDRegState

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopl181: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 11:23:41 +0000 (13:23 +0200)]
pl181: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopl181: Rename pl181_state to PL181State
Andreas Färber [Sat, 27 Jul 2013 11:20:09 +0000 (13:20 +0200)]
pl181: Rename pl181_state to PL181State

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomilkymist-memcard: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 11:18:50 +0000 (13:18 +0200)]
milkymist-memcard: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoppce500_spin: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 11:03:07 +0000 (13:03 +0200)]
ppce500_spin: QOM cast cleanup

Introduce type constant and use QOM cast.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agods1225y: QOM cast cleanup for SysBusNvRamState
Andreas Färber [Sat, 27 Jul 2013 10:50:29 +0000 (12:50 +0200)]
ds1225y: QOM cast cleanup for SysBusNvRamState

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agods1225y: Drop bogus qdev field from NvRamState
Andreas Färber [Sat, 27 Jul 2013 10:47:09 +0000 (12:47 +0200)]
ds1225y: Drop bogus qdev field from NvRamState

It is not a device, and the field is not used from code either.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoxilinx_ethlite: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 10:43:06 +0000 (12:43 +0200)]
xilinx_ethlite: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoxgmac: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 10:35:15 +0000 (12:35 +0200)]
xgmac: QOM cast cleanup

Introduce type constant and use QOM casts and typedef consistently.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agostellaris_enet: Fix NetClientInfo::cleanup
Andreas Färber [Sat, 27 Jul 2013 10:27:46 +0000 (12:27 +0200)]
stellaris_enet: Fix NetClientInfo::cleanup

Drop freeing stellaris_enet_state - that is done by QOM later on unref.

Both MemoryRegion init and savevm registration happen in SysBusDevice
initfn currently, so move them into an unrealizefn for now.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agostellaris_enet: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 10:23:22 +0000 (12:23 +0200)]
stellaris_enet: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agosmc91c111: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 10:17:48 +0000 (12:17 +0200)]
smc91c111: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomilkymist-minimac2: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 10:13:17 +0000 (12:13 +0200)]
milkymist-minimac2: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agolance: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 10:08:14 +0000 (12:08 +0200)]
lance: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agolan9118: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 09:55:02 +0000 (11:55 +0200)]
lan9118: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoetraxfs_eth: Rename fs_eth to ETRAXFSEthState
Andreas Färber [Sat, 27 Jul 2013 09:48:42 +0000 (11:48 +0200)]
etraxfs_eth: Rename fs_eth to ETRAXFSEthState

Also add a typedef.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoetraxfs_eth: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 09:44:01 +0000 (11:44 +0200)]
etraxfs_eth: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocadence_gem: QOM cast cleanup
Andreas Färber [Sat, 27 Jul 2013 09:39:47 +0000 (11:39 +0200)]
cadence_gem: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agozynq_slcr: QOM cast cleanup
Andreas Färber [Fri, 26 Jul 2013 21:29:03 +0000 (23:29 +0200)]
zynq_slcr: QOM cast cleanup

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoslavio_misc: QOM cast cleanup for APCState
Andreas Färber [Fri, 26 Jul 2013 21:21:50 +0000 (23:21 +0200)]
slavio_misc: QOM cast cleanup for APCState

Signed-off-by: Andreas Färber <afaerber@suse.de>