sdk/emulator/qemu.git
8 years agoMerge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Peter Maydell [Wed, 8 Jun 2016 16:17:16 +0000 (17:17 +0100)]
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches

# gpg: Signature made Wed 08 Jun 2016 09:31:38 BST
# gpg:                using RSA key 0x7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"

* remotes/kevin/tags/for-upstream: (31 commits)
  qemu-img bench: Add --flush-interval
  qemu-img bench: Implement -S (step size)
  qemu-img bench: Make start offset configurable
  qemu-img bench: Sequential writes
  qemu-img bench
  block: Don't emulate natively supported pwritev flags
  blockdev: clean up error handling in do_open_tray
  block: Fix bdrv_all_delete_snapshot() error handling
  qcow2: avoid extra flushes in qcow2
  raw-posix: Fetch max sectors for host block device
  block: assert that bs->request_alignment is a power of 2
  migration/block: Convert saving to BlockBackend
  migration/block: Convert load to BlockBackend
  block: Kill bdrv_co_write_zeroes()
  vmdk: Convert to bdrv_co_pwrite_zeroes()
  raw_bsd: Convert to bdrv_co_pwrite_zeroes()
  raw-posix: Convert to bdrv_co_pwrite_zeroes()
  qed: Convert to bdrv_co_pwrite_zeroes()
  gluster: Convert to bdrv_co_pwrite_zeroes()
  blkreplay: Convert to bdrv_co_pwrite_zeroes()
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8 years agoMerge remote-tracking branch 'remotes/famz/tags/pull-docker-20160608' into staging
Peter Maydell [Wed, 8 Jun 2016 15:31:53 +0000 (16:31 +0100)]
Merge remote-tracking branch 'remotes/famz/tags/pull-docker-20160608' into staging

Docker testing fixes by Paolo.

# gpg: Signature made Wed 08 Jun 2016 08:20:54 BST
# gpg:                using RSA key 0xCA35624C6A9171C6
# gpg: Good signature from "Fam Zheng <famz@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: 5003 7CB7 9706 0F76 F021  AD56 CA35 624C 6A91 71C6

* remotes/famz/tags/pull-docker-20160608:
  tests/docker: build all targets in test-clang
  tests/docker: support travis test with fedora image
  tests/docker: remove unused feature "ccache"
  tests/docker: fix test-mingw
  tests/docker: make test-full build all targets, not none
  tests/docker: fix make-archive-maybe

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8 years agoMerge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2016-07-07-tag' into staging
Peter Maydell [Wed, 8 Jun 2016 15:04:52 +0000 (16:04 +0100)]
Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2016-07-07-tag' into staging

qemu-ga patch queue

* add unit tests for guest-exec command set

# gpg: Signature made Tue 07 Jun 2016 21:43:33 BST
# gpg:                using RSA key 0x3353C9CEF108B584
# gpg: Good signature from "Michael Roth <flukshun@gmail.com>"
# gpg:                 aka "Michael Roth <mdroth@utexas.edu>"
# gpg:                 aka "Michael Roth <mdroth@linux.vnet.ibm.com>"

* remotes/mdroth/tags/qga-pull-2016-07-07-tag:
  tests: start a /qga/guest-exec test

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8 years agoMerge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
Peter Maydell [Wed, 8 Jun 2016 13:45:28 +0000 (14:45 +0100)]
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

* max-ram-below-4g improvement (Gerd)
* escc fix (xiaoqiang)
* ESP fix (Prasad)
* scsi-disk tweaks/fix (me)
* Makefile dependency fixes (me)
* PKGVERSION improvement (Fam)
* -vnc man improvement (Robert)

# gpg: Signature made Tue 07 Jun 2016 18:06:22 BST
# gpg:                using RSA key 0xBFFBD25F78C7AE83
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"

* remotes/bonzini/tags/for-upstream:
  vnc: list the 'to' parameter of '-vnc' in the qemu man page
  scsi-disk: add missing break
  Makefile: Derive "PKGVERSION" from "git describe" by default
  Makefile: add dependency on scripts/hxtool
  Makefile: add dependency on scripts/make_device_config.sh
  Makefile: add dependency on scripts/create_config
  Makefile: Add a "FORCE" target
  scsi: megasas: null terminate bios version buffer
  scsi: mark TYPE_SCSI_DISK_BASE as abstract
  scsi: esp: check TI buffer index before read/write
  hw/char: QOM'ify escc.c (fix)
  pc: allow raising low memory via max-ram-below-4g option
  tests: Rename tests/Makefile to tests/Makefile.include

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8 years agoqemu-img bench: Add --flush-interval
Kevin Wolf [Fri, 3 Jun 2016 11:59:41 +0000 (13:59 +0200)]
qemu-img bench: Add --flush-interval

This options allows to flush the image periodically during write tests.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoqemu-img bench: Implement -S (step size)
Kevin Wolf [Mon, 13 Jul 2015 11:13:17 +0000 (13:13 +0200)]
qemu-img bench: Implement -S (step size)

With this new option, qemu-img bench can be told to advance the current
offset after each request by a different value than the buffer size.
This is useful for controlling the conditions for cluster allocation in
image formats (e.g. qcow2 cluster allocation with COW in front of the
request, or COW areas that aren't overwritten immediately).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoqemu-img bench: Make start offset configurable
Kevin Wolf [Fri, 10 Jul 2015 16:09:18 +0000 (18:09 +0200)]
qemu-img bench: Make start offset configurable

This patch adds an option the specify the offset of the first request
made by qemu-img bench. This allows to benchmark misaligned requests.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoqemu-img bench: Sequential writes
Kevin Wolf [Fri, 10 Jul 2015 16:09:18 +0000 (18:09 +0200)]
qemu-img bench: Sequential writes

This extends qemu-img bench with an option that makes it use sequential
writes instead of reads for the test run.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoqemu-img bench
Kevin Wolf [Tue, 5 Aug 2014 12:17:13 +0000 (14:17 +0200)]
qemu-img bench

This adds a qemu-img command that allows doing some simple benchmarks
for the block layer without involving guest devices and a real VM.

For the start, this implements only a test of sequential reads.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoblock: Don't emulate natively supported pwritev flags
Kevin Wolf [Tue, 7 Jun 2016 13:51:28 +0000 (15:51 +0200)]
block: Don't emulate natively supported pwritev flags

Drivers that implement .bdrv_co_pwritev() get the flags passed as an
argument to said function, but we also unconditionally emulate the flags
anyway. We shouldn't do that.

Fix this by clearing all flags that the driver supports natively after
it returns from .bdrv_co_pwritev().

Fixes: 4df863f3 ('block: Make supported_write_flags a per-bds property')
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
8 years agoblockdev: clean up error handling in do_open_tray
Colin Lord [Mon, 6 Jun 2016 18:15:22 +0000 (14:15 -0400)]
blockdev: clean up error handling in do_open_tray

Returns negative error codes and accompanying error messages in cases where
the device has no tray or the tray is locked and isn't forced open. This
extra information should result in better flexibility in functions that
call do_open_tray.

Suggested by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Colin Lord <clord@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoblock: Fix bdrv_all_delete_snapshot() error handling
Kevin Wolf [Mon, 6 Jun 2016 10:53:22 +0000 (12:53 +0200)]
block: Fix bdrv_all_delete_snapshot() error handling

The code to exit the loop after bdrv_snapshot_delete_by_id_or_name()
returned failure was duplicated. The first copy of it was too early so
that the AioContext lock would not be freed. This patch removes it so
that only the second, correct copy remains.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoqcow2: avoid extra flushes in qcow2
Denis V. Lunev [Thu, 2 Jun 2016 15:58:15 +0000 (18:58 +0300)]
qcow2: avoid extra flushes in qcow2

The problem with excessive flushing was found by a couple of performance
tests:
  - parallel directory tree creation (from 2 processes)
  - 32 cached writes + fsync at the end in a loop

For the first one results improved from 2.6 loops/sec to 3.5 loops/sec.
Each loop creates 10^3 directories with 10 files in each.

For the second one results improved from ~600 fsync/sec to ~1100
fsync/sec. Though, it was run on SSD so it probably won't show such
performance gain on rotational media.

qcow2_cache_flush() calls bdrv_flush() unconditionally after writing
cache entries of a particular cache. This can lead to as many as
2 additional fdatasyncs inside bdrv_flush.

We can simply skip all fdatasync calls inside qcow2_co_flush_to_os
as bdrv_flush for sure will do the job. These flushes are necessary to
keep the right order of writes to the different caches. Though this is
not necessary in the current code base as this ordering is ensured through
the flush in qcow2_cache_flush_dependency().

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Pavel Borzenkov <pborzenkov@virtuozzo.com>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoraw-posix: Fetch max sectors for host block device
Fam Zheng [Fri, 3 Jun 2016 02:07:02 +0000 (10:07 +0800)]
raw-posix: Fetch max sectors for host block device

This is sometimes a useful value we should count in.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoblock: assert that bs->request_alignment is a power of 2
Peter Lieven [Mon, 30 May 2016 11:59:59 +0000 (13:59 +0200)]
block: assert that bs->request_alignment is a power of 2

at least bdrv_co_preadv/pwritev expect this.

Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agomigration/block: Convert saving to BlockBackend
Kevin Wolf [Fri, 27 May 2016 17:50:37 +0000 (19:50 +0200)]
migration/block: Convert saving to BlockBackend

This creates a new BlockBackend for copying data from an images to the
migration stream on the source host. All I/O for block migration goes
through BlockBackend now.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agomigration/block: Convert load to BlockBackend
Kevin Wolf [Wed, 25 May 2016 15:20:06 +0000 (17:20 +0200)]
migration/block: Convert load to BlockBackend

This converts the loading part of block migration to use BlockBackend
interfaces rather than accessing the BlockDriverState directly.

Note that this takes a lazy shortcut. We should really use a separate
BlockBackend that is configured for the migration rather than for the
guest (e.g. writethrough caching is unnecessary) and holds its own
reference to the BlockDriverState, but the impact isn't that big and we
didn't have a separate migration reference before either, so it must be
good enough, I guess...

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoblock: Kill bdrv_co_write_zeroes()
Eric Blake [Wed, 1 Jun 2016 21:10:13 +0000 (15:10 -0600)]
block: Kill bdrv_co_write_zeroes()

Now that all drivers have been converted to a byte interface,
we no longer need a sector interface.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agovmdk: Convert to bdrv_co_pwrite_zeroes()
Eric Blake [Wed, 1 Jun 2016 21:10:12 +0000 (15:10 -0600)]
vmdk: Convert to bdrv_co_pwrite_zeroes()

Another step on our continuing quest to switch to byte-based
interfaces.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoraw_bsd: Convert to bdrv_co_pwrite_zeroes()
Eric Blake [Wed, 1 Jun 2016 21:10:11 +0000 (15:10 -0600)]
raw_bsd: Convert to bdrv_co_pwrite_zeroes()

Another step on our continuing quest to switch to byte-based
interfaces.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoraw-posix: Convert to bdrv_co_pwrite_zeroes()
Eric Blake [Wed, 1 Jun 2016 21:10:10 +0000 (15:10 -0600)]
raw-posix: Convert to bdrv_co_pwrite_zeroes()

Another step on our continuing quest to switch to byte-based
interfaces.

Signed-off-by: Eric Blake <eblake@redhat.com>
[ kwolf: Fixed up trace_paio_submit_co() call for qiov == NULL ]
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoqed: Convert to bdrv_co_pwrite_zeroes()
Eric Blake [Wed, 1 Jun 2016 21:10:09 +0000 (15:10 -0600)]
qed: Convert to bdrv_co_pwrite_zeroes()

Another step on our continuing quest to switch to byte-based
interfaces.

Kill an abuse of the comma operator while at it (fortunately,
the semantics were still right).  Also, the test for requests
not aligned to clusters should be applied always, not just
when a backing file is present.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agogluster: Convert to bdrv_co_pwrite_zeroes()
Eric Blake [Wed, 1 Jun 2016 21:10:08 +0000 (15:10 -0600)]
gluster: Convert to bdrv_co_pwrite_zeroes()

Another step on our continuing quest to switch to byte-based
interfaces.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoblkreplay: Convert to bdrv_co_pwrite_zeroes()
Eric Blake [Wed, 1 Jun 2016 21:10:07 +0000 (15:10 -0600)]
blkreplay: Convert to bdrv_co_pwrite_zeroes()

Another step on our continuing quest to switch to byte-based
interfaces.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoqcow2: Convert to bdrv_co_pwrite_zeroes()
Eric Blake [Wed, 1 Jun 2016 21:10:06 +0000 (15:10 -0600)]
qcow2: Convert to bdrv_co_pwrite_zeroes()

Another step on our continuing quest to switch to byte-based
interfaces.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoiscsi: Convert to bdrv_co_pwrite_zeroes()
Eric Blake [Wed, 1 Jun 2016 21:10:05 +0000 (15:10 -0600)]
iscsi: Convert to bdrv_co_pwrite_zeroes()

Another step on our continuing quest to switch to byte-based
interfaces.

As this is the first byte-based iscsi interface, convert
is_request_lun_aligned() into two versions, one for sectors
and one for bytes.  Also, change from outright -EINVAL failure
on an unaligned request, to instead failing with -ENOTSUP to
trigger a read-modify-write fallback, particularly since the
block layer should be honoring bs->request_alignment to avoid
-EINVAL on read/write requests.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoblock: Switch bdrv_write_zeroes() to byte interface
Eric Blake [Wed, 1 Jun 2016 21:10:04 +0000 (15:10 -0600)]
block: Switch bdrv_write_zeroes() to byte interface

Rename to bdrv_pwrite_zeroes() to let the compiler ensure we
cater to the updated semantics.  Do the same for bdrv_co_write_zeroes().

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoblock: Add .bdrv_co_pwrite_zeroes()
Eric Blake [Wed, 1 Jun 2016 21:10:03 +0000 (15:10 -0600)]
block: Add .bdrv_co_pwrite_zeroes()

Update bdrv_co_do_write_zeroes() to be byte-based, and select
between the new byte-based bdrv_co_pwrite_zeroes() or the old
bdrv_co_write_zeroes().  The next patches will convert drivers,
then remove the old interface.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoblock: Track write zero limits in bytes
Eric Blake [Wed, 1 Jun 2016 21:10:02 +0000 (15:10 -0600)]
block: Track write zero limits in bytes

Another step towards removing sector-based interfaces: convert
the maximum write and minimum alignment values from sectors to
bytes.  Rename the variables to let the compiler check that all
users are converted to the new semantics.

The maximum remains an int as long as BDRV_REQUEST_MAX_SECTORS
is constrained by INT_MAX (this means that we can't even
support a 2G write_zeroes, but just under it) - changing
operation lengths to unsigned or to 64-bits is a much bigger
audit, and debatable if we even want to do it (since at the
core, a 32-bit platform will still have ssize_t as its
underlying limit on write()).

Meanwhile, alignment is changed to 'uint32_t', since it makes no
sense to have an alignment larger than the maximum write, and
less painful to use an unsigned type with well-defined behavior
in bit operations than to have to worry about what happens if
a driver mistakenly supplies a negative alignment.

Add an assert that no one was trying to use sectors to get a
write zeroes larger than 2G, and therefore that a later conversion
to bytes won't be impacted by keeping the limit at 32 bits.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoiscsi: Use block size as minimum zero/discard alignment
Eric Blake [Wed, 1 Jun 2016 21:10:01 +0000 (15:10 -0600)]
iscsi: Use block size as minimum zero/discard alignment

If hardware does not advertise a minimum zero/discard
alignment, we still want to guarantee that the block layer
will align requests to our blocks, rather than the arbitrary
512-byte BDRV sector size.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoqcow2: Catch more unaligned write_zero into zero cluster
Eric Blake [Thu, 26 May 2016 03:48:49 +0000 (21:48 -0600)]
qcow2: Catch more unaligned write_zero into zero cluster

is_zero_cluster() and is_zero_cluster_top_locked() are used only
by qcow2_co_write_zeroes().  The former is too broad (we don't
care if the sectors we are about to overwrite are non-zero, only
that all other sectors in the cluster are zero), so it needs to
be called up to twice but with smaller limits - rename it along
with adding the neeeded parameter.  The latter can be inlined for
more compact code.

The testsuite change shows that we now have a sparser top file
when an unaligned write_zeroes overwrites the only portion of
the backing file with data.

Based on a patch proposal by Denis V. Lunev.

CC: Denis V. Lunev <den@openvz.org>
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoqemu-iotests: Test one more spot for optimizing write_zeroes
Eric Blake [Thu, 26 May 2016 03:48:48 +0000 (21:48 -0600)]
qemu-iotests: Test one more spot for optimizing write_zeroes

Add another test to 154, showing that we currently allocate a
data cluster in the top layer if any sector of the backing file
was allocated.  The next patch will optimize this case.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoqcow2: add tracepoints for qcow2_co_write_zeroes
Denis V. Lunev [Thu, 26 May 2016 03:48:47 +0000 (21:48 -0600)]
qcow2: add tracepoints for qcow2_co_write_zeroes

This patch follows guidelines of all other tracepoints in qcow2, like ones
in qcow2_co_writev. I think that they should dump values in the same
quantities or be changed all together.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Eric Blake <eblake@redhat.com>
CC: Kevin Wolf <kwolf@redhat.com>
Message-Id: <1463476543-3087-4-git-send-email-den@openvz.org>
[eblake: typo fix in commit message]
Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoqcow2: simplify logic in qcow2_co_write_zeroes
Denis V. Lunev [Thu, 26 May 2016 03:48:46 +0000 (21:48 -0600)]
qcow2: simplify logic in qcow2_co_write_zeroes

Unaligned requests will occupy only one cluster. This is true since the
previous commit. Simplify the code taking this consideration into
account.

In other words, the caller is now buggy if it ever passes us an unaligned
request that crosses cluster boundaries (the only requests that can cross
boundaries will be aligned).

There are no other changes so far.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
CC: Eric Blake <eblake@redhat.com>
CC: Kevin Wolf <kwolf@redhat.com>
Message-Id: <1463476543-3087-3-git-send-email-den@openvz.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoblock: split write_zeroes always
Denis V. Lunev [Thu, 26 May 2016 03:48:45 +0000 (21:48 -0600)]
block: split write_zeroes always

We should split requests even if they are less than write_zeroes_alignment.
For example we can have the following request:
  offset 62k
  size   4k
  write_zeroes_alignment 64k
The original code sent 1 request covering 2 qcow2 clusters, and resulted
in both clusters being allocated. But by splitting the request, we can
cater to the case where one of the two clusters can be zeroed as a
whole, for only 1 cluster allocated after the operation.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Eric Blake <eblake@redhat.com>
CC: Kevin Wolf <kwolf@redhat.com>
Message-Id: <1463476543-3087-2-git-send-email-den@openvz.org>

[eblake: Avoid exceeding nb_sectors, hoist alignment checks out of
loop, and update testsuite to show that patch works]

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agotests/docker: build all targets in test-clang
Paolo Bonzini [Mon, 6 Jun 2016 14:46:57 +0000 (16:46 +0200)]
tests/docker: build all targets in test-clang

Warnings specific to clang may affect devices that are not build by
x86_64-softmmu and aarch64-softmmu.  Build all targets since that
is also what Peter does.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1465224417-141321-7-git-send-email-pbonzini@redhat.com
Signed-off-by: Fam Zheng <famz@redhat.com>
8 years agotests/docker: support travis test with fedora image
Paolo Bonzini [Mon, 6 Jun 2016 14:46:56 +0000 (16:46 +0200)]
tests/docker: support travis test with fedora image

Install sparse and PyYAML.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1465224417-141321-6-git-send-email-pbonzini@redhat.com
Signed-off-by: Fam Zheng <famz@redhat.com>
8 years agotests/docker: remove unused feature "ccache"
Paolo Bonzini [Mon, 6 Jun 2016 14:46:55 +0000 (16:46 +0200)]
tests/docker: remove unused feature "ccache"

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1465224417-141321-5-git-send-email-pbonzini@redhat.com
Signed-off-by: Fam Zheng <famz@redhat.com>
8 years agotests/docker: fix test-mingw
Paolo Bonzini [Mon, 6 Jun 2016 14:46:54 +0000 (16:46 +0200)]
tests/docker: fix test-mingw

Add flex and bison for use in test-mingw, because test-mingw
uses the in-tree libdtc.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1465224417-141321-4-git-send-email-pbonzini@redhat.com
Signed-off-by: Fam Zheng <famz@redhat.com>
8 years agotests/docker: make test-full build all targets, not none
Paolo Bonzini [Mon, 6 Jun 2016 14:46:53 +0000 (16:46 +0200)]
tests/docker: make test-full build all targets, not none

Fix common.rc to avoid passing an empty --target-list= option to configure.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1465224417-141321-3-git-send-email-pbonzini@redhat.com
Signed-off-by: Fam Zheng <famz@redhat.com>
8 years agotests/docker: fix make-archive-maybe
Paolo Bonzini [Mon, 6 Jun 2016 14:46:52 +0000 (16:46 +0200)]
tests/docker: fix make-archive-maybe

make-archive-maybe expects an archive path relative
to $1, but receives a path relative to the current directory.  Redirect
the output outside the subshell to bypass the "cd $1".

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1465224417-141321-2-git-send-email-pbonzini@redhat.com
Signed-off-by: Fam Zheng <famz@redhat.com>
8 years agotests: start a /qga/guest-exec test
Marc-André Lureau [Fri, 3 Jun 2016 12:27:50 +0000 (14:27 +0200)]
tests: start a /qga/guest-exec test

Test a few guest-exec guest agent commands, added in qemu 2.5.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
8 years agoMerge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2016-06-07' into...
Peter Maydell [Tue, 7 Jun 2016 15:34:45 +0000 (16:34 +0100)]
Merge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2016-06-07' into staging

trivial patches for 2016-06-07

# gpg: Signature made Tue 07 Jun 2016 16:20:52 BST
# gpg:                using RSA key 0xBEE59D74A4C3D7DB
# 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-2016-06-07: (51 commits)
  hbitmap: Use DIV_ROUND_UP
  qemu-timer: Use DIV_ROUND_UP
  linux-user: Use DIV_ROUND_UP
  slirp: Use DIV_ROUND_UP
  usb: Use DIV_ROUND_UP
  rocker: Use DIV_ROUND_UP
  SPICE: Use DIV_ROUND_UP
  audio: Use DIV_ROUND_UP
  xen: Use DIV_ROUND_UP
  crypto: Use DIV_ROUND_UP
  block: Use DIV_ROUND_UP
  qed: Use DIV_ROUND_UP
  qcow/qcow2: Use DIV_ROUND_UP
  parallels: Use DIV_ROUND_UP
  coccinelle: use macro DIV_ROUND_UP instead of (((n) + (d) - 1) /(d))
  thunk: Rename args and fields in host-target bitmask conversion code
  thunk: Drop unused NO_THUNK_TYPE_SIZE guards
  qemu-common.h: Drop WORDS_ALIGNED define
  host-utils: Prefer 'false' for bool type
  docs/multi-thread-compression: Fix wrong command string
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8 years agohbitmap: Use DIV_ROUND_UP
Laurent Vivier [Tue, 31 May 2016 16:36:05 +0000 (18:36 +0200)]
hbitmap: Use DIV_ROUND_UP

Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).

This patch is the result of coccinelle script
scripts/coccinelle/round.cocci

CC: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoqemu-timer: Use DIV_ROUND_UP
Laurent Vivier [Tue, 31 May 2016 16:36:04 +0000 (18:36 +0200)]
qemu-timer: Use DIV_ROUND_UP

Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).

This patch is the result of coccinelle script
scripts/coccinelle/round.cocci

CC: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agolinux-user: Use DIV_ROUND_UP
Laurent Vivier [Tue, 31 May 2016 16:36:02 +0000 (18:36 +0200)]
linux-user: Use DIV_ROUND_UP

Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).

This patch is the result of coccinelle script
scripts/coccinelle/round.cocci

CC: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoslirp: Use DIV_ROUND_UP
Laurent Vivier [Tue, 31 May 2016 16:36:01 +0000 (18:36 +0200)]
slirp: Use DIV_ROUND_UP

Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).

This patch is the result of coccinelle script
scripts/coccinelle/round.cocci

CC: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agousb: Use DIV_ROUND_UP
Laurent Vivier [Tue, 31 May 2016 16:36:00 +0000 (18:36 +0200)]
usb: Use DIV_ROUND_UP

Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).

This patch is the result of coccinelle script
scripts/coccinelle/round.cocci

CC: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agorocker: Use DIV_ROUND_UP
Laurent Vivier [Tue, 31 May 2016 16:35:59 +0000 (18:35 +0200)]
rocker: Use DIV_ROUND_UP

Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).

This patch is the result of coccinelle script
scripts/coccinelle/round.cocci

CC: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoSPICE: Use DIV_ROUND_UP
Laurent Vivier [Tue, 31 May 2016 16:35:58 +0000 (18:35 +0200)]
SPICE: Use DIV_ROUND_UP

Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).

This patch is the result of coccinelle script
scripts/coccinelle/round.cocci

CC: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoaudio: Use DIV_ROUND_UP
Laurent Vivier [Tue, 31 May 2016 16:35:57 +0000 (18:35 +0200)]
audio: Use DIV_ROUND_UP

Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).

This patch is the result of coccinelle script
scripts/coccinelle/round.cocci

CC: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoxen: Use DIV_ROUND_UP
Laurent Vivier [Tue, 31 May 2016 16:35:56 +0000 (18:35 +0200)]
xen: Use DIV_ROUND_UP

Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).

This patch is the result of coccinelle script
scripts/coccinelle/round.cocci

CC: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agocrypto: Use DIV_ROUND_UP
Laurent Vivier [Tue, 31 May 2016 16:35:55 +0000 (18:35 +0200)]
crypto: Use DIV_ROUND_UP

Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).

This patch is the result of coccinelle script
scripts/coccinelle/round.cocci

CC: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoblock: Use DIV_ROUND_UP
Laurent Vivier [Tue, 31 May 2016 16:35:54 +0000 (18:35 +0200)]
block: Use DIV_ROUND_UP

Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).

This patch is the result of coccinelle script
scripts/coccinelle/round.cocci

CC: qemu-block@nongnu.org
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoqed: Use DIV_ROUND_UP
Laurent Vivier [Tue, 31 May 2016 16:35:53 +0000 (18:35 +0200)]
qed: Use DIV_ROUND_UP

Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).

This patch is the result of coccinelle script
scripts/coccinelle/round.cocci

CC: qemu-block@nongnu.org
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoqcow/qcow2: Use DIV_ROUND_UP
Laurent Vivier [Tue, 31 May 2016 16:35:52 +0000 (18:35 +0200)]
qcow/qcow2: Use DIV_ROUND_UP

Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).

This patch is the result of coccinelle script
scripts/coccinelle/round.cocci

CC: qemu-block@nongnu.org
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoparallels: Use DIV_ROUND_UP
Laurent Vivier [Tue, 31 May 2016 16:35:51 +0000 (18:35 +0200)]
parallels: Use DIV_ROUND_UP

Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d).

This patch is the result of coccinelle script
scripts/coccinelle/round.cocci

CC: qemu-block@nongnu.org
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agococcinelle: use macro DIV_ROUND_UP instead of (((n) + (d) - 1) /(d))
Laurent Vivier [Tue, 31 May 2016 16:35:50 +0000 (18:35 +0200)]
coccinelle: use macro DIV_ROUND_UP instead of (((n) + (d) - 1) /(d))

sample from http://coccinellery.org/

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agothunk: Rename args and fields in host-target bitmask conversion code
Peter Maydell [Thu, 2 Jun 2016 16:10:20 +0000 (17:10 +0100)]
thunk: Rename args and fields in host-target bitmask conversion code

The target_to_host_bitmask() and host_to_target_bitmask() functions
and the associated struct bitmask_transtbl are completely generic,
but for historical reasons the target related fields and parameters
are named 'x86' and the host related fields are named 'alpha'.
Rename them to 'target' and 'host'.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agothunk: Drop unused NO_THUNK_TYPE_SIZE guards
Peter Maydell [Thu, 2 Jun 2016 15:28:16 +0000 (16:28 +0100)]
thunk: Drop unused NO_THUNK_TYPE_SIZE guards

The thunk_type_size_array() and thunk_type_align_array() functions
are only provided if NO_THUNK_TYPE_SIZE is not defined. However
nothing in the codebase defines that, and so in fact these functions
are always present. Drop the unnecessary #ifdefs.

(Over a decade ago thunk.h used to be included by some softmmu
files, which defined NO_THUNK_TYPE_SIZE, but these includes are
long gone; see for instance commit f193c7979c2f7.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoqemu-common.h: Drop WORDS_ALIGNED define
Peter Maydell [Thu, 2 Jun 2016 14:05:55 +0000 (15:05 +0100)]
qemu-common.h: Drop WORDS_ALIGNED define

The WORDS_ALIGNED #define is not used anywhere, and hasn't been since
2013 when commit 612d590ebc6cef rewrote the various ld<type>_<endian>_p
functions to not use it. Remove the #define and the comment describing it.
Also remove the line in the comment about TARGET_WORDS_ALIGNED, since
it has never actually existed.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agohost-utils: Prefer 'false' for bool type
Eric Blake [Tue, 31 May 2016 18:33:31 +0000 (12:33 -0600)]
host-utils: Prefer 'false' for bool type

Mixing '0' and 'bool' looks stupid.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agodocs/multi-thread-compression: Fix wrong command string
Wei Jiangang [Mon, 23 May 2016 09:43:57 +0000 (17:43 +0800)]
docs/multi-thread-compression: Fix wrong command string

s/info_migrate_capabilities/info migrate_capabilities

Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Liang Li <liang.z.li@intel.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoall: Remove unnecessary glib.h includes
Peter Maydell [Tue, 24 May 2016 15:24:39 +0000 (16:24 +0100)]
all: Remove unnecessary glib.h includes

Remove glib.h includes, as it is provided by osdep.h.

This commit was created with scripts/clean-includes.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoqga: Remove unnecessary glib.h includes
Peter Maydell [Tue, 24 May 2016 15:24:38 +0000 (16:24 +0100)]
qga: Remove unnecessary glib.h includes

Remove glib.h includes, as it is provided by osdep.h.

This commit was created with scripts/clean-includes.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agotests: Remove unnecessary glib.h includes
Peter Maydell [Tue, 24 May 2016 15:24:37 +0000 (16:24 +0100)]
tests: Remove unnecessary glib.h includes

Remove glib.h includes, as it is provided by osdep.h.

This commit was created with scripts/clean-includes.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoclean-includes: Add glib.h to list of unneeded includes
Peter Maydell [Tue, 24 May 2016 15:24:36 +0000 (16:24 +0100)]
clean-includes: Add glib.h to list of unneeded includes

osdep.h pulls in glib.h via glib-compat.h, so add it to the list of
includes that we remove. (This then means we must avoid running
clean-includes on glib-compat.h or it will delete the glib.h include.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agopc: cleanup unused struct PcRomPciInfo
Igor Mammedov [Tue, 24 May 2016 12:09:07 +0000 (14:09 +0200)]
pc: cleanup unused struct PcRomPciInfo

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoe1000: Removing unnecessary if statement
Sameeh Jubran [Sun, 29 May 2016 06:37:25 +0000 (09:37 +0300)]
e1000: Removing unnecessary if statement

Since mit_delay can never be 0 this if statement is
superfluous.

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoFix configure test for PBKDF2 in nettle
Steven Luo [Fri, 27 May 2016 04:53:13 +0000 (21:53 -0700)]
Fix configure test for PBKDF2 in nettle

On my Debian jessie system, including nettle/pbkdf2.h does not cause
NULL to be defined, which causes the test to fail to compile.  Include
stddef.h to bring in a definition of NULL.

Cc: qemu-trivial@nongnu.org
Cc: qemu-stable@nongnu.org
Signed-off-by: Steven Luo <steven+qemu@steven676.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agodocs: Fix a couple of typos in throttle.txt
Alberto Garcia [Tue, 24 May 2016 11:59:13 +0000 (13:59 +0200)]
docs: Fix a couple of typos in throttle.txt

Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agohw: Clean up includes
Peter Maydell [Tue, 24 May 2016 15:28:04 +0000 (16:28 +0100)]
hw: Clean up includes

Clean up includes so that osdep.h is included first and headers
which it implies are not included manually.

This commit was created with scripts/clean-includes.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoreplay: Clean up includes
Peter Maydell [Tue, 24 May 2016 15:25:58 +0000 (16:25 +0100)]
replay: Clean up includes

Clean up includes so that osdep.h is included first and headers
which it implies are not included manually.

This commit was created with scripts/clean-includes.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agofw_cfg: follow CODING_STYLE
Cao jin [Wed, 18 May 2016 10:59:36 +0000 (18:59 +0800)]
fw_cfg: follow CODING_STYLE

Replace tab with 4 spaces; brace the indented statement.

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Acked-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoqdev: Clean up around properties
Cao jin [Sun, 17 Apr 2016 07:45:54 +0000 (15:45 +0800)]
qdev: Clean up around properties

include:
1. remove unnecessary declaration of static function
2. fix inconsistency between comment and function name, and typo OOM->QOM
2. update comments of functions, use uniform format(GTK-Doc style)

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agomonitor: Typo fix
Eric Blake [Tue, 17 May 2016 22:00:15 +0000 (16:00 -0600)]
monitor: Typo fix

s/partinal/partial/

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoICH9: fix typo
Cao jin [Tue, 17 May 2016 01:41:18 +0000 (09:41 +0800)]
ICH9: fix typo

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoscripts: Use $(..) instead of deprecated `..`
Stefan Weil [Mon, 16 May 2016 13:23:33 +0000 (15:23 +0200)]
scripts: Use $(..) instead of deprecated `..`

This fixes these warnings from shellcheck:

    ^-- SC2006: Use $(..) instead of deprecated `..`

Update also a comment using the same pattern.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoconfigure: Use $(..) instead of deprecated `..`
Stefan Weil [Mon, 16 May 2016 13:10:20 +0000 (15:10 +0200)]
configure: Use $(..) instead of deprecated `..`

This fixes these warnings from shellcheck:

    ^-- SC2006: Use $(..) instead of deprecated `..`

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoqemu-options.hx: Specify the units for -machine kvm_shadow_mem
Peter Maydell [Tue, 10 May 2016 15:49:29 +0000 (16:49 +0100)]
qemu-options.hx: Specify the units for -machine kvm_shadow_mem

The -machine kvm_shadow_mem option takes a size in bytes; say
so explicitly in its documentation.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reported-by: Tobi (github.com/tobimensch)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoFix linking relocatable objects on Sparc
James Clarke [Mon, 6 Jun 2016 11:02:50 +0000 (12:02 +0100)]
Fix linking relocatable objects on Sparc

On Sparc, gcc implicitly passes --relax to the linker, but -r is
incompatible with this. Therefore, if --no-relax is supported, it should
be passed to the linker.

Signed-off-by: James Clarke <jrtc27@jrtc27.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoppc: Remove a potential overflow in muldiv64()
Laurent Vivier [Mon, 9 May 2016 13:24:59 +0000 (15:24 +0200)]
ppc: Remove a potential overflow in muldiv64()

The coccinelle script:
scripts/coccinelle/overflow_muldiv64.cocci
gives us a list of potential overflows in muldiv64()
(the two first parameters are 64bit values).

This patch fixes one, as the fix seems obvious:

replace muldiv64(a, b, c) by muldiv64(b, a, c)
as "a" and "b" are 64bit values but a <= NANOSECONDS_PER_SECOND.
(10^9 -> 30bit value).

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoreplace muldiv64(a, b, c) by (uint64_t)a * b / c
Laurent Vivier [Mon, 9 May 2016 13:24:58 +0000 (15:24 +0200)]
replace muldiv64(a, b, c) by (uint64_t)a * b / c

When "a" and "b" are 32bit values, we don't have to cast
them to 128bit, 64bit is enough.

This patch is the result of coccinelle script
scripts/coccinelle/simplify_muldiv64.cocci

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
For xtensa PIC:
Acked-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoremove useless muldiv64()
Laurent Vivier [Mon, 9 May 2016 13:24:57 +0000 (15:24 +0200)]
remove useless muldiv64()

muldiv64(a, 1, b) is like "a / b".

This patch is the result of coccinelle script
scripts/coccinelle/remove_muldiv64.cocci.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoThe only 64bit parameter of muldiv64() is the first one.
Laurent Vivier [Mon, 9 May 2016 13:24:56 +0000 (15:24 +0200)]
The only 64bit parameter of muldiv64() is the first one.

muldiv64() is "uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)"

Some time it is used as muldiv64(uint32_t a, uint64_t b, uint32_t c)"

This patch is the result of coccinelle script
scripts/coccinelle/swap_muldiv64.cocci to reorder arguments.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoscripts: add muldiv64() checking coccinelle scripts
Laurent Vivier [Mon, 9 May 2016 13:24:55 +0000 (15:24 +0200)]
scripts: add muldiv64() checking coccinelle scripts

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agogdbstub: set listen backlog to 1
Peter Wu [Wed, 4 May 2016 09:32:17 +0000 (11:32 +0200)]
gdbstub: set listen backlog to 1

Avoid possible connection drops on Linux (when tcp_syncookies is
disabled) or fallbacks to SYN cookies with the following kernel warning:

    TCP: request_sock_TCP: Possible SYN flooding on port 1234. Sending cookies.  Check SNMP counters.

Since Linux 4.4 (ef547f2ac16b "tcp: remove max_qlen_log"), a backlog of
zero is really treated as the "queue length for completely established
sockets waiting to be accepted" (listen(2)). This is apparently a valid
interpretation of an "implementation-defined minimum value" for a
backlog value of 0 (listen(3p)). Previous kernels would use 8 as
minimum value, but that is no longer the case.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agopo/Makefile: call rm -f directly
Jan Vesely [Sun, 20 Mar 2016 01:58:54 +0000 (21:58 -0400)]
po/Makefile: call rm -f directly

Default variables are undefined in rules.mak and this is what the rest
of the build system uses.
Fixes make clean in ./po/

Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agotarget-moxie: Remove unused struct elements
Stefan Weil [Thu, 24 Mar 2016 16:49:22 +0000 (17:49 +0100)]
target-moxie: Remove unused struct elements

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agofsdev: spelling fix
Michael Tokarev [Wed, 18 May 2016 13:12:21 +0000 (16:12 +0300)]
fsdev: spelling fix

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoqga: spelling fix
Michael Tokarev [Wed, 18 May 2016 13:11:55 +0000 (16:11 +0300)]
qga: spelling fix

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agodocs: "specify" spell fix
Michael Tokarev [Wed, 18 May 2016 12:47:53 +0000 (15:47 +0300)]
docs: "specify" spell fix

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
8 years agohw/ipmi: fix spelling
Michael Tokarev [Wed, 18 May 2016 12:45:14 +0000 (15:45 +0300)]
hw/ipmi: fix spelling

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Acked-by: Corey Minyard <cminyard@mvista.com>
8 years agos390x/virtio-ccw: fix spelling
Michael Tokarev [Wed, 18 May 2016 12:41:59 +0000 (15:41 +0300)]
s390x/virtio-ccw: fix spelling

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
8 years agoMerge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Peter Maydell [Tue, 7 Jun 2016 14:59:28 +0000 (15:59 +0100)]
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging

# gpg: Signature made Tue 07 Jun 2016 15:26:09 BST
# gpg:                using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"

* remotes/stefanha/tags/block-pull-request:
  throttle: refuse iops-size without iops-total/read/write
  block: Drop bdrv_ioctl_bh_cb
  block: Move BlockRequest type to io.c
  block/io: optimize bdrv_co_pwritev for small requests
  iostatus: fix comments for block_job_iostatus_reset
  block/io: Remove unused bdrv_aio_write_zeroes()
  virtio: drop duplicate virtio_queue_get_id() function
  virtio-scsi: Remove op blocker for dataplane
  virtio-blk: Remove op blocker for dataplane
  blockdev-backup: Don't move target AioContext if it's attached
  blockdev-backup: Use bdrv_lookup_bs on target
  tests: avoid coroutine pool test crash

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8 years agoMerge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Peter Maydell [Tue, 7 Jun 2016 14:30:25 +0000 (15:30 +0100)]
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

pc, pci, virtio: new features, cleanups, fixes

This includes some infrastructure for ipmi smbios tables.
Beginning of acpi hotplug rework by Igor for supporting >255 CPUs.
Misc cleanups and fixes.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
# gpg: Signature made Tue 07 Jun 2016 13:55:22 BST
# gpg:                using RSA key 0x281F0DB8D28D5469
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"

* remotes/mst/tags/for_upstream: (25 commits)
  virtio: move bi-endian target support to a single location
  pc-dimm: introduce realize callback
  pc-dimm: get memory region from ->get_memory_region()
  acpi: make bios_linker_loader_add_checksum() API offset based
  acpi: make bios_linker_loader_add_pointer() API offset based
  tpm: apci: cleanup TCPA table initialization
  acpi: cleanup bios_linker_loader_cleanup()
  acpi: simplify bios_linker API by removing redundant 'table' argument
  acpi: convert linker from GArray to BIOSLinker structure
  pc: use AcpiDeviceIfClass.send_event to issue GPE events
  acpi: extend ACPI interface to provide send_event hook
  pc: Postpone SMBIOS table installation to post machine init
  ipmi: rework the fwinfo to be fetched from the interface
  tests: acpi: update tables with consolidated legacy cpu-hotplug AML
  pc: acpi: cpuhp-legacy: switch ProcessorID to possible_cpus idx
  pc: acpi: simplify build_legacy_cpu_hotplug_aml() signature
  pc: acpi: consolidate legacy CPU hotplug in one file
  pc: acpi: mark current CPU hotplug functions as legacy
  pc: acpi: cpu-hotplug: make AML CPU_foo defines local to cpu_hotplug_acpi_table.c
  pc: acpi: consolidate \GPE._E02 with the rest of CPU hotplug AML
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8 years agodocker: Don't use eval trick on Makefile
Eduardo Habkost [Mon, 6 Jun 2016 15:53:54 +0000 (12:53 -0300)]
docker: Don't use eval trick on Makefile

The eval trick for defining DOCKER_SRC_COPY doesn't do anything
useful, as DOCKER_SRC_COPY is immediately expanded just after it
is defined, and CUR_TIME is already defined using ":=". Simply
define it using ":=" so it is evaluated only once.

The eval trick was also triggering an weird error on Travis builds:
  qemu/tests/docker/Makefile.include:34: *** unterminated variable reference.  Stop.

The issue is not easily reproducible (maybe it's a bug in some
versions of Make), but it is avoided if removing the eval trick.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8 years agothrottle: refuse iops-size without iops-total/read/write
Stefan Hajnoczi [Thu, 2 Jun 2016 00:40:31 +0000 (17:40 -0700)]
throttle: refuse iops-size without iops-total/read/write

In a similar vein to commit ee2bdc33c913b7d765baa5aa338c29fb30a05c9a
("throttle: refuse bps_max/iops_max without bps/iops") it is likely that
the user made a configuration error if iops-size has been set but no
iops limit has been set.

Print an error message so the user can check their throttling
configuration.  They should either remove iops-size if they don't want
any throttling or specify one of iops-total, iops-read, or iops-write.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-id: 1464828031-25601-1-git-send-email-stefanha@redhat.com

8 years agoblock: Drop bdrv_ioctl_bh_cb
Fam Zheng [Wed, 1 Jun 2016 01:52:23 +0000 (09:52 +0800)]
block: Drop bdrv_ioctl_bh_cb

Similar to the "!drv || !drv->bdrv_aio_ioctl" case above, here it is
okay to set co.ret and return. As pointed out by Paolo, a BH will be
created as necessary by the caller (bdrv_co_maybe_schedule_bh).
Besides, as pointed out by Kevin, "data" was leaked before.

Reported-by: Kevin Wolf <kwolf@redhat.com>
Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20160601015223.19277-1-famz@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoblock: Move BlockRequest type to io.c
Eric Blake [Thu, 19 May 2016 23:05:50 +0000 (17:05 -0600)]
block: Move BlockRequest type to io.c

I was thrown by the fact that the public type BlockRequest had
an anonymous union, but no obvious discriminator.  Turns out
that the only client of the second branch of the union was code
internal to io.c, now that commit 91c6e4b killed public
multiwrite, so move it into io.c and improve the comments.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1463699150-19445-1-git-send-email-eblake@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>