]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
9 years agoMerge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2015-03-19' into...
Peter Maydell [Thu, 19 Mar 2015 14:10:20 +0000 (14:10 +0000)]
Merge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2015-03-19' into staging

trivial patches for 2015-03-19

# gpg: Signature made Thu Mar 19 08:57:54 2015 GMT using RSA key ID A4C3D7DB
# gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
# gpg:                 aka "Michael Tokarev <mjt@corpit.ru>"
# gpg:                 aka "Michael Tokarev <mjt@debian.org>"

* remotes/mjt/tags/pull-trivial-patches-2015-03-19: (24 commits)
  qga/commands-posix: Fix resource leak
  elf-loader: Add missing error handling for call of lseek
  elf-loader: Fix truncation warning from coverity
  hmp: Fix texinfo documentation
  Fix typos in comments
  qtest/ahci: Fix a bit mask expression
  vl: fix resource leak with monitor_fdset_add_fd
  smbios: add max speed comdline option for type-17 (meory device) structure
  pc-dimm: Add description for device list.
  configure: enable kvm on x32
  error: Replace error_report() & error_free() with error_report_err()
  arm: fix memory leak
  qmp: Drop unused .user_print from command definitions
  hmp: Fix definition of command quit
  target-moxie: Fix warnings from Sparse (one-bit signed bitfield)
  block/qapi: Fix Sparse warning
  Fix remaining warnings from Sparse (void return)
  qom: Fix warning from Sparse
  target-mips: Fix warning from Sparse
  arm/nseries: Fix warnings from Sparse
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoMerge remote-tracking branch 'remotes/lalrae/tags/mips-20150318' into staging
Peter Maydell [Thu, 19 Mar 2015 13:04:07 +0000 (13:04 +0000)]
Merge remote-tracking branch 'remotes/lalrae/tags/mips-20150318' into staging

MIPS patches 2015-03-18

Changes:
* bug fixes

# gpg: Signature made Wed Mar 18 10:06:00 2015 GMT using RSA key ID 0B29DA6B
# gpg: Can't check signature: public key not found

* remotes/lalrae/tags/mips-20150318:
  target-mips: save cpu state before calling MSA load and store helpers
  target-mips: fix hflags modified in delay / forbidden slot
  target-mips: fix CP0.BadVAddr by stopping translation on Address Error

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-20150318-1' into staging
Peter Maydell [Thu, 19 Mar 2015 12:12:21 +0000 (12:12 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-20150318-1' into staging

vnc: fix websockets & QMP.

# gpg: Signature made Wed Mar 18 13:12:35 2015 GMT using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-vnc-20150318-1:
  ui: ensure VNC websockets server checks the ACL if requested
  ui: remove separate gnutls_session for websockets server
  ui: enforce TLS when using websockets server
  ui: fix setup of VNC websockets auth scheme with TLS
  ui: split setup of VNC auth scheme into separate method
  ui: report error if user requests VNC option that is unsupported
  ui: replace printf() calls with VNC_DEBUG
  ui: remove unused 'wiremode' variable in VncState struct
  vnc: Fix QMP change not to use funky error class

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoMerge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Peter Maydell [Thu, 19 Mar 2015 11:12:21 +0000 (11:12 +0000)]
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

pci, virtio bugfixes for 2.3

Just a bunch of bugfixes. Should be nothing remarkable here.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
# gpg: Signature made Wed Mar 18 12:31:03 2015 GMT using RSA key ID D28D5469
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream:
  pcie_aer: fix comment to match pcie spec
  pci: fix several trivial typos in comment
  aer: fix a wrong init PCI_ERR_COR_STATUS w1cmask type register
  pcie_aer: fix typos in pcie_aer_inject_error comment
  aer: fix wrong check on expose aer tlp prefix log
  pcie: correct mistaken register bit for End-End TLP Prefix Blocking
  virtio: Fix memory leaks reported by Coverity
  virtio: validate the existence of handle_output before calling it

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoMerge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
Peter Maydell [Thu, 19 Mar 2015 10:07:23 +0000 (10:07 +0000)]
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

- kvm: ioeventfd fix for PPC64LE
- virtio-scsi: misc fixes
- fix for --enable-profiler
- nbd: fixes from Max
- build: fix for scripts/make_device_config.sh
- exec: fix for address_space_translate

# gpg: Signature made Wed Mar 18 11:11:08 2015 GMT using RSA key ID 78C7AE83
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini/tags/for-upstream:
  exec: Respect as_tranlsate_internal length clamp
  virtio-scsi-dataplane: fix memory leak in virtio_scsi_vring_init
  profiler: Reenable built-in profiler
  kvm: fix ioeventfd endianness on bi-endian architectures
  virtio-scsi: Fix assert in virtio_scsi_push_event
  build: pass .d file name to scripts/make_device_config.sh, fix makefile target
  coroutine-io: Return -errno in case of error
  nbd: Drop unexpected data for NBD_OPT_LIST
  nbd: Fix interpretation of the export flags
  nbd: Fix nbd_receive_options()
  nbd: Set block size to BDRV_SECTOR_SIZE
  nbd: Fix potential signed overflow issues
  qemu-nbd: fork() can fail
  nbd: Handle blk_getlength() failure
  nbd: Pass return value from nbd_handle_list()
  nbd: Fix nbd_establish_connection()'s return value
  qemu-nbd: Detect unused partitions by system == 0
  util/uri: Add overflow check to rfc3986_parse_port
  nbd: Fix overflow return value

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoqga/commands-posix: Fix resource leak
Shannon Zhao [Sat, 14 Mar 2015 09:52:15 +0000 (17:52 +0800)]
qga/commands-posix: Fix resource leak

It's detected by coverity. Close the dirfd.

Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoelf-loader: Add missing error handling for call of lseek
Stefan Weil [Sat, 14 Mar 2015 15:42:01 +0000 (16:42 +0100)]
elf-loader: Add missing error handling for call of lseek

This fixes a warning from Coverity.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoelf-loader: Fix truncation warning from coverity
Stefan Weil [Sat, 14 Mar 2015 08:37:08 +0000 (09:37 +0100)]
elf-loader: Fix truncation warning from coverity

Coverity reports a truncation due to cast operation on operand
reltab->sh_size from 64 bits to 32 bits for calls of load_at.

Fix the types of the function arguments to match their use in
function load_at: the offset is used for lseek which takes an
off_t parameter, the size is used for g_malloc and read.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agohmp: Fix texinfo documentation
Markus Armbruster [Tue, 10 Mar 2015 12:23:04 +0000 (13:23 +0100)]
hmp: Fix texinfo documentation

Several issues:

* Commands i and o lack @item.  Their one-liner documentation gets
  squashed into the preceding command print.  Add the obvious @item.

* Commands i, o and cpu-add lack @findex.  The function index doesn't
  have them.  Add the obvious @findex.

* Commit 727f005 put block_set_io_throttle was added in the middle of
  block_passwd.  Move it.

* Correct spelling of commands chardev-add and chardev-remove in @item
  and @findex.

* Some commands have a blank line between @item/@findex and the text,
  most don't.  Normalize to no blank line.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoFix typos in comments
Viswesh [Tue, 17 Mar 2015 14:53:08 +0000 (22:53 +0800)]
Fix typos in comments

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Viswesh <visweshn92@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoqtest/ahci: Fix a bit mask expression
John Snow [Tue, 17 Mar 2015 20:58:19 +0000 (16:58 -0400)]
qtest/ahci: Fix a bit mask expression

A thinko that clang 3.5.0 caught.
Thankfully does not introduce any new failures.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agovl: fix resource leak with monitor_fdset_add_fd
Paolo Bonzini [Sun, 15 Mar 2015 09:16:28 +0000 (10:16 +0100)]
vl: fix resource leak with monitor_fdset_add_fd

monitor_fdset_add_fd returns an AddfdInfo struct (used by the QMP
command add_fd).  Free it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agosmbios: add max speed comdline option for type-17 (meory device) structure
Gabriel L. Somlo [Wed, 11 Mar 2015 17:58:01 +0000 (13:58 -0400)]
smbios: add max speed comdline option for type-17 (meory device) structure

Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agopc-dimm: Add description for device list.
Paulo Vital [Tue, 10 Mar 2015 11:25:51 +0000 (12:25 +0100)]
pc-dimm: Add description for device list.

The pc-dimm option presented on device list (by argument "-device \?")
is the unique option that don't have any information about it. This
patch adds a description for the pc-dimm device to help users to
identify it.

Signed-off-by: Paulo Vital <paulo.vital@profitbricks.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoconfigure: enable kvm on x32
Michael Tokarev [Thu, 12 Mar 2015 06:13:45 +0000 (09:13 +0300)]
configure: enable kvm on x32

Here's a trivial change to enable kvm on x32 architecture.
I'm not 100% sure the result works correctly in all cases,
but this is a good start and in theory everything should
work.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agoerror: Replace error_report() & error_free() with error_report_err()
zhanghailiang [Wed, 4 Mar 2015 10:25:54 +0000 (18:25 +0800)]
error: Replace error_report() & error_free() with error_report_err()

This is a continuation of the work started in commit 565f65d27:
"error: Use error_report_err() where appropriate"

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoarm: fix memory leak
Gonglei [Thu, 5 Mar 2015 02:58:32 +0000 (10:58 +0800)]
arm: fix memory leak

Cc: Michael Tokarev <mjt@tls.msk.ru>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoqmp: Drop unused .user_print from command definitions
Markus Armbruster [Fri, 6 Mar 2015 09:09:58 +0000 (10:09 +0100)]
qmp: Drop unused .user_print from command definitions

.user_print isn't used with QMP commands, only with HMP commands.
Copied over when QMP got its own command table in commit 82a56f0.
Most of them have been dropped since, but a few stragglers remain.
Drop them.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agohmp: Fix definition of command quit
Markus Armbruster [Fri, 6 Mar 2015 09:09:57 +0000 (10:09 +0100)]
hmp: Fix definition of command quit

The command handler is a union of two function types.  If
cmd->user_print is set, handle_user_command() calls
cmd->mhandler.cmd_new(), else cmd->mhandler.cmd().

Command definitions must therefore either set both user_print() and
mhandler.cmd_new(), or only mhandler.cmd().

quit's sets user_print and mhandler.cmd().  handle_user_command()
calls hmp_quit() through mhandler.cmd_new() rather than
mhandler.cmd(), i.e. through a function pointer with a different type.
Broken in commit 7a7f325, v1.0.

Works in practice because hmp_quit() doesn't use its arguments, and
handle_user_command() ignores its function value.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agotarget-moxie: Fix warnings from Sparse (one-bit signed bitfield)
Stefan Weil [Sun, 8 Mar 2015 18:44:02 +0000 (19:44 +0100)]
target-moxie: Fix warnings from Sparse (one-bit signed bitfield)

Report from Sparse:

target-moxie/mmu.h:9:12: error: dubious one-bit signed bitfield
target-moxie/mmu.h:10:12: error: dubious one-bit signed bitfield
target-moxie/mmu.h:11:12: error: dubious one-bit signed bitfield
target-moxie/mmu.h:12:12: error: dubious one-bit signed bitfield
target-moxie/mmu.h:13:12: error: dubious one-bit signed bitfield

Cc: Anthony Green <green@moxielogic.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoblock/qapi: Fix Sparse warning
Stefan Weil [Sat, 7 Mar 2015 22:16:21 +0000 (23:16 +0100)]
block/qapi: Fix Sparse warning

Sparse reports this warning:

block/qapi.c:417:47: warning:
 too long initializer-string for array of char(no space for nul char)

Replacing the string by an array of characters fixes this warning.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoFix remaining warnings from Sparse (void return)
Stefan Weil [Sun, 8 Mar 2015 18:30:01 +0000 (19:30 +0100)]
Fix remaining warnings from Sparse (void return)

Sparse report:

hw/display/vga.c:2000:5: warning: returning void-valued expression
hw/intc/arm_gic.c:707:9: warning: returning void-valued expression
hw/intc/etraxfs_pic.c:138:9: warning: returning void-valued expression
hw/nvram/fw_cfg.c:475:5: warning: returning void-valued expression
hw/timer/a9gtimer.c:124:5: warning: returning void-valued expression
hw/tpm/tpm_tis.c:794:5: warning: returning void-valued expression
hw/usb/hcd-musb.c:558:9: warning: returning void-valued expression
hw/usb/hcd-musb.c:776:13: warning: returning void-valued expression
hw/usb/hcd-musb.c:867:5: warning: returning void-valued expression
hw/usb/hcd-musb.c:932:5: warning: returning void-valued expression
include/qom/cpu.h:584:5: warning: returning void-valued expression
monitor.c:4686:13: warning: returning void-valued expression
monitor.c:4690:13: warning: returning void-valued expression

Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Andreas Färber <afaerber@suse.de>
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoqom: Fix warning from Sparse
Stefan Weil [Sun, 8 Mar 2015 18:23:32 +0000 (19:23 +0100)]
qom: Fix warning from Sparse

Sparse report:

qom/cpu.c:99:5: warning: returning void-valued expression

Cc: Andreas Färber <afaerber@suse.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agotarget-mips: Fix warning from Sparse
Stefan Weil [Sun, 8 Mar 2015 18:23:13 +0000 (19:23 +0100)]
target-mips: Fix warning from Sparse

Sparse report:

target-mips/dsp_helper.c:3681:5: warning: returning void-valued expression

Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Leon Alrae <leon.alrae@imgtec.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoarm/nseries: Fix warnings from Sparse
Stefan Weil [Sun, 8 Mar 2015 18:22:48 +0000 (19:22 +0100)]
arm/nseries: Fix warnings from Sparse

Sparse report:

arm/nseries.c:1406:5: warning: returning void-valued expression
arm/nseries.c:1411:5: warning: returning void-valued expression

Cc: Andrzej Zaborowski <balrogg@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoomap: Fix warnings from Sparse
Stefan Weil [Sun, 8 Mar 2015 18:21:13 +0000 (19:21 +0100)]
omap: Fix warnings from Sparse

Sparse report:

arm/omap1.c:1015:9: warning: returning void-valued expression
arm/omap1.c:1084:9: warning: returning void-valued expression
arm/omap1.c:1178:9: warning: returning void-valued expression
arm/omap1.c:1287:9: warning: returning void-valued expression
arm/omap1.c:1382:9: warning: returning void-valued expression
arm/omap1.c:1650:9: warning: returning void-valued expression
arm/omap1.c:1778:9: warning: returning void-valued expression
arm/omap1.c:1985:9: warning: returning void-valued expression
arm/omap1.c:210:9: warning: returning void-valued expression
arm/omap1.c:2213:9: warning: returning void-valued expression
arm/omap1.c:2352:9: warning: returning void-valued expression
arm/omap1.c:2447:9: warning: returning void-valued expression
arm/omap1.c:2640:9: warning: returning void-valued expression
arm/omap1.c:317:9: warning: returning void-valued expression
arm/omap1.c:3413:13: warning: returning void-valued expression
arm/omap1.c:3414:13: warning: returning void-valued expression
arm/omap1.c:3415:14: warning: returning void-valued expression
arm/omap1.c:3589:9: warning: returning void-valued expression
arm/omap1.c:443:9: warning: returning void-valued expression
arm/omap1.c:588:9: warning: returning void-valued expression
arm/omap1.c:860:9: warning: returning void-valued expression
arm/omap2.c:1362:9: warning: returning void-valued expression
arm/omap2.c:450:9: warning: returning void-valued expression
arm/omap2.c:695:9: warning: returning void-valued expression
arm/omap2.c:760:9: warning: returning void-valued expression
hw/char/omap_uart.c:115:9: warning: returning void-valued expression
hw/display/omap_dss.c:1019:9: warning: returning void-valued expression
hw/display/omap_dss.c:215:9: warning: returning void-valued expression
hw/display/omap_dss.c:380:9: warning: returning void-valued expression
hw/display/omap_dss.c:739:9: warning: returning void-valued expression
hw/display/omap_dss.c:931:9: warning: returning void-valued expression
hw/dma/omap_dma.c:139:5: warning: returning void-valued expression
hw/dma/omap_dma.c:1505:9: warning: returning void-valued expression
hw/dma/omap_dma.c:1860:9: warning: returning void-valued expression
hw/gpio/omap_gpio.c:116:9: warning: returning void-valued expression
hw/misc/omap_gpmc.c:627:9: warning: returning void-valued expression
hw/misc/omap_l4.c:85:9: warning: returning void-valued expression
hw/misc/omap_sdrc.c:95:9: warning: returning void-valued expression
hw/misc/omap_tap.c:98:9: warning: returning void-valued expression
hw/sd/omap_mmc.c:409:9: warning: returning void-valued expression
hw/ssi/omap_spi.c:229:9: warning: returning void-valued expression
hw/timer/omap_gptimer.c:447:9: warning: returning void-valued expression

Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years ago9pfs: Fix warnings from Sparse
Stefan Weil [Sun, 8 Mar 2015 18:17:54 +0000 (19:17 +0100)]
9pfs: Fix warnings from Sparse

Sparse report:

9pfs/virtio-9p.c:1953:9: warning: returning void-valued expression
9pfs/virtio-9p-handle.c:143:5: warning: returning void-valued expression
9pfs/virtio-9p-handle.c:160:5: warning: returning void-valued expression
9pfs/virtio-9p-local.c:384:5: warning: returning void-valued expression
9pfs/virtio-9p-local.c:415:5: warning: returning void-valued expression
9pfs/virtio-9p-proxy.c:672:5: warning: returning void-valued expression
9pfs/virtio-9p-proxy.c:689:5: warning: returning void-valued expression

Cc: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agobackends: Fix warning from Sparse
Stefan Weil [Sun, 8 Mar 2015 18:14:47 +0000 (19:14 +0100)]
backends: Fix warning from Sparse

Sparse report:

backends/tpm.c:39:5: warning: returning void-valued expression

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agocris: remove unused cris_cond15 declarations
Michael Tokarev [Tue, 10 Mar 2015 05:31:30 +0000 (08:31 +0300)]
cris: remove unused cris_cond15 declarations

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
9 years agopcie_aer: fix comment to match pcie spec
Michael S. Tsirkin [Wed, 18 Mar 2015 11:45:53 +0000 (12:45 +0100)]
pcie_aer: fix comment to match pcie spec

Code comment says "table 6-2" but in fact it's is not a table, it is
"Figure 6-2" on page 479.

Cc: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopci: fix several trivial typos in comment
Chen Fan [Tue, 10 Mar 2015 01:52:23 +0000 (09:52 +0800)]
pci: fix several trivial typos in comment

Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agoaer: fix a wrong init PCI_ERR_COR_STATUS w1cmask type register
Chen Fan [Tue, 10 Mar 2015 01:49:49 +0000 (09:49 +0800)]
aer: fix a wrong init PCI_ERR_COR_STATUS w1cmask type register

Error Status Register, so this patch fix a wrong definition
for PCI_ERR_COR_STATUS register with w1cmask type.

Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopcie_aer: fix typos in pcie_aer_inject_error comment
Chen Fan [Tue, 10 Mar 2015 01:49:48 +0000 (09:49 +0800)]
pcie_aer: fix typos in pcie_aer_inject_error comment

Refer to "PCI Express Base Spec3.0", this comments can't
fit the description in spec, so we should fix them.

Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agoaer: fix wrong check on expose aer tlp prefix log
Chen Fan [Fri, 13 Mar 2015 03:18:04 +0000 (11:18 +0800)]
aer: fix wrong check on expose aer tlp prefix log

when specify TLP Prefix log as using pcie_aer_inject_error,
the TLP prefix log is always discarded. because the check
is incorrect, the End-End TLP Prefix Supported bit
(PCI_EXP_DEVCAP2_EETLPP) should be in Device Capabilities 2 Register.

Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopcie: correct mistaken register bit for End-End TLP Prefix Blocking
Chen Fan [Fri, 13 Mar 2015 03:18:03 +0000 (11:18 +0800)]
pcie: correct mistaken register bit for End-End TLP Prefix Blocking

from pcie spec 7.8.17, the End-End TLP Prefix Blocking bit local
is 15(e.g. 0x8000) in device control 2 register.

Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agoexec: Respect as_tranlsate_internal length clamp
Peter Crosthwaite [Tue, 17 Mar 2015 05:35:54 +0000 (22:35 -0700)]
exec: Respect as_tranlsate_internal length clamp

address_space_translate_internal will clamp the *plen length argument
based on the size of the memory region being queried. The iommu walker
logic in addresss_space_translate was ignoring this by discarding the
post fn call value of *plen. Fix by just always using *plen as the
length argument throughout the fn, removing the len local variable.

This fixes a bootloader bug when a single elf section spans multiple
QEMU memory regions.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Message-Id: <1426570554-15940-1-git-send-email-peter.crosthwaite@xilinx.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agovirtio-scsi-dataplane: fix memory leak in virtio_scsi_vring_init
Bo Su [Wed, 18 Mar 2015 09:42:12 +0000 (09:42 +0000)]
virtio-scsi-dataplane: fix memory leak in virtio_scsi_vring_init

if k->set_host_notifier failed, VirtIOSCSIVring *r will leak

Signed-off-by: Bo Su <subo7@huawei.com>
Message-Id: <1426671732-80213-1-git-send-email-subo7@huawei.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agoprofiler: Reenable built-in profiler
Alexey Kardashevskiy [Mon, 16 Mar 2015 03:57:38 +0000 (14:57 +1100)]
profiler: Reenable built-in profiler

2ed1ebcf6 "timer: replace time() with QEMU_CLOCK_HOST" broke compile
when configured with --enable-profiler. Turned out the profiler has been
broken for a while.

This does s/qemu_time/tcg_time/ as the profiler only works in a TCG mode.
This also fixes the compile error.

This changes profile_getclock() to return nanoseconds rather than
CPU ticks as the "profile" HMP command prints seconds and there is no
platform-independent way to get ticks-per-second rate.
Since TCG is quite slow and get_clock() returns nanoseconds (fine
enough), this should not affect precision much.

This removes unused qemu_time_start and tlb_flush_time.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Message-Id: <1426478258-29961-1-git-send-email-aik@ozlabs.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agokvm: fix ioeventfd endianness on bi-endian architectures
Greg Kurz [Fri, 13 Mar 2015 21:23:37 +0000 (22:23 +0100)]
kvm: fix ioeventfd endianness on bi-endian architectures

KVM expects host endian values. Hosts that don't use the default endianness
need to negate the swap performed in adjust_endianness().

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Message-Id: <20150313212337.31142.3991.stgit@bahia.local>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agovirtio-scsi: Fix assert in virtio_scsi_push_event
Fam Zheng [Fri, 13 Mar 2015 07:55:54 +0000 (15:55 +0800)]
virtio-scsi: Fix assert in virtio_scsi_push_event

Hotplugging a scsi-disk may trigger the assertion in qemu_sgl_concat.

    qemu-system-x86_64: qemu/hw/scsi/virtio-scsi.c:115: qemu_sgl_concat:
    Assertion `skip == 0' failed.

This is introduced by commit 55783a55 (virtio-scsi: work around bug in
old BIOSes) which didn't check out_num when accessing out_sg[0].iov_len
(the same to in sg). For virtio_scsi_push_event, looking into out_sg
doesn't make sense because 0 req_size is intended.

Cc: qemu-stable@nongnu.org
[Cc'ing qemu-stable because 55783a55 did it too]
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <1426233354-525-1-git-send-email-famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agobuild: pass .d file name to scripts/make_device_config.sh, fix makefile target
Paolo Bonzini [Thu, 12 Mar 2015 15:00:05 +0000 (16:00 +0100)]
build: pass .d file name to scripts/make_device_config.sh, fix makefile target

The .d file name must match exactly what is used in the SUBDIR_DEVICES_MAK_DEP
variable.  Instead of making assumptions in the make_device_config.sh script,
just pass it in.

Similarly, the makefile target may not match the output file name, because
Makefile uses a temporary file.  Instead of making assumptions on what the
Makefile does, emit the config-devices.mak file to stdout, and use the
passed-in destination as the makefile target

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agocoroutine-io: Return -errno in case of error
Max Reitz [Wed, 25 Feb 2015 18:08:28 +0000 (13:08 -0500)]
coroutine-io: Return -errno in case of error

In case qemu_co_sendv_recvv() fails without any data read, there is no
reason not to return the perfectly fine error number retrieved from
socket_error().

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-16-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agonbd: Drop unexpected data for NBD_OPT_LIST
Max Reitz [Wed, 25 Feb 2015 18:08:34 +0000 (13:08 -0500)]
nbd: Drop unexpected data for NBD_OPT_LIST

When requesting the list of exports, no data should be sent. If data is
sent, the NBD server should not just inform the client of the invalid
request, but also drop the data.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-22-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agonbd: Fix interpretation of the export flags
Max Reitz [Wed, 25 Feb 2015 18:08:32 +0000 (13:08 -0500)]
nbd: Fix interpretation of the export flags

The export flags are a 16 bit value, so be16_to_cpu() has to be used to
interpret them correctly. This makes discard and flush actually work
for named NBD exports (they did not work before, because the client
always assumed them to be unsupported because of the bug fixed by this
patch).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-20-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agonbd: Fix nbd_receive_options()
Max Reitz [Wed, 25 Feb 2015 18:08:31 +0000 (13:08 -0500)]
nbd: Fix nbd_receive_options()

The client flags are sent exactly once overall, not once per option.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-19-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agonbd: Set block size to BDRV_SECTOR_SIZE
Max Reitz [Wed, 25 Feb 2015 18:08:25 +0000 (13:08 -0500)]
nbd: Set block size to BDRV_SECTOR_SIZE

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-13-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agonbd: Fix potential signed overflow issues
Max Reitz [Wed, 25 Feb 2015 18:08:23 +0000 (13:08 -0500)]
nbd: Fix potential signed overflow issues

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-11-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agoqemu-nbd: fork() can fail
Max Reitz [Wed, 25 Feb 2015 18:08:22 +0000 (13:08 -0500)]
qemu-nbd: fork() can fail

It is very unlikely, but it is possible.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-10-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agonbd: Handle blk_getlength() failure
Max Reitz [Wed, 25 Feb 2015 18:08:21 +0000 (13:08 -0500)]
nbd: Handle blk_getlength() failure

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-9-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agonbd: Pass return value from nbd_handle_list()
Max Reitz [Wed, 25 Feb 2015 18:08:19 +0000 (13:08 -0500)]
nbd: Pass return value from nbd_handle_list()

While it does not make a difference in practice, nbd_receive_options()
generally returns -errno, so it should do that here as well; and the
easiest way to achieve this is by passing on the value returned by
nbd_handle_list().

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-7-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agonbd: Fix nbd_establish_connection()'s return value
Max Reitz [Wed, 25 Feb 2015 18:08:16 +0000 (13:08 -0500)]
nbd: Fix nbd_establish_connection()'s return value

unix_connect_opts() and inet_connect_opts() do not necessarily set errno
(if at all); therefore, nbd_establish_connection() should not literally
return -errno on error.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-4-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agoqemu-nbd: Detect unused partitions by system == 0
Max Reitz [Wed, 25 Feb 2015 18:08:15 +0000 (13:08 -0500)]
qemu-nbd: Detect unused partitions by system == 0

Unused partitions do not necessarily have a total sector count of 0
(although they should have), but they always do have the system field
set to 0, so use that for testing whether a partition is in use rather
than the sector count field alone.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-3-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agoutil/uri: Add overflow check to rfc3986_parse_port
Max Reitz [Wed, 25 Feb 2015 18:08:14 +0000 (13:08 -0500)]
util/uri: Add overflow check to rfc3986_parse_port

And while at it, replace tabs by eight spaces in this function.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-2-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agonbd: Fix overflow return value
Yik Fang [Thu, 12 Feb 2015 06:21:51 +0000 (06:21 +0000)]
nbd: Fix overflow return value

The value of reply.error should be the type unsigned int.

Signed-off-by: Yik Fang <eric.fangyi@huawei.com>
Message-Id: <1423722111-12902-1-git-send-email-eric.fangyi@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agotarget-mips: save cpu state before calling MSA load and store helpers
Leon Alrae [Mon, 16 Mar 2015 16:29:34 +0000 (16:29 +0000)]
target-mips: save cpu state before calling MSA load and store helpers

PC needs to be saved if an exception can be generated by an helper.
This fixes a problem related to resuming the execution at unexpected address
after an exception (caused by MSA load/store instruction) has been serviced.

Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
9 years agotarget-mips: fix hflags modified in delay / forbidden slot
Leon Alrae [Thu, 29 Jan 2015 16:15:00 +0000 (16:15 +0000)]
target-mips: fix hflags modified in delay / forbidden slot

All instructions which may change hflags terminate tb. However, this doesn't
work if such an instruction is placed in delay or forbidden slot.
gen_branch() clears MIPS_HFLAG_BMASK in ctx->hflags and then generates code
to overwrite hflags with ctx->hflags, consequently we loose any execution-time
hflags modifications. For example, in the following scenario hflag related to
Status.CU1 will not be updated:
    /* Set Status.CU1 in delay slot */
    mfc0  $24, $12, 0
    lui   $25, 0x2000
    or    $25, $25, $24
    b     check_Status_CU1
    mtc0  $25, $12, 0

With this change we clear MIPS_HFLAG_BMASK in execution-time hflags if
instruction in delay or forbidden slot wants to terminate tb for some reason
(i.e. ctx->bstate != BS_NONE).

Also, die early and loudly if "unknown branch" is encountered as this should
never happen.

Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
9 years agotarget-mips: fix CP0.BadVAddr by stopping translation on Address Error
Leon Alrae [Mon, 16 Mar 2015 16:54:42 +0000 (16:54 +0000)]
target-mips: fix CP0.BadVAddr by stopping translation on Address Error

CP0.BadVAddr is supposed to capture the most recent virtual address that caused
the exception. Currently this does not work correctly for unaligned instruction
fetch as translation is not stopped and CP0.BadVAddr is updated with subsequent
addresses.

Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
9 years agoui: ensure VNC websockets server checks the ACL if requested
Daniel P. Berrange [Tue, 17 Mar 2015 13:43:00 +0000 (13:43 +0000)]
ui: ensure VNC websockets server checks the ACL if requested

If the x509verify option is requested, the VNC websockets server
was failing to validate that the websockets client provided an
x509 certificate matching the ACL rules.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agoui: remove separate gnutls_session for websockets server
Daniel P. Berrange [Tue, 17 Mar 2015 13:42:59 +0000 (13:42 +0000)]
ui: remove separate gnutls_session for websockets server

The previous change to the auth scheme handling guarantees we
can never have nested TLS sessions in the VNC websockets server.
Thus we can remove the separate gnutls_session instance.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agoui: enforce TLS when using websockets server
Daniel P. Berrange [Tue, 17 Mar 2015 13:42:58 +0000 (13:42 +0000)]
ui: enforce TLS when using websockets server

When TLS is required, the primary VNC server considers it to be
mandatory. ie the server admin decides whether or not TLS is used,
and the client has to comply with this decision. The websockets
server, however, treated it as optional, allowing non-TLS clients
to connect to a server which had setup TLS. Thus enabling websockets
lowers the security of the VNC server leaving the admin no way to
enforce use of TLS.

This removes the code that allows non-TLS fallback in the websockets
server, so that if TLS is requested for VNC it is now mandatory for
both the primary VNC server and the websockets VNC server.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agoui: fix setup of VNC websockets auth scheme with TLS
Daniel P. Berrange [Tue, 17 Mar 2015 13:42:57 +0000 (13:42 +0000)]
ui: fix setup of VNC websockets auth scheme with TLS

The way the websockets TLS code was integrated into the VNC server
made it essentially useless. The only time that the websockets TLS
support could be used is if the primary VNC server had its existing
TLS support disabled. ie QEMU had to be launched with:

  # qemu -vnc localhost:1,websockets=5902,x509=/path/to/certs

Note the absence of the 'tls' flag. This is already a bug, because
the docs indicate that 'x509' is ignored unless 'tls' is given.

If the primary VNC server had TLS turned on via the 'tls' flag,
then this prevented the websockets TLS support from being used,
because it activates the VeNCrypt auth which would have resulted
in TLS being run over a TLS session. Of course no websockets VNC
client supported VeNCrypt so in practice, since the browser clients
cannot setup a nested TLS session over the main HTTPS connection,
so it would not even get past auth.

This patch causes us to decide our auth scheme separately for the
main VNC server vs the websockets VNC server. We take account of
the fact that if TLS is enabled, then the websockets client will
use https, so setting up VeNCrypt is thus redundant as it would
lead to nested TLS sessions.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agoui: split setup of VNC auth scheme into separate method
Daniel P. Berrange [Tue, 17 Mar 2015 13:42:56 +0000 (13:42 +0000)]
ui: split setup of VNC auth scheme into separate method

The vnc_display_open method is quite long and complex, so
move the VNC auth scheme decision logic into a separate
method for clarity.

Also update the comment to better describe what we are
trying to achieve.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agoui: report error if user requests VNC option that is unsupported
Daniel P. Berrange [Tue, 17 Mar 2015 13:42:55 +0000 (13:42 +0000)]
ui: report error if user requests VNC option that is unsupported

If the VNC server is built without tls, sasl or websocket support
and the user requests one of these features, they are just silently
ignored. This is bad because it means the VNC server ends up running
in a configuration that is less secure than the user asked for.
It also leads to an tangled mass of preprocessor conditionals when
configuring the VNC server.

This ensures that the tls, sasl & websocket options are always
processed and an error is reported back to the user if any of
them were disabled at build time.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agoui: replace printf() calls with VNC_DEBUG
Daniel P. Berrange [Tue, 17 Mar 2015 13:42:54 +0000 (13:42 +0000)]
ui: replace printf() calls with VNC_DEBUG

Handling of VNC audio messages results in printfs to the console.
This is of no use to anyone in production, so should be using the
normal VNC_DEBUG macro instead.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agoui: remove unused 'wiremode' variable in VncState struct
Daniel P. Berrange [Tue, 17 Mar 2015 13:42:53 +0000 (13:42 +0000)]
ui: remove unused 'wiremode' variable in VncState struct

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agoUpdate version for v2.3.0-rc0 release
Peter Maydell [Tue, 17 Mar 2015 18:58:33 +0000 (18:58 +0000)]
Update version for v2.3.0-rc0 release

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoMerge remote-tracking branch 'remotes/juanquintela/tags/migration/20150317' into...
Peter Maydell [Tue, 17 Mar 2015 17:11:33 +0000 (17:11 +0000)]
Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20150317' into staging

migration/next for 20150317

# gpg: Signature made Tue Mar 17 14:21:14 2015 GMT using RSA key ID 5872D723
# gpg: Can't check signature: public key not found

* remotes/juanquintela/tags/migration/20150317:
  migration: Expose 'cancelling' status to user
  migration: Convert 'status' of MigrationInfo to use an enum type
  hmp: Rename 'MigrationStatus' to 'HMPMigrationStatus'
  migration: Rename abbreviated macro MIG_STATE_* to MIGRATION_STATUS_*
  migration: Remove unused functions
  arch_init: Count the total number of pages by using helper function
  migrate_incoming: Cleanup/clarify error messages
  Warn against the use of the string as uri parameter to migrate-incoming
  migrate_incoming: use hmp_handle_error
  migration: Fix remaining 32 bit compiler errors
  migration: Fix some 32 bit compiler errors
  migration/rdma: clean up qemu_rdma_dest_init a bit
  migration: Avoid qerror_report_err() outside QMP command handlers

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoMerge remote-tracking branch 'remotes/afaerber/tags/qom-cpu-for-peter' into staging
Peter Maydell [Tue, 17 Mar 2015 16:19:12 +0000 (16:19 +0000)]
Merge remote-tracking branch 'remotes/afaerber/tags/qom-cpu-for-peter' into staging

QOM CPUState and X86CPU

* QTest for PC X86CPU
* Confinement of ICC bridge X86CPU parenting to PC code

# gpg: Signature made Tue Mar 17 15:23:31 2015 GMT using RSA key ID 3E7E013F
# gpg: Good signature from "Andreas Färber <afaerber@suse.de>"
# gpg:                 aka "Andreas Färber <afaerber@suse.com>"

* remotes/afaerber/tags/qom-cpu-for-peter:
  target-i386: Remove icc_bridge parameter from cpu_x86_create()
  tests: Add PC CPU test
  pc: Suppress APIC ID compatibility warning for QTest

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoMerge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging
Peter Maydell [Tue, 17 Mar 2015 15:23:23 +0000 (15:23 +0000)]
Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging

QOM infrastructure fixes and device conversions

* Conversion of cadence_uart to QOM realize
* qom-tree QMP script
* qom-list and qom-set HMP commands to match their QMP counterparts
* Basic qom-tree HMP command
* Cleanups for /machine QOM composition tree

# gpg: Signature made Tue Mar 17 15:02:57 2015 GMT using RSA key ID 3E7E013F
# gpg: Good signature from "Andreas Färber <afaerber@suse.de>"
# gpg:                 aka "Andreas Färber <afaerber@suse.com>"

* remotes/afaerber/tags/qom-devices-for-peter:
  qdev: Move owner-less IRQs to /machine/unattached
  memory: Move owner-less MemoryRegions to /machine/unattached
  qom: Implement info qom-tree HMP command
  qom: Implement qom-set HMP command
  qom: Implement qom-list HMP command
  scripts: Add qom-tree script
  cadence_uart: Convert to QOM realize()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agomigration: Expose 'cancelling' status to user
zhanghailiang [Fri, 13 Mar 2015 08:08:41 +0000 (16:08 +0800)]
migration: Expose 'cancelling' status to user

'cancelling' status was introduced by commit 51cf4c1a, mainly to avoid a
possible start of a new migration process while the previous one still exists.
But we didn't expose this status to user, instead we returned the 'active' state.

Here, we expose it to the user (such as libvirt), 'cancelling' status only
occurs for a short window before the migration aborts, so for users,
if they cancel a migration process, it will observe 'cancelling' status
occasionally.

Testing revealed that with older libvirt (anything 1.2.13 or less) will
print an odd error message if the state is seen, but that the migration
is still properly cancelled. Newer libvirt will be patched to recognize
the new state without the odd error message.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Cc: libvir-list@redhat.com
Signed-off-by: Juan Quintela <quintela@redhat.com>
9 years agomigration: Convert 'status' of MigrationInfo to use an enum type
zhanghailiang [Fri, 13 Mar 2015 08:08:40 +0000 (16:08 +0800)]
migration: Convert 'status' of MigrationInfo to use an enum type

The original 'status' is an open-coded 'str' type, convert it to use an
enum type.
This conversion is backwards compatible, better documented and
more convenient for future extensibility.

In addition, Fix a typo for qapi-schema.json (just remove the typo) :
s/'completed'. 'comppleted' (since 1.2)/'completed' (since 1.2)

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
9 years agohmp: Rename 'MigrationStatus' to 'HMPMigrationStatus'
zhanghailiang [Fri, 13 Mar 2015 08:08:39 +0000 (16:08 +0800)]
hmp: Rename 'MigrationStatus' to 'HMPMigrationStatus'

We will use the typename 'MigrationStatus' for publicly exported typename,
So here we rename the internal-only 'MigrationStatus' to
'HMPMigrationStatus'.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
9 years agomigration: Rename abbreviated macro MIG_STATE_* to MIGRATION_STATUS_*
zhanghailiang [Fri, 13 Mar 2015 08:08:38 +0000 (16:08 +0800)]
migration: Rename abbreviated macro MIG_STATE_* to MIGRATION_STATUS_*

Rename all macro MIG_STATE_* to  MIGRATION_STATUS_* except "MIG_STATE_ERROR",
we rename it to "MIGRATION_STATUS_FAILED" which will match the migration status
string 'failed'.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
9 years agomigration: Remove unused functions
Thomas Huth [Sat, 14 Mar 2015 06:19:28 +0000 (07:19 +0100)]
migration: Remove unused functions

migrate_rdma_pin_all() and qsb_clone() are completely unused and thus
can be deleted.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: Juan Quintela <quintela@redhat.com>
Cc: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
9 years agoarch_init: Count the total number of pages by using helper function
zhanghailiang [Mon, 9 Mar 2015 09:27:38 +0000 (17:27 +0800)]
arch_init: Count the total number of pages by using helper function

There is already a helper function ram_bytes_total(), we can use it to
help counting the total number of pages used by ram blocks.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
9 years agomigrate_incoming: Cleanup/clarify error messages
Dr. David Alan Gilbert [Thu, 26 Feb 2015 14:54:41 +0000 (14:54 +0000)]
migrate_incoming: Cleanup/clarify error messages

Create a separate error for the case where migrate_incoming is
used after a succesful migrate_incoming.

Reword the error in the case where '-incoming defer' is missing
to omit the command name so it's right for both hmp and qmp.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
9 years agoWarn against the use of the string as uri parameter to migrate-incoming
Dr. David Alan Gilbert [Thu, 26 Feb 2015 14:54:40 +0000 (14:54 +0000)]
Warn against the use of the string as uri parameter to migrate-incoming

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
9 years agomigrate_incoming: use hmp_handle_error
Dr. David Alan Gilbert [Thu, 26 Feb 2015 14:54:39 +0000 (14:54 +0000)]
migrate_incoming: use hmp_handle_error

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
9 years agomigration: Fix remaining 32 bit compiler errors
Stefan Weil [Sat, 28 Feb 2015 18:09:43 +0000 (19:09 +0100)]
migration: Fix remaining 32 bit compiler errors

Fix type casts between pointers and 64 bit integers.
Now 32 bit builds are possible again.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Juan Quintela <quintela@redhat.com>
9 years agomigration: Fix some 32 bit compiler errors
Stefan Weil [Sat, 28 Feb 2015 18:09:42 +0000 (19:09 +0100)]
migration: Fix some 32 bit compiler errors

The current code won't compile on 32 bit hosts because there are lots
of type casts between pointers and 64 bit integers.

Fix some of them.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Juan Quintela <quintela@redhat.com>
9 years agomigration/rdma: clean up qemu_rdma_dest_init a bit
Michael Tokarev [Mon, 16 Feb 2015 07:50:25 +0000 (10:50 +0300)]
migration/rdma: clean up qemu_rdma_dest_init a bit

Do not check for rdma->host being empty twice.  This removes a large
"if" block, so code indentation is changed.  While at it, remove an
ugly goto from the loop, replacing it with a cleaner if logic.  And
finally, there's no need to initialize `ret' variable since is always
has a value.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Tested-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
--

fixed space detected by Dave
Signed-off-by: Juan Quintela <quintela@redhat.com>
9 years agomigration: Avoid qerror_report_err() outside QMP command handlers
Markus Armbruster [Wed, 18 Feb 2015 18:21:52 +0000 (19:21 +0100)]
migration: Avoid qerror_report_err() outside QMP command handlers

qerror_report_err() is a transitional interface to help with
converting existing monitor commands to QMP.  It should not be used
elsewhere.  Replace by error_report_err() in
process_incoming_migration_co().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
9 years agotarget-i386: Remove icc_bridge parameter from cpu_x86_create()
Eduardo Habkost [Thu, 5 Mar 2015 17:26:51 +0000 (14:26 -0300)]
target-i386: Remove icc_bridge parameter from cpu_x86_create()

Instead of passing icc_bridge from the PC initialization code to
cpu_x86_create(), make the PC initialization code attach the CPU to
icc_bridge.

The only difference here is that icc_bridge attachment will now be done
after x86_cpu_parse_featurestr() is called. But this shouldn't make any
difference, as property setters shouldn't depend on icc_bridge.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
9 years agotests: Add PC CPU test
Andreas Färber [Fri, 13 Mar 2015 16:21:11 +0000 (17:21 +0100)]
tests: Add PC CPU test

Test non-default -smp core and thread counts and a non-default CPU model
on all PC machines except for isapc. Note that not all historic versions
actually supported this particular configuration, ignored for simplicity.

For machines pc-*-1.5+ test QMP cpu-add with monotonically increasing ID,
and test for graceful failure otherwise.

Cc: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
9 years agopc: Suppress APIC ID compatibility warning for QTest
Andreas Färber [Sat, 14 Mar 2015 13:24:37 +0000 (14:24 +0100)]
pc: Suppress APIC ID compatibility warning for QTest

This avoids cluttering GTester output with irrelevant warnings.

Cc: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
9 years agoqdev: Move owner-less IRQs to /machine/unattached
Andreas Färber [Thu, 12 Mar 2015 15:09:34 +0000 (16:09 +0100)]
qdev: Move owner-less IRQs to /machine/unattached

Move non-qdev-gpio[*] from /machine into /machine/unattached.
For the PC this moves 25 nodes from the stable namespace into the unstable.

Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Tested-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
9 years agomemory: Move owner-less MemoryRegions to /machine/unattached
Andreas Färber [Thu, 12 Mar 2015 14:37:07 +0000 (15:37 +0100)]
memory: Move owner-less MemoryRegions to /machine/unattached

This cleans up the official /machine namespace. In particular
/machine/system[0] and /machine/io[0], as well as entries with
non-sanitized node names such as "/machine/qemu extended regs[0]".

The actual MemoryRegion names remain unchanged.

Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
9 years agoqom: Implement info qom-tree HMP command
Andreas Färber [Wed, 7 May 2014 15:03:18 +0000 (17:03 +0200)]
qom: Implement info qom-tree HMP command

To complement qdev's bus-oriented info qtree, info qom-tree
prints a hierarchical view of the QOM composition tree.

By default, the machine composition tree is shown. This can be overriden
by supplying a path argument, such as "info qom-tree /".

Tested-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
9 years agoqom: Implement qom-set HMP command
Andreas Färber [Wed, 7 May 2014 17:48:15 +0000 (19:48 +0200)]
qom: Implement qom-set HMP command

Re-implemented based on qmp_qom_set() to facilitate argument parsing.

Warn about ambiguous path arguments.

Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Tested-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
9 years agoqom: Implement qom-list HMP command
Andreas Färber [Wed, 7 May 2014 16:08:29 +0000 (18:08 +0200)]
qom: Implement qom-list HMP command

Implement it as a wrapper for QMP qom-list, but mimic the behavior of
scripts/qmp/qom-list in making the path argument optional and listing
the root if absent, to hint users what kind of path to pass.

Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Tested-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
9 years agoscripts: Add qom-tree script
Andreas Färber [Wed, 5 Feb 2014 17:31:06 +0000 (18:31 +0100)]
scripts: Add qom-tree script

Functionally it is a recursive qom-list with qom-get per non-child<>
property. Some failures needed to be handled, such as trying to read a
pointer property, which is not representable in QMP. Those print a
literal "<EXCEPTION>".

Tested-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
9 years agovnc: Fix QMP change not to use funky error class
Markus Armbruster [Fri, 13 Mar 2015 17:43:09 +0000 (18:43 +0100)]
vnc: Fix QMP change not to use funky error class

Error classes are a leftover from the days of "rich" error objects.
New code should always use ERROR_CLASS_GENERIC_ERROR.  Commit 1d0d59f
added a use of ERROR_CLASS_DEVICE_NOT_FOUND.  Replace it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agocadence_uart: Convert to QOM realize()
Alistair Francis [Fri, 27 Feb 2015 01:48:58 +0000 (11:48 +1000)]
cadence_uart: Convert to QOM realize()

Use DeviceClass::realize() and TypeInfo::instance_init() instead of
the deprecated SysBusDevice::init().

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
9 years agoMerge remote-tracking branch 'remotes/armbru/tags/pull-cov-model-2015-03-17' into...
Peter Maydell [Tue, 17 Mar 2015 11:43:00 +0000 (11:43 +0000)]
Merge remote-tracking branch 'remotes/armbru/tags/pull-cov-model-2015-03-17' into staging

coverity: Fix g_malloc_n-like models

# gpg: Signature made Tue Mar 17 10:17:56 2015 GMT using RSA key ID EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"

* remotes/armbru/tags/pull-cov-model-2015-03-17:
  coverity: Fix g_malloc_n-like models

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-gl-20150317-1' into staging
Peter Maydell [Tue, 17 Mar 2015 10:26:09 +0000 (10:26 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-gl-20150317-1' into staging

opengl: fix configure test

# gpg: Signature made Tue Mar 17 10:11:24 2015 GMT using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-gl-20150317-1:
  opengl: fix configure test

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoopengl: fix configure test
Gerd Hoffmann [Mon, 16 Mar 2015 09:03:53 +0000 (10:03 +0100)]
opengl: fix configure test

Re-add the glx compile test to configure.  We can't use pkg-config to
probe for glx, and as long as milkymist-tmu2 privately uses glx (due to
opengl infrastructure in qemu not being ready yet) we must continue to
test for glx to avoid build failures.

Reported-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
9 years agocoverity: Fix g_malloc_n-like models
Jan Kiszka [Thu, 12 Mar 2015 11:24:26 +0000 (12:24 +0100)]
coverity: Fix g_malloc_n-like models

Allocate the calculated overall size, not only the size of a single
element.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
9 years agoMerge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Peter Maydell [Mon, 16 Mar 2015 19:19:03 +0000 (19:19 +0000)]
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block patches for 2.3-rc0

# gpg: Signature made Mon Mar 16 16:11:55 2015 GMT using RSA key ID C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"

* remotes/kevin/tags/for-upstream:
  block/vpc: remove disabled code from get_sector_offset
  block/vpc: rename footer->size -> footer->current_size
  block/vpc: make calculate_geometry spec conform
  vpc: Ignore geometry for large images
  block/vpc: optimize vpc_co_get_block_status
  block: Drop bdrv_find
  blockdev: Convert bdrv_find to blk_by_name
  migration: Convert bdrv_find to blk_by_name
  monitor: Convert bdrv_find to blk_by_name
  iotests: Test non-self-referential qcow2 refblocks
  iotests: Add tests for refcount table growth
  qcow2: Respect new_block in alloc_refcount_block()
  qemu-img: Avoid qerror_report_err() outside QMP handlers, again
  block: Fix block-set-write-threshold not to use funky error class
  block: Deprecate QCOW/QCOW2 encryption
  qemu-img: Fix convert, amend error messages for unknown options
  iotests: Update 051's reference output

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoMerge remote-tracking branch 'remotes/bkoppelmann/tags/pull-tricore-20150316' into...
Peter Maydell [Mon, 16 Mar 2015 18:27:13 +0000 (18:27 +0000)]
Merge remote-tracking branch 'remotes/bkoppelmann/tags/pull-tricore-20150316' into staging

TriCore RRR1, RRRR, RRRW, and SYS instructions

# gpg: Signature made Mon Mar 16 15:55:24 2015 GMT using RSA key ID 6B69CA14
# gpg: Good signature from "Bastian Koppelmann <kbastian@mail.uni-paderborn.de>"

* remotes/bkoppelmann/tags/pull-tricore-20150316:
  target-tricore: Add instructions of SYS opcode format
  target-tricore: Add instructions of RRRW opcode format
  target-tricore: Add instructions of RRRR opcode format
  target-tricore: Add instructions of RRR1 opcode format, which have 0xe3 as first opcode
  target-tricore: Add instructions of RRR1 opcode format, which have 0x63 as first opcode
  target-tricore: Add instructions of RRR1 opcode format, which have 0xa3 as first opcode

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoMerge remote-tracking branch 'remotes/rth/tags/tcg-pull-20150316' into staging
Peter Maydell [Mon, 16 Mar 2015 17:22:32 +0000 (17:22 +0000)]
Merge remote-tracking branch 'remotes/rth/tags/tcg-pull-20150316' into staging

tcg opt fix for or x,a,a

# gpg: Signature made Mon Mar 16 15:47:19 2015 GMT using RSA key ID 4DD0279B
# gpg: Good signature from "Richard Henderson <rth7680@gmail.com>"
# gpg:                 aka "Richard Henderson <rth@redhat.com>"
# gpg:                 aka "Richard Henderson <rth@twiddle.net>"

* remotes/rth/tags/tcg-pull-20150316:
  tcg/optimize: Handle or r,a,a with constant a

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>