]> git.proxmox.com Git - qemu.git/log
qemu.git
11 years agohw/tpci200: Fix compiler warning (redefined symbol with MinGW)
Stefan Weil [Mon, 21 Jan 2013 06:49:51 +0000 (07:49 +0100)]
hw/tpci200: Fix compiler warning (redefined symbol with MinGW)

STATUS_TIMEOUT is defined in winnt.h:

  CC    hw/tpci200.o
hw/tpci200.c:34:0:
 warning: "STATUS_TIMEOUT" redefined [enabled by default]
/usr/lib/gcc/x86_64-w64-mingw32/4.6/../../../../x86_64-w64-mingw32/include/winnt.h:1036:0:
 note: this is the location of the previous definition

Use STATUS_TIME instead of STATUS_TIMEOUT as suggested by Alberto Garcia.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoconfigure: silence pkg-config's check for curses
Vadim Evard [Fri, 18 Jan 2013 13:48:04 +0000 (17:48 +0400)]
configure: silence pkg-config's check for curses

Signed-off-by: Vadim Evard <v.e.evard@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoacpitable: open the data file in binary mode
Michael Tokarev [Thu, 17 Jan 2013 10:53:52 +0000 (14:53 +0400)]
acpitable: open the data file in binary mode

-acpitable {file|data}=file reads the content of file, but it is
in binary form, so the file should be opened usin O_BINARY flag.
On *nix it is a no-op, but on windows and other weird platform
it is really needed.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agohw: Spelling fix in log message
Stefan Weil [Wed, 16 Jan 2013 17:40:29 +0000 (18:40 +0100)]
hw: Spelling fix in log message

defineition -> definition

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Andreas F=E4rber <afaerber@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoMerge remote-tracking branch 'stefanha/block' into staging
Anthony Liguori [Sun, 20 Jan 2013 17:01:10 +0000 (11:01 -0600)]
Merge remote-tracking branch 'stefanha/block' into staging

# By Kevin Wolf (4) and others
# Via Stefan Hajnoczi
* stefanha/block:
  dataplane: support viostor virtio-pci status bit setting
  dataplane: avoid reentrancy during virtio_blk_data_plane_stop()
  win32-aio: use iov utility functions instead of open-coding them
  win32-aio: Fix memory leak
  win32-aio: Fix vectored reads
  aio: Fix return value of aio_poll()
  ide: Remove wrong assertion
  block: fix null-pointer bug on error case in block commit

11 years agotci: Fix broken build (regression)
Stefan Weil [Sat, 19 Jan 2013 19:23:51 +0000 (20:23 +0100)]
tci: Fix broken build (regression)

s390x-linux-user now also uses GETPC. Instead of adding it to the list of
targets which use GETPC, the macro is now defined unconditionally.

This avoids future build regressions like this one:

  CC    s390x-linux-user/target-s390x/int_helper.o
cc1: warnings being treated as errors
qemu/target-s390x/int_helper.c: In function ‘helper_divs32’:
qemu/target-s390x/int_helper.c:47: error: implicit declaration of function ‘GETPC’
qemu/target-s390x/int_helper.c:47: error: nested extern declaration of ‘GETPC’

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoblock/raw-posix: Make hdev_aio_discard() available outside Linux
Andreas Färber [Fri, 18 Jan 2013 15:43:35 +0000 (16:43 +0100)]
block/raw-posix: Make hdev_aio_discard() available outside Linux

Fixes the build on OpenBSD among others.

Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agousb: Fix compilation for MinGW (regression)
Stefan Weil [Fri, 18 Jan 2013 22:48:10 +0000 (23:48 +0100)]
usb: Fix compilation for MinGW (regression)

84f2d0ea added an argument to function usb_host_info.
The stub function must match the declaration in usb.h.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agocpu-defs.h: Drop qemu_work_item prototype
Andreas Färber [Fri, 18 Jan 2013 18:30:13 +0000 (19:30 +0100)]
cpu-defs.h: Drop qemu_work_item prototype

Commit c64ca8140e9c21cd0d44c10fbe1247cb4ade8e6e (cpu: Move
queued_work_{first,last} to CPUState) moved the qemu_work_item fields
away. Clean up the now unused prototype.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotcg/target-arm: Add missing parens to assertions
Peter Maydell [Thu, 17 Jan 2013 20:04:16 +0000 (20:04 +0000)]
tcg/target-arm: Add missing parens to assertions

Silence a (legitimate) complaint about missing parentheses:

tcg/arm/tcg-target.c: In function ‘tcg_out_qemu_ld’:
tcg/arm/tcg-target.c:1148:5: error: suggest parentheses around
comparison in operand of ‘&’ [-Werror=parentheses]
tcg/arm/tcg-target.c: In function ‘tcg_out_qemu_st’:
tcg/arm/tcg-target.c:1357:5: error: suggest parentheses around
comparison in operand of ‘&’ [-Werror=parentheses]

which meant that we would mistakenly always assert if running
a QEMU built with debug enabled on ARM.

Signed-off-by: Peter Maydell <peter.maydelL@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoReplace non-portable asprintf by g_strdup_printf
Stefan Weil [Wed, 16 Jan 2013 17:37:23 +0000 (18:37 +0100)]
Replace non-portable asprintf by g_strdup_printf

g_strdup_printf already handles OOM errors, so some error handling in
QEMU code can be removed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agovl: Use size_t for sizes in get_boot_devices_list()
Markus Armbruster [Wed, 16 Jan 2013 13:50:29 +0000 (14:50 +0100)]
vl: Use size_t for sizes in get_boot_devices_list()

Code mixes uint32_t, int and size_t.  Very unlikely to go wrong in
practice, but clean it up anyway.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agofw_cfg: Use void *, size_t instead of uint8_t *, uint32_t for blobs
Markus Armbruster [Wed, 16 Jan 2013 13:50:28 +0000 (14:50 +0100)]
fw_cfg: Use void *, size_t instead of uint8_t *, uint32_t for blobs

Many callers pass size_t, which gets silently truncated to uint32_t.
Harmless, because all practical sizes are well below 4GiB.  Clean it
up anyway.  Size overflow now fails assertions.

Bonus: saves a whole bunch of silly casts.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agopc: Clean up bochs_bios_init()'s (non-)use of sizeof
Markus Armbruster [Wed, 16 Jan 2013 13:50:27 +0000 (14:50 +0100)]
pc: Clean up bochs_bios_init()'s (non-)use of sizeof

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agosun4: Fix unchecked strdup() by switching to fw_cfg_add_string()
Markus Armbruster [Wed, 16 Jan 2013 13:50:26 +0000 (14:50 +0100)]
sun4: Fix unchecked strdup() by switching to fw_cfg_add_string()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agopc: Fix unchecked strdup() by switching to fw_cfg_add_string()
Markus Armbruster [Wed, 16 Jan 2013 13:50:25 +0000 (14:50 +0100)]
pc: Fix unchecked strdup() by switching to fw_cfg_add_string()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agofw_cfg: New fw_cfg_add_string()
Markus Armbruster [Wed, 16 Jan 2013 13:50:24 +0000 (14:50 +0100)]
fw_cfg: New fw_cfg_add_string()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agofw_cfg: Dumb down fw_cfg_add_*() not to return success / failure
Markus Armbruster [Wed, 16 Jan 2013 13:50:23 +0000 (14:50 +0100)]
fw_cfg: Dumb down fw_cfg_add_*() not to return success / failure

No caller is checking the value, so all errors get ignored, usually
silently.  assert() instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agofw_cfg: Replace debug prints by tracepoints
Markus Armbruster [Wed, 16 Jan 2013 13:50:22 +0000 (14:50 +0100)]
fw_cfg: Replace debug prints by tracepoints

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agooptimize: optimize using nonzero bits
Paolo Bonzini [Fri, 11 Jan 2013 23:42:53 +0000 (15:42 -0800)]
optimize: optimize using nonzero bits

This adds two optimizations using the non-zero bit mask.  In some cases
involving shifts or ANDs the value can become zero, and can thus be
optimized to a move of zero.  Second, useless zero-extension or an
AND with constant can be detected that would only zero bits that are
already zero.

The main advantage of this optimization is that it turns zero-extensions
into moves, thus enabling much better copy propagation (around 1% code
reduction).  Here is for example a "test $0xff0000,%ecx + je" before
optimization:

 mov_i64 tmp0,rcx
 movi_i64 tmp1,$0xff0000
 discard cc_src
 and_i64 cc_dst,tmp0,tmp1
 movi_i32 cc_op,$0x1c
 ext32u_i64 tmp0,cc_dst
 movi_i64 tmp12,$0x0
 brcond_i64 tmp0,tmp12,eq,$0x0

and after (without patch on the left, with on the right):

 movi_i64 tmp1,$0xff0000                 movi_i64 tmp1,$0xff0000
 discard cc_src                          discard cc_src
 and_i64 cc_dst,rcx,tmp1                 and_i64 cc_dst,rcx,tmp1
 movi_i32 cc_op,$0x1c                    movi_i32 cc_op,$0x1c
 ext32u_i64 tmp0,cc_dst
 movi_i64 tmp12,$0x0                     movi_i64 tmp12,$0x0
 brcond_i64 tmp0,tmp12,eq,$0x0           brcond_i64 cc_dst,tmp12,eq,$0x0

Other similar cases: "test %eax, %eax + jne" where eax is already 32-bit
(after optimization, without patch on the left, with on the right):

 discard cc_src                          discard cc_src
 mov_i64 cc_dst,rax                      mov_i64 cc_dst,rax
 movi_i32 cc_op,$0x1c                    movi_i32 cc_op,$0x1c
 ext32u_i64 tmp0,cc_dst
 movi_i64 tmp12,$0x0                     movi_i64 tmp12,$0x0
 brcond_i64 tmp0,tmp12,ne,$0x0           brcond_i64 rax,tmp12,ne,$0x0

"test $0x1, %dl + je":

 movi_i64 tmp1,$0x1                      movi_i64 tmp1,$0x1
 discard cc_src                          discard cc_src
 and_i64 cc_dst,rdx,tmp1                 and_i64 cc_dst,rdx,tmp1
 movi_i32 cc_op,$0x1a                    movi_i32 cc_op,$0x1a
 ext8u_i64 tmp0,cc_dst
 movi_i64 tmp12,$0x0                     movi_i64 tmp12,$0x0
 brcond_i64 tmp0,tmp12,eq,$0x0           brcond_i64 cc_dst,tmp12,eq,$0x0

In some cases TCG even outsmarts GCC. :)  Here the input code has
"and $0x2,%eax + movslq %eax,%rbx + test %rbx, %rbx" and the optimizer,
thanks to copy propagation, does the following:

 movi_i64 tmp12,$0x2                     movi_i64 tmp12,$0x2
 and_i64 rax,rax,tmp12                   and_i64 rax,rax,tmp12
 mov_i64 cc_dst,rax                      mov_i64 cc_dst,rax
 ext32s_i64 tmp0,rax                  -> nop
 mov_i64 rbx,tmp0                     -> mov_i64 rbx,cc_dst
 and_i64 cc_dst,rbx,rbx               -> nop

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agooptimize: track nonzero bits of registers
Paolo Bonzini [Fri, 11 Jan 2013 23:42:52 +0000 (15:42 -0800)]
optimize: track nonzero bits of registers

Add a "mask" field to the tcg_temp_info struct.  A bit that is zero
in "mask" will always be zero in the corresponding temporary.
Zero bits in the mask can be produced from moves of immediates,
zero-extensions, ANDs with constants, shifts; they can then be
be propagated by logical operations, shifts, sign-extensions,
negations, deposit operations, and conditional moves.  Other
operations will just reset the mask to all-ones, i.e. unknown.

[rth: s/target_ulong/tcg_target_ulong/]

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agooptimize: only write to state when clearing optimizer data
Paolo Bonzini [Fri, 11 Jan 2013 23:42:51 +0000 (15:42 -0800)]
optimize: only write to state when clearing optimizer data

The next patch will add to the TCG optimizer a field that should be
non-zero in the default case.  Thus, replace the memset of the
temps array with a loop.  Only the state field has to be up-to-date,
because others are not used except if the state is TCG_TEMP_COPY
or TCG_TEMP_CONST.

[rth: Extracted the loop to a function.]

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoMerge branch 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf
Blue Swirl [Sat, 19 Jan 2013 09:56:41 +0000 (09:56 +0000)]
Merge branch 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf

* 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf:
  PPC: KVM: Add support for EPR with KVM
  openpic: export e500 epr enable into a ppc.c function
  Update Linux kernel headers
  PPC: e500: Change in-memory order of load blobs
  PPC: Provide zero SVR for -cpu e500mc and e5500
  PPC: E500: Calculate loading blob offsets properly
  openpic: set mixed mode as supported
  openpic: unify gcr mode mask updates
  openpic: move gcr write into a function

11 years agoMerge branch 's390-for-upstream' of git://repo.or.cz/qemu/agraf
Blue Swirl [Sat, 19 Jan 2013 09:55:46 +0000 (09:55 +0000)]
Merge branch 's390-for-upstream' of git://repo.or.cz/qemu/agraf

* 's390-for-upstream' of git://repo.or.cz/qemu/agraf:
  s390: Add a hypercall registration interface.
  target-s390x: Unregister reset callback on finalization
  s390x: fix indentation
  s390: Add CPU reset handler
  s390x: Remove inline function ebcdic_put and related data from cpu.h
  S390: Enable -cpu help and QMP query-cpu-definitions
  s390: Move IPL code into a separate device
  s390: new contributions GPLv2 or later

11 years agoMerge branch 'axp-next' of git://github.com/rth7680/qemu
Blue Swirl [Sat, 19 Jan 2013 09:54:31 +0000 (09:54 +0000)]
Merge branch 'axp-next' of git://github.com/rth7680/qemu

* 'axp-next' of git://github.com/rth7680/qemu:
  alpha-linux-user: Correct select
  alpha-linux-user: Translate fcntl l_type

11 years agos390: Add a hypercall registration interface.
Cornelia Huck [Thu, 17 Jan 2013 04:23:46 +0000 (04:23 +0000)]
s390: Add a hypercall registration interface.

Allow virtio machines to register for different diag500 function
codes and convert s390-virtio to use it.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agotarget-s390x: Unregister reset callback on finalization
Andreas Färber [Mon, 7 Jan 2013 06:14:16 +0000 (06:14 +0000)]
target-s390x: Unregister reset callback on finalization

Since commit "s390: Add CPU reset handler" the CPU's instance_init
registers a reset callback. Unregister that on instance_finalize.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agos390x: fix indentation
Alexander Graf [Mon, 7 Jan 2013 15:44:27 +0000 (16:44 +0100)]
s390x: fix indentation

In one of the last commits we accidently got 3-space indentation into
the tree. Fix it up so it's 4 spaces wide.

Reported-by: Andreas Faerber <afaerber@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agos390: Add CPU reset handler
Jens Freimann [Mon, 7 Jan 2013 05:27:14 +0000 (05:27 +0000)]
s390: Add CPU reset handler

Add a CPU reset handler to have all CPUs in a PoP compliant
state.

Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
[agraf: move hw/hw.h into existing ifdef]
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agos390x: Remove inline function ebcdic_put and related data from cpu.h
Stefan Weil [Tue, 1 Jan 2013 08:24:55 +0000 (08:24 +0000)]
s390x: Remove inline function ebcdic_put and related data from cpu.h

The function is only used in misc_helper.c, so move it to that file.

This reduces the size of debug executables (compiled without optimization)
because they get unused code and data for each compilation which includes
cpu.h.

Executables with optimization don't change their size.

ebcdic2ascii is currently unused and could be removed (not done here).

The array ascii2ebcdic must be accessed with an unsigned index, therefore
(int)ascii[i] was replaced by (uint8_t)ascii[i]. The old code would have
failed for a signed char less than 0. The current code only converts
"QEMU" and spaces to EBCDIC, so there is no problem today.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agoS390: Enable -cpu help and QMP query-cpu-definitions
Viktor Mihajlovski [Tue, 18 Dec 2012 07:50:59 +0000 (07:50 +0000)]
S390: Enable -cpu help and QMP query-cpu-definitions

This enables qemu -cpu help to return a list of supported CPU models
on s390 and also to query for cpu definitions in the monitor.
Initially only cpu model = host is returned. This needs to be reworked
into a full-fledged CPU model handling later on.
This change is needed to allow libvirt exploiters (like OpenStack)
to specify a CPU model.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
[agraf: fix s390x-linux-user, adjust header locations]
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agos390: Move IPL code into a separate device
Christian Borntraeger [Tue, 18 Dec 2012 07:50:57 +0000 (07:50 +0000)]
s390: Move IPL code into a separate device

Lets move the code to setup IPL for external kernel
or via the zipl rom into a separate file. This allows to

- define a reboot handler, setting up the PSW appropriately
- enhance the boot code to IPL disks that contain a bootmap that
  was created with zipl under LPAR or z/VM (future patch)
- reuse that code for several machines (e.g. virtio-ccw and virtio-s390)
- allow different machines to provide different defaults

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
[agraf: symbolify initial psw, adjust header file location, fix for QOM]
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agos390: new contributions GPLv2 or later
Christian Borntraeger [Mon, 12 Nov 2012 01:44:10 +0000 (01:44 +0000)]
s390: new contributions GPLv2 or later

IBMs s390 contributions were meant to to be gplv2 or later (since
we were contributing to qemu). Several of the s390 specific files
link to gpl code anyway, so lets clarify the licence statement for
new contributions for those files that we have touched multiple
times or will likely touch again.

This patch does not touch files that mostly deal with tcg.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agoPPC: KVM: Add support for EPR with KVM
Alexander Graf [Thu, 17 Jan 2013 10:54:38 +0000 (11:54 +0100)]
PPC: KVM: Add support for EPR with KVM

This patch links KVM EPR support to the existing TCG support we have now.

Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agoopenpic: export e500 epr enable into a ppc.c function
Alexander Graf [Thu, 17 Jan 2013 10:32:21 +0000 (11:32 +0100)]
openpic: export e500 epr enable into a ppc.c function

Enabling and disabling the EPR capability (mpic_proxy) is a system
wide operation. As such, it belongs into the ppc.c file, since that's
where PPC specific machine wide logic happens.

Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agoUpdate Linux kernel headers
Alexander Graf [Thu, 17 Jan 2013 23:06:26 +0000 (00:06 +0100)]
Update Linux kernel headers

Based on kvm.git a843fac (next) plus dfdebc24 (master).

Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agoPPC: e500: Change in-memory order of load blobs
Alexander Graf [Thu, 17 Jan 2013 10:19:28 +0000 (11:19 +0100)]
PPC: e500: Change in-memory order of load blobs

Today, we load

  <kernel> <initrd> <dtb>

into memory in that order. However, Linux has a bug where it can only
handle the dtb if it's within the first 64MB of where <kernel> starts.

So instead, let's change the order to

  <kernel> <dtb> <initrd>

making Linux happy.

Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agoPPC: Provide zero SVR for -cpu e500mc and e5500
Alexander Graf [Wed, 16 Jan 2013 00:43:43 +0000 (01:43 +0100)]
PPC: Provide zero SVR for -cpu e500mc and e5500

Even though our -cpu types for e500mc and e5500 are no real CPUs that
actually have version registers, a guest might still want to access
said version register and that has to succeed for a guest to be happy.

So let's expose a zero SVR value on E500_SVR SPR reads.

Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agoPPC: E500: Calculate loading blob offsets properly
Alexander Graf [Mon, 14 Jan 2013 19:24:16 +0000 (20:24 +0100)]
PPC: E500: Calculate loading blob offsets properly

We have 3 blobs we need to load when booting the system:

  - kernel
  - initrd
  - dtb

We place them in physical memory in that order. At least we should.
This patch fixes the location calculation up to take any module into
account, fixing the dtb offset along the way.

Reported-by: Stuart Yoder <stuart.yoder@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agoopenpic: set mixed mode as supported
Alexander Graf [Mon, 7 Jan 2013 19:17:24 +0000 (20:17 +0100)]
openpic: set mixed mode as supported

The Raven MPIC implementation supports the "Mixed" mode to work with
an i8259. While we don't implement mixed mode, we should mark it as
a supported mode in the mode bitmap.

Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agoopenpic: unify gcr mode mask updates
Alexander Graf [Mon, 7 Jan 2013 19:15:28 +0000 (20:15 +0100)]
openpic: unify gcr mode mask updates

The mode mask already masks out bits we don't care about, so the
actual handling code can stay intact regardless.

Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agoopenpic: move gcr write into a function
Alexander Graf [Mon, 7 Jan 2013 19:13:52 +0000 (20:13 +0100)]
openpic: move gcr write into a function

The GCR register contains too much functionality to be covered inside
of the register switch statement. Move it out into a separate function.

Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agodataplane: support viostor virtio-pci status bit setting
Stefan Hajnoczi [Thu, 17 Jan 2013 15:46:54 +0000 (16:46 +0100)]
dataplane: support viostor virtio-pci status bit setting

The viostor virtio-blk driver for Windows does not use the
VIRTIO_CONFIG_S_DRIVER bit.  It only sets the VIRTIO_CONFIG_S_DRIVER_OK
bit.

The viostor driver refreshes the virtio-pci status byte sometimes while
the guest is running.  We misinterpret 0x4 (VIRTIO_CONFIG_S_DRIVER_OK)
as an indication that virtio-blk-data-plane should be stopped since 0x2
(VIRTIO_CONFIG_S_DRIVER) is missing.  The result is that the device
becomes unresponsive.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agodataplane: avoid reentrancy during virtio_blk_data_plane_stop()
Stefan Hajnoczi [Tue, 15 Jan 2013 16:19:38 +0000 (17:19 +0100)]
dataplane: avoid reentrancy during virtio_blk_data_plane_stop()

When dataplane is stopping, the s->vdev->binding->set_host_notifier(...,
false) call can invoke the virtqueue handler if an ioeventfd
notification is pending.  This causes hw/virtio-blk.c to invoke
virtio_blk_data_plane_start() before virtio_blk_data_plane_stop()
returns!

The result is that we try to restart dataplane while trying to stop it
and the following assertion is raised:

  msix_set_mask_notifier: Assertion `!dev->msix_mask_notifier' failed.

Although the code was intended to prevent this scenario, the s->started
boolean isn't enough.  Add s->stopping so that we can postpone clearing
s->started until we've completely stopped dataplane.

This way, virtqueue handler calls during virtio_blk_data_plane_stop()
are ignored.  When dataplane is legitimately started again later we
already self-kick ourselves to resume processing.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agowin32-aio: use iov utility functions instead of open-coding them
Michael Tokarev [Thu, 17 Jan 2013 14:47:52 +0000 (18:47 +0400)]
win32-aio: use iov utility functions instead of open-coding them

We have iov_from_buf() and iov_to_buf(), use them instead of
open-coding these in block/win32-aio.c

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoMerge remote-tracking branch 'luiz/queue/qmp' into staging
Anthony Liguori [Thu, 17 Jan 2013 19:09:57 +0000 (13:09 -0600)]
Merge remote-tracking branch 'luiz/queue/qmp' into staging

# By Wenchao Xia
# Via Luiz Capitulino
* luiz/queue/qmp:
  HMP: add sub command table to info
  HMP: move define of mon_cmds
  HMP: add infrastructure for sub command
  HMP: delete info handler
  HMP: add QDict to info callback handler

11 years agovirtio-pci: fix irqfd cleanup argument order
Michael S. Tsirkin [Tue, 15 Jan 2013 17:42:38 +0000 (19:42 +0200)]
virtio-pci: fix irqfd cleanup argument order

Order of arguments of kvm_virtio_pci_irqfd_release
got mixed up in all calls.
As a result users see assertions during cleanup.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqom: Extend documentation on QOM method concepts
Andreas Färber [Thu, 17 Jan 2013 07:31:50 +0000 (08:31 +0100)]
qom: Extend documentation on QOM method concepts

Add a documentation section "Methods" and discuss among others how to
handle overriding virtual methods.

Clarify DeviceClass::realize documentation and refer to the above.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMakefile: drop recursive libcacard clean
Stefan Hajnoczi [Tue, 15 Jan 2013 07:47:26 +0000 (08:47 +0100)]
Makefile: drop recursive libcacard clean

Commit eb8eb53e5846a957cf333f2e1ec8cb6e0c04 ("libcacard: rewrite
Makefile in non-recursive style") refactored libcacard/Makefile so it
can be included by the top-level Makefile.

The top-level clean target still loops over subdirectories, including
libcacard/, to invoke recursive clean.  Remove libcacard from the
recursive clean since its files are already included at the top level.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoHMP: add sub command table to info
Wenchao Xia [Mon, 14 Jan 2013 06:06:29 +0000 (14:06 +0800)]
HMP: add sub command table to info

  Now info command takes a table of sub info commands,
and changed do_info() to do_info_help() to do help funtion
only.
 Note that now "info <unknown-topic>" returns error instead
of list of info topics.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoHMP: move define of mon_cmds
Wenchao Xia [Mon, 14 Jan 2013 06:06:28 +0000 (14:06 +0800)]
HMP: move define of mon_cmds

  Because mon_cmds may use info_cmds, so adjust the declare sequence
of them.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoHMP: add infrastructure for sub command
Wenchao Xia [Mon, 14 Jan 2013 06:06:27 +0000 (14:06 +0800)]
HMP: add infrastructure for sub command

  This patch make parsing of hmp command aware of that it may
have sub command. Also discard simple encapsulation function
monitor_find_command(). For case "@command ", space after
@command is filtered out.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoHMP: delete info handler
Wenchao Xia [Mon, 14 Jan 2013 06:06:26 +0000 (14:06 +0800)]
HMP: delete info handler

  Now cmd and info handler have same format, so delete info handler.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoHMP: add QDict to info callback handler
Wenchao Xia [Mon, 14 Jan 2013 06:06:25 +0000 (14:06 +0800)]
HMP: add QDict to info callback handler

  This patch change all info call back function to take
additional QDict * parameter, which allow those command
take parameter. Now it is set to NULL at default case.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agowin32-aio: Fix memory leak
Kevin Wolf [Wed, 16 Jan 2013 20:20:00 +0000 (21:20 +0100)]
win32-aio: Fix memory leak

The buffer is allocated for both reads and writes, and obviously it
should be freed even if an error occurs.

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agowin32-aio: Fix vectored reads
Kevin Wolf [Wed, 16 Jan 2013 20:19:59 +0000 (21:19 +0100)]
win32-aio: Fix vectored reads

Copying data in the right direction really helps a lot!

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoaio: Fix return value of aio_poll()
Kevin Wolf [Wed, 16 Jan 2013 18:25:51 +0000 (19:25 +0100)]
aio: Fix return value of aio_poll()

aio_poll() must return true if any work is still pending, even if it
didn't make progress, so that bdrv_drain_all() doesn't stop waiting too
early. The possibility of stopping early occasionally lead to a failed
assertion in bdrv_drain_all(), when some in-flight request was missed
and the function didn't really drain all requests.

In order to make that change, the return value as specified in the
function comment must change for blocking = false; fortunately, the
return value of blocking = false callers is only used in test cases, so
this change shouldn't cause any trouble.

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoide: Remove wrong assertion
Kevin Wolf [Wed, 16 Jan 2013 09:54:34 +0000 (10:54 +0100)]
ide: Remove wrong assertion

The Bus Master IDE Active bit (BM_STATUS_DMAING) is not only set when
the request is still in flight, but also when it has completed and the
size of the physical memory regions in the PRDT was larger than the
transfer size.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoblock: fix null-pointer bug on error case in block commit
Jeff Cody [Tue, 15 Jan 2013 15:47:24 +0000 (10:47 -0500)]
block: fix null-pointer bug on error case in block commit

This is a bug that was caught by a coverity run by Markus.  In
the error case when we errored out to exit_restore_open early in the
function, 'overlay_bs' was still NULL at that point, although it is
used to look up flags and perform a bdrv_reopen().

Move the overlay_bs lookup to where it is needed, and check for NULL
before restoring the flags.  Also get rid of the unneeded parameter
initialization.

Reported-By: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agobswap: improve gluing
Blue Swirl [Sun, 13 Jan 2013 16:35:41 +0000 (16:35 +0000)]
bswap: improve gluing

OpenBSD system compiler (gcc 4.2.1) has problems with concatenation
of macro arguments in macro functions:
  CC    aes.o
In file included from /src/qemu/include/qemu-common.h:126,
                 from /src/qemu/aes.c:30:
/src/qemu/include/qemu/bswap.h: In function 'leul_to_cpu':
/src/qemu/include/qemu/bswap.h:461: warning: implicit declaration of function 'bswapHOST_LONG_BITS'
/src/qemu/include/qemu/bswap.h:461: warning: nested extern declaration of 'bswapHOST_LONG_BITS'

Function leul_to_cpu() is only used in kvm-all.c, so the warnings
are not fatal on OpenBSD without -Werror.

Fix by applying glue(). Also add do {} while(0) wrapping and fix
semicolon use while at it.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'kraxel/chardev.1' into staging
Anthony Liguori [Wed, 16 Jan 2013 21:20:05 +0000 (15:20 -0600)]
Merge remote-tracking branch 'kraxel/chardev.1' into staging

# By Gerd Hoffmann
# Via Gerd Hoffmann
* kraxel/chardev.1:
  chardev: add pty chardev support to chardev-add (qmp)
  chardev: add socket chardev support to chardev-add (qmp)
  chardev: add parallel chardev support to chardev-add (qmp)
  chardev: add serial chardev support to chardev-add (qmp)
  chardev: add file chardev support to chardev-add (qmp)
  chardev: add hmp hotplug commands
  chardev: add qmp hotplug commands, with null chardev support
  chardev: reduce chardev ifdef mess a bit
  chardev: fix QemuOpts lifecycle
  chardev: add error reporting for qemu_chr_new_from_opts

11 years agobuild: fix Win32 clean build
Paolo Bonzini [Tue, 15 Jan 2013 08:49:36 +0000 (09:49 +0100)]
build: fix Win32 clean build

The version.o file did not appear explicitly as a dependency, and
this caused clean builds to fail.  Force its build by making the
Makefile depend on version.o.

(We cannot add it to libqemuutil.a, because it doesn't export any
symbol and thus would not be pulled by the linker).

Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Stefan Weil <sw@weilnetz.de>
Tested-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotmp105: Add temperature QOM property
Andreas Färber [Wed, 16 Jan 2013 00:57:59 +0000 (01:57 +0100)]
tmp105: Add temperature QOM property

This obsoletes tmp105_set() and allows for better error handling.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotmp105: QOM'ify
Andreas Färber [Wed, 16 Jan 2013 00:57:58 +0000 (01:57 +0100)]
tmp105: QOM'ify

Introduce TYPE_ constant and cast macro.
Move the state struct to the new header to allow for future embedding.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotests: Add tmp105 qtest test case
Andreas Färber [Wed, 16 Jan 2013 00:57:57 +0000 (01:57 +0100)]
tests: Add tmp105 qtest test case

Exercise all four commands of the TMP105, testing for an issue in the
I2C TX path.

The test case uses the N800's OMAP I2C and is the first for ARM.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotmp105: Fix I2C protocol bug
Andreas Färber [Wed, 16 Jan 2013 00:57:56 +0000 (01:57 +0100)]
tmp105: Fix I2C protocol bug

An early length postincrement in the TMP105's I2C TX path led to
transfers of more than one byte to place the second byte in the third
byte's place within the buffer and the third byte to get discarded.

Fix this by explictly incrementing the length after the checks but
before the callback is called, which again checks the length.

Adjust the Coding Style while at it.

Signed-off-by: Alex Horn <alex.horn@cs.ox.ac.uk>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotmp105: Split out I2C message constants from header
Andreas Färber [Wed, 16 Jan 2013 00:57:55 +0000 (01:57 +0100)]
tmp105: Split out I2C message constants from header

Allows value sharing with qtest.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agolibqtest: Prepare I2C libqos
Andreas Färber [Wed, 16 Jan 2013 00:57:54 +0000 (01:57 +0100)]
libqtest: Prepare I2C libqos

This adds a simple I2C API and a driver implementation for omap_i2c.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoaudio: Replace non-portable asprintf in debug code by g_strdup_printf
Stefan Weil [Wed, 16 Jan 2013 17:17:33 +0000 (18:17 +0100)]
audio: Replace non-portable asprintf in debug code by g_strdup_printf

sw->name already uses the correct g_free to free the allocated memory.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agousb-storage: Drop useless null test in usb_msd_handle_data()
Markus Armbruster [Wed, 16 Jan 2013 17:20:25 +0000 (18:20 +0100)]
usb-storage: Drop useless null test in usb_msd_handle_data()

scsi_req_new() never returns null, and scsi_req_enqueue() dereferences
the pointer, so checking for null is useless.

Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoui: Drop useless null tests in parse_keyboard_layout()
Markus Armbruster [Wed, 16 Jan 2013 17:20:57 +0000 (18:20 +0100)]
ui: Drop useless null tests in parse_keyboard_layout()

Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopseries: Replace non-portable asprintf by g_strdup_printf
Stefan Weil [Wed, 16 Jan 2013 17:22:29 +0000 (18:22 +0100)]
pseries: Replace non-portable asprintf by g_strdup_printf

g_strdup_printf already handles OOM errors, so some error handling in
QEMU code can be removed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoAdd new DEFAULT_MACHINE_OPTIONS to q35 and ppc405
Knut Omang [Wed, 16 Jan 2013 15:34:34 +0000 (16:34 +0100)]
Add new DEFAULT_MACHINE_OPTIONS to q35 and ppc405

Without this default q35/ppc405 based machines would no longer boot
after commit e4ada29e909787f629626660b1561f6a680187d3

Signed-off-by: Knut Omang <knut.omang@oracle.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoalpha-linux-user: Correct select
Laurent Vivier [Thu, 10 Jan 2013 21:30:50 +0000 (22:30 +0100)]
alpha-linux-user: Correct select

Alpha, like s390x, passes all select arguments in registers.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agoalpha-linux-user: Translate fcntl l_type
Laurent Vivier [Thu, 10 Jan 2013 20:42:48 +0000 (21:42 +0100)]
alpha-linux-user: Translate fcntl l_type

The values of F_RDLCK, F_WRLCK, F_UNLCK, F_EXLCK, F_SHLCK
differ between alpha and other linux architectures.

This patch allows to run "dpkg" (database lock).

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agochardev: add pty chardev support to chardev-add (qmp)
Gerd Hoffmann [Thu, 20 Dec 2012 13:39:13 +0000 (14:39 +0100)]
chardev: add pty chardev support to chardev-add (qmp)

The ptsname is returned directly, so there is no need to
use query-chardev to figure the pty device path.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agochardev: add socket chardev support to chardev-add (qmp)
Gerd Hoffmann [Thu, 20 Dec 2012 12:53:12 +0000 (13:53 +0100)]
chardev: add socket chardev support to chardev-add (qmp)

qemu_chr_open_socket is split into two functions.  All initialization
after creating the socket file handler is split away into the new
qemu_chr_open_socket_fd function.

chr->filename doesn't get filled from QemuOpts any more.  Qemu gathers
the information using getsockname and getnameinfo instead.  This way it
will also work correctly for file handles passed via file descriptor
passing.

Finally qmp_chardev_open_socket() is the actual qmp hotplug
implementation which basically just calls socket_listen or
socket_connect and the new qemu_chr_open_socket_fd function.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agochardev: add parallel chardev support to chardev-add (qmp)
Gerd Hoffmann [Thu, 10 Jan 2013 13:20:58 +0000 (14:20 +0100)]
chardev: add parallel chardev support to chardev-add (qmp)

Also alias the old parport name to parallel for -chardev.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agochardev: add serial chardev support to chardev-add (qmp)
Gerd Hoffmann [Wed, 19 Dec 2012 12:50:29 +0000 (13:50 +0100)]
chardev: add serial chardev support to chardev-add (qmp)

Similar to file, except that no separate in/out files are supported
because it's pointless for direct device access.  Also the special
tty ioctl hooks (pass through linespeed settings etc) are activated
on Unix.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agochardev: add file chardev support to chardev-add (qmp)
Gerd Hoffmann [Wed, 19 Dec 2012 12:13:57 +0000 (13:13 +0100)]
chardev: add file chardev support to chardev-add (qmp)

Add support for file chardevs.  Output file is mandatory,
input file is optional.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agochardev: add hmp hotplug commands
Gerd Hoffmann [Wed, 19 Dec 2012 09:33:40 +0000 (10:33 +0100)]
chardev: add hmp hotplug commands

Add chardev-add and chardev-remove commands to the human monitor.
chardev-add accepts the same syntax as -chardev, chardev-remove
expects a chardev id.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agochardev: add qmp hotplug commands, with null chardev support
Gerd Hoffmann [Wed, 19 Dec 2012 09:33:56 +0000 (10:33 +0100)]
chardev: add qmp hotplug commands, with null chardev support

Add chardev-add and chardev-remove qmp commands.  Hotplugging
a null chardev is supported for now, more will be added later.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agochardev: reduce chardev ifdef mess a bit
Gerd Hoffmann [Wed, 19 Dec 2012 15:35:42 +0000 (16:35 +0100)]
chardev: reduce chardev ifdef mess a bit

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agochardev: fix QemuOpts lifecycle
Gerd Hoffmann [Mon, 15 Oct 2012 07:30:59 +0000 (09:30 +0200)]
chardev: fix QemuOpts lifecycle

qemu_chr_new_from_opts handles QemuOpts release now, so callers don't
have to worry.  It will either be saved in CharDriverState, then
released in qemu_chr_delete, or in the error case released instantly.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agochardev: add error reporting for qemu_chr_new_from_opts
Gerd Hoffmann [Mon, 15 Oct 2012 07:28:05 +0000 (09:28 +0200)]
chardev: add error reporting for qemu_chr_new_from_opts

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoqdev: Prepare "realized" property
Andreas Färber [Wed, 9 Jan 2013 02:58:11 +0000 (03:58 +0100)]
qdev: Prepare "realized" property

Introduce the QOM realizefn suggested by Anthony.
Detailed documentation is supplied in the qdev header.

For now this implements a default DeviceClass::realize callback that
just wraps DeviceClass::init, which it deprecates.
Once all devices have been converted to DeviceClass::realize,
DeviceClass::init is to be removed.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Anthony Liguori <anthony@codemonkey.ws>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqdev: Fold state enum into bool realized
Andreas Färber [Wed, 9 Jan 2013 02:58:10 +0000 (03:58 +0100)]
qdev: Fold state enum into bool realized

Whether the device was initialized or not is QOM-level information and
currently unused. Drop it from device. This leaves the boolean state of
whether or not DeviceClass::init was called or not, a.k.a. "realized".

Suggested-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopseries: set no default boot order
Avik Sil [Tue, 8 Jan 2013 07:06:31 +0000 (12:36 +0530)]
pseries: set no default boot order

This patch removes the default boot order for pseries machine. This allows
the machine to handle a NULL boot order in case no -boot option is provided.
Thus it helps SLOF firmware to verify if boot order is specified in command
line or not. If no boot order is provided SLOF tries to boot from the
device set in the nvram.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMake default boot order machine specific
Avik Sil [Tue, 8 Jan 2013 07:06:30 +0000 (12:36 +0530)]
Make default boot order machine specific

This patch makes default boot order machine specific instead of
set globally. The default boot order can be set per machine in
QEMUMachine boot_order. This also allows a machine to receive a
NULL boot order when -boot isn't used and take an appropriate action
accordingly. This helps machine boots from the devices as set in
guest's non-volatile memory location in case no boot order is
provided by the user.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoacl: Free memory allocated with g_malloc() with g_free()
Markus Armbruster [Tue, 15 Jan 2013 14:24:16 +0000 (15:24 +0100)]
acl: Free memory allocated with g_malloc() with g_free()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoacl: Fix acl_remove not to mess up the ACL
Markus Armbruster [Tue, 15 Jan 2013 14:24:15 +0000 (15:24 +0100)]
acl: Fix acl_remove not to mess up the ACL

It leaks memory and fails to adjust qemu_acl member nentries.  Future
acl_add become confused: can misreport the position, and can silently
fail to add.

Cc: qemu-stable@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agosdl: Fix heap smash in sdl_zoom_rgb{16,32} for int > 32 bits
Markus Armbruster [Tue, 15 Jan 2013 14:42:32 +0000 (15:42 +0100)]
sdl: Fix heap smash in sdl_zoom_rgb{16,32} for int > 32 bits

Careless use of malloc(): allocate Uint32[N], assign to int *, use
int[N].

Fix by converting to g_new().

Functions can't fail anymore, so make them return void.  Caller
ignored the value anyway.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agokvm: add stub for kvm_irqchip_update_msi_route
Michael S. Tsirkin [Tue, 15 Jan 2013 17:50:13 +0000 (19:50 +0200)]
kvm: add stub for kvm_irqchip_update_msi_route

ppc64 build needs this stub to build with virtio enabled.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'afaerber/memory-ioport' into staging
Anthony Liguori [Tue, 15 Jan 2013 22:54:41 +0000 (16:54 -0600)]
Merge remote-tracking branch 'afaerber/memory-ioport' into staging

* afaerber/memory-ioport:
  acpi_piix4: Do not use old_portio-style callbacks
  xen_platform: Do not use old_portio-style callbacks
  hw/dma.c: Fix conversion of ioport_register* to MemoryRegion

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Tue, 15 Jan 2013 22:53:10 +0000 (16:53 -0600)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

* stefanha/trivial-patches:
  configure: try pkg-config for curses
  qom: Make object_resolve_path_component() path argument const
  Add libcacard/trace/generated-tracers.c to .gitignore

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'stefanha/block' into staging
Anthony Liguori [Tue, 15 Jan 2013 22:52:56 +0000 (16:52 -0600)]
Merge remote-tracking branch 'stefanha/block' into staging

* stefanha/block:
  block: Fix how mirror_run() frees its buffer
  win32-aio: Fix how win32_aio_process_completion() frees buffer
  scsi-disk: qemu_vfree(NULL) is fine, simplify
  w32: Make qemu_vfree() accept NULL like the POSIX implementation
  sheepdog: clean up sd_aio_setup()
  sheepdog: multiplex the rw FD to flush cache
  block: clear dirty bitmap when discarding
  ide: issue discard asynchronously but serialize the pieces
  ide: fix TRIM with empty range entry
  block: make discard asynchronous
  raw: support discard on block devices
  raw-posix: remember whether discard failed
  raw-posix: support discard on more filesystems
  block: fix initialization in bdrv_io_limits_enable()
  qcow2: Fix segfault on zero-length write

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'afaerber/qom-cpu' into staging
Anthony Liguori [Tue, 15 Jan 2013 22:52:39 +0000 (16:52 -0600)]
Merge remote-tracking branch 'afaerber/qom-cpu' into staging

* afaerber/qom-cpu:
  target-i386: Use switch in check_hw_breakpoints()
  target-i386: Avoid goto in hw_breakpoint_insert()
  target-i386: Introduce hw_{local,global}_breakpoint_enabled()
  target-i386: Define DR7 bit field constants
  target-i386: Move kvm_check_features_against_host() check to realize time
  target-i386: cpu_x86_register() consolidate freeing resources
  target-i386: Move setting defaults out of cpu_x86_parse_featurestr()
  target-i386: check/enforce: Check all feature words
  target-i386/cpu.c: Add feature name array for ext4_features
  target-i386: kvm_check_features_against_host(): Use feature_word_info
  target-i386/cpu: Introduce FeatureWord typedefs
  target-i386: Disable kvm_mmu by default
  kvm: Add fake KVM constants to avoid #ifdefs on KVM-specific code
  exec: Return CPUState from qemu_get_cpu()
  xen: Simplify halting of first CPU
  kvm: Pass CPUState to kvm_init_vcpu()
  cpu: Move cpu_index field to CPUState
  cpu: Move numa_node field to CPUState
  target-mips: Clean up mips_cpu_map_tc() documentation
  cpu: Move nr_{cores,threads} fields to CPUState

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'afaerber-or/prep-up' into staging
Anthony Liguori [Tue, 15 Jan 2013 22:52:10 +0000 (16:52 -0600)]
Merge remote-tracking branch 'afaerber-or/prep-up' into staging

* afaerber-or/prep-up:
  pc87312: Avoid define conflict on mingw32
  pc87312: Replace register_ioport_*() with MemoryRegion

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'mdroth/qga-pull-1-14-2013-2' into staging
Anthony Liguori [Tue, 15 Jan 2013 22:50:04 +0000 (16:50 -0600)]
Merge remote-tracking branch 'mdroth/qga-pull-1-14-2013-2' into staging

* mdroth/qga-pull-1-14-2013-2:
  qga: add missing commas in json docs

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'mdroth/qga-pull-1-14-2013' into staging
Anthony Liguori [Tue, 15 Jan 2013 22:49:48 +0000 (16:49 -0600)]
Merge remote-tracking branch 'mdroth/qga-pull-1-14-2013' into staging

* mdroth/qga-pull-1-14-2013:
  qemu-ga: Handle errors uniformely in ga_channel_open()
  qemu-ga: Plug fd leak on ga_channel_open() error paths
  qemu-ga: Plug fd leak on ga_channel_listen_accept() error path
  qemu-ga: Plug file descriptor leak on ga_open_pidfile() error path
  qemu-ga: Drop pointless lseek() from ga_open_pidfile()
  qemu-ga: Document intentional fall through in channel_event_cb()
  qemu-ga: add ga_open_logfile()
  qemu-ga: ga_open_pidfile(): use qemu_open()

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>