]> Git Repo - qemu.git/log
qemu.git
5 years agoiotests: Test snapshot -l field separation
Max Reitz [Fri, 17 Jan 2020 10:58:59 +0000 (11:58 +0100)]
iotests: Test snapshot -l field separation

Add a test that all fields in "qemu-img snapshot -l"s output are
separated by spaces.

Signed-off-by: Max Reitz <[email protected]>
Message-Id: <20200117105859[email protected]>
Reviewed-by: Eric Blake <[email protected]>
[mreitz: Renamed test from 284 to 286]
Signed-off-by: Max Reitz <[email protected]>
5 years agoblock: Fix VM size field width in snapshot dump
Max Reitz [Fri, 17 Jan 2020 10:58:58 +0000 (11:58 +0100)]
block: Fix VM size field width in snapshot dump

When printing the snapshot list (e.g. with qemu-img snapshot -l), the VM
size field is only seven characters wide.  As of de38b5005e9, this is
not necessarily sufficient: We generally print three digits, and this
may require a decimal point.  Also, the unit field grew from something
as plain as "M" to " MiB".  This means that number and unit may take up
eight characters in total; but we also want spaces in front.

Considering previously the maximum width was four characters and the
field width was chosen to be three characters wider, let us adjust the
field width to be eleven now.

Fixes: de38b5005e946aa3714963ea4c501e279e7d3666
Buglink: https://bugs.launchpad.net/qemu/+bug/1859989
Signed-off-by: Max Reitz <[email protected]>
Message-Id: <20200117105859[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
5 years agoiotests: Test convert -n -B to backing-less target
Max Reitz [Tue, 21 Jan 2020 15:59:15 +0000 (16:59 +0100)]
iotests: Test convert -n -B to backing-less target

This must not crash.

Signed-off-by: Max Reitz <[email protected]>
Message-Id: <20200121155915[email protected]>
Reviewed-by: John Snow <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
5 years agoqemu-img: Fix convert -n -B for backing-less targets
Max Reitz [Tue, 21 Jan 2020 15:59:14 +0000 (16:59 +0100)]
qemu-img: Fix convert -n -B for backing-less targets

s.target_has_backing does not reflect whether the target BDS has a
backing file; it only tells whether we should use a backing file during
conversion (specified by -B).

As such, if you use convert -n, the target does not necessarily actually
have a backing file, and then dereferencing out_bs->backing fails here.

When converting to an existing file, we should set
target_backing_sectors to a negative value, because first, as the
comment explains, this value is only used for optimization, so it is
always fine to do that.

Second, we use this value to determine where the target must be
initialized to zeroes (overlays are initialized to zero after the end of
their backing file).  When converting to an existing file, we cannot
assume that to be true.

Cc: [email protected]
Fixes: 351c8efff9ad809c822d55620df54d575d536f68
       ("qemu-img: Special post-backing convert handling")
Signed-off-by: Max Reitz <[email protected]>
Message-Id: <20200121155915[email protected]>
Reviewed-by: John Snow <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
5 years agoiotests: Add test for image creation fallback
Max Reitz [Wed, 22 Jan 2020 16:45:32 +0000 (17:45 +0100)]
iotests: Add test for image creation fallback

Signed-off-by: Max Reitz <[email protected]>
Message-Id: <20200122164532[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Maxim Levitsky <[email protected]>
[mreitz: Added a note that NBD does not support resizing, which is why
         the second case is expected to fail]
Signed-off-by: Max Reitz <[email protected]>
5 years agoiscsi: Drop iscsi_co_create_opts()
Max Reitz [Wed, 22 Jan 2020 16:45:31 +0000 (17:45 +0100)]
iscsi: Drop iscsi_co_create_opts()

The generic fallback implementation effectively does the same.

Reviewed-by: Maxim Levitsky <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
Message-Id: <20200122164532[email protected]>
Signed-off-by: Max Reitz <[email protected]>
5 years agofile-posix: Drop hdev_co_create_opts()
Max Reitz [Wed, 22 Jan 2020 16:45:30 +0000 (17:45 +0100)]
file-posix: Drop hdev_co_create_opts()

The generic fallback implementation effectively does the same.

Reviewed-by: Maxim Levitsky <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
Message-Id: <20200122164532[email protected]>
Signed-off-by: Max Reitz <[email protected]>
5 years agoblock: Generic file creation fallback
Max Reitz [Wed, 22 Jan 2020 16:45:29 +0000 (17:45 +0100)]
block: Generic file creation fallback

If a protocol driver does not support image creation, we can see whether
maybe the file exists already.  If so, just truncating it will be
sufficient.

Signed-off-by: Max Reitz <[email protected]>
Message-Id: <20200122164532[email protected]>
Signed-off-by: Max Reitz <[email protected]>
5 years agoblock/nbd: Fix hang in .bdrv_close()
Max Reitz [Wed, 22 Jan 2020 16:45:28 +0000 (17:45 +0100)]
block/nbd: Fix hang in .bdrv_close()

When nbd_close() is called from a coroutine, the connection_co never
gets to run, and thus nbd_teardown_connection() hangs.

This is because aio_co_enter() only puts the connection_co into the main
coroutine's wake-up queue, so this main coroutine needs to yield and
wait for connection_co to terminate.

Suggested-by: Kevin Wolf <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
Message-Id: <20200122164532[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Maxim Levitsky <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
5 years agoiotests/279: Fix for non-qcow2 formats
Max Reitz [Thu, 19 Dec 2019 14:42:43 +0000 (15:42 +0100)]
iotests/279: Fix for non-qcow2 formats

First, driver=qcow2 will not work so well with non-qcow2 formats (and
this test claims to support qcow, qed, and vmdk).

Second, vmdk will always report the backing file format to be vmdk.
Filter that out so the output looks like for all other formats.

Third, the flat vmdk subformats do not support backing files, so they
will not work with this test.

Signed-off-by: Max Reitz <[email protected]>
Message-Id: <20191219144243.1763246[email protected]>
Tested-by: Thomas Huth <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
5 years agoblock/backup-top: fix flags handling
Vladimir Sementsov-Ogievskiy [Fri, 7 Feb 2020 16:12:31 +0000 (19:12 +0300)]
block/backup-top: fix flags handling

backup-top "supports" write-unchanged, by skipping CBW operation in
backup_top_co_pwritev. But it forgets to do the same in
backup_top_co_pwrite_zeroes, as well as declare support for
BDRV_REQ_WRITE_UNCHANGED.

Fix this, and, while being here, declare also support for flags
supported by source child.

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20200207161231[email protected]>
Signed-off-by: Max Reitz <[email protected]>
5 years agoblock: always fill entire LUKS header space with zeros
Daniel P. Berrangé [Fri, 7 Feb 2020 13:55:20 +0000 (13:55 +0000)]
block: always fill entire LUKS header space with zeros

When initializing the LUKS header the size with default encryption
parameters will currently be 2068480 bytes. This is rounded up to
a multiple of the cluster size, 2081792, with 64k sectors. If the
end of the header is not the same as the end of the cluster we fill
the extra space with zeros. This was forgetting that not even the
space allocated for the header will be fully initialized, as we
only write key material for the first key slot. The space left
for the other 7 slots is never written to.

An optimization to the ref count checking code:

  commit a5fff8d4b4d928311a5005efa12d0991fe3b66f9 (refs/bisect/bad)
  Author: Vladimir Sementsov-Ogievskiy <[email protected]>
  Date:   Wed Feb 27 16:14:30 2019 +0300

    qcow2-refcount: avoid eating RAM

made the assumption that every cluster which was allocated would
have at least some data written to it. This was violated by way
the LUKS header is only partially written, with much space simply
reserved for future use.

Depending on the cluster size this problem was masked by the
logic which wrote zeros between the end of the LUKS header and
the end of the cluster.

$ qemu-img create --object secret,id=cluster_encrypt0,data=123456 \
   -f qcow2 -o cluster_size=2k,encrypt.iter-time=1,\
               encrypt.format=luks,encrypt.key-secret=cluster_encrypt0 \
               cluster_size_check.qcow2 100M
  Formatting 'cluster_size_check.qcow2', fmt=qcow2 size=104857600
    encrypt.format=luks encrypt.key-secret=cluster_encrypt0
    encrypt.iter-time=1 cluster_size=2048 lazy_refcounts=off refcount_bits=16

$ qemu-img check --object secret,id=cluster_encrypt0,data=redhat \
    'json:{"driver": "qcow2", "encrypt.format": "luks", \
           "encrypt.key-secret": "cluster_encrypt0", \
           "file.driver": "file", "file.filename": "cluster_size_check.qcow2"}'
ERROR: counting reference for region exceeding the end of the file by one cluster or more: offset 0x2000 size 0x1f9000
Leaked cluster 4 refcount=1 reference=0
...snip...
Leaked cluster 130 refcount=1 reference=0

1 errors were found on the image.
Data may be corrupted, or further writes to the image may corrupt it.

127 leaked clusters were found on the image.
This means waste of disk space, but no harm to data.
Image end offset: 268288

The problem only exists when the disk image is entirely empty. Writing
data to the disk image payload will solve the problem by causing the
end of the file to be extended further.

The change fixes it by ensuring that the entire allocated LUKS header
region is fully initialized with zeros. The qemu-img check will still
fail for any pre-existing disk images created prior to this change,
unless at least 1 byte of the payload is written to.

Fully writing zeros to the entire LUKS header is a good idea regardless
as it ensures that space has been allocated on the host filesystem (or
whatever block storage backend is used).

Signed-off-by: Daniel P. Berrangé <[email protected]>
Message-Id: <20200207135520.2669430[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
5 years agoqemu-img: Add --target-is-zero to convert
David Edmondson [Wed, 5 Feb 2020 11:02:48 +0000 (11:02 +0000)]
qemu-img: Add --target-is-zero to convert

In many cases the target of a convert operation is a newly provisioned
target that the user knows is blank (reads as zero). In this situation
there is no requirement for qemu-img to wastefully zero out the entire
device.

Add a new option, --target-is-zero, allowing the user to indicate that
an existing target device will return zeros for all reads.

Signed-off-by: David Edmondson <[email protected]>
Message-Id: <20200205110248.2009589[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
5 years agoqapi: Allow getting flat output from 'query-named-block-nodes'
Peter Krempa [Mon, 20 Jan 2020 08:50:49 +0000 (09:50 +0100)]
qapi: Allow getting flat output from 'query-named-block-nodes'

When a management application manages node names there's no reason to
recurse into backing images in the output of query-named-block-nodes.

Add a parameter to the command which will return just the top level
structs.

Signed-off-by: Peter Krempa <[email protected]>
Message-Id: <4470f8c779abc404dcf65e375db195cd91a80651.1579509782[email protected]>
Reviewed-by: Eric Blake <[email protected]>
[mreitz: Fixed coding style]
Signed-off-by: Max Reitz <[email protected]>
5 years agoiotests/147: Fix drive parameters
Max Reitz [Thu, 6 Feb 2020 13:08:12 +0000 (14:08 +0100)]
iotests/147: Fix drive parameters

8dff69b94 added an aio parameter to the drive parameter but forgot to
add a comma before, thus breaking the test.  Fix it again.

Fixes: 8dff69b9415b4287e900358744b732195e1ab2e2
Signed-off-by: Max Reitz <[email protected]>
Message-Id: <20200206130812[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Tested-by: Eric Blake <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
5 years agoiotests: Remove the superfluous 2nd check for the availability of quorum
Thomas Huth [Wed, 29 Jan 2020 14:17:51 +0000 (15:17 +0100)]
iotests: Remove the superfluous 2nd check for the availability of quorum

Commit d9df28e7b07 ("iotests: check whitelisted formats") added the
modern @iotests.skip_if_unsupported() to the functions in this test,
so we don't need the old explicit test here anymore.

Signed-off-by: Thomas Huth <[email protected]>
Message-Id: <20200129141751[email protected]>
Reviewed-by: Alberto Garcia <[email protected]>
Reviewed-by: Andrey Shinkevich <[email protected]>
Tested-by: Andrey Shinkevich <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
5 years agodocs: qcow2: introduce compression type feature
Vladimir Sementsov-Ogievskiy [Fri, 31 Jan 2020 14:22:19 +0000 (17:22 +0300)]
docs: qcow2: introduce compression type feature

The patch adds a new additional field to the qcow2 header: compression_type,
which specifies compression type. If field is absent or zero, default
compression type is set: ZLIB, which corresponds to current behavior.

New compression type (ZSTD) is to be added in further commit.

Suggested-by: Denis Plotnikov <[email protected]>
Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20200131142219[email protected]>
[mreitz: s/Bits 3-63:  Reserved/Bits 4-63:  Reserved/]
Signed-off-by: Max Reitz <[email protected]>
5 years agodocs: improve qcow2 spec about extending image header
Vladimir Sementsov-Ogievskiy [Fri, 31 Jan 2020 14:22:18 +0000 (17:22 +0300)]
docs: improve qcow2 spec about extending image header

Make it more obvious how to add new fields to the version 3 header and
how to interpret them.

The specification is adjusted so that for new defined optional fields:

1. Software may support some of these optional fields and ignore the
   others, which means that features may be backported to downstream
   Qemu independently.
2. If we want to add incompatible field (or a field, for which some of
   its values would be incompatible), it must be accompanied by
   incompatible feature bit.

Also the concept of "default is zero" is clarified, as it's strange to
say that the value of the field is assumed to be zero for the software
version which don't know about the field at all and don't know how to
treat it be it zero or not.

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-Id: <20200131142219[email protected]>
Reviewed-by: Alberto Garcia <[email protected]>
[mreitz: s/some its/some of its/]
Signed-off-by: Max Reitz <[email protected]>
5 years agoMerge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Peter Maydell [Tue, 18 Feb 2020 14:23:43 +0000 (14:23 +0000)]
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches:

- Fix check_to_replace_node()
- commit: Expose on-error option in QMP
- qcow2: Fix qcow2_alloc_cluster_abort() for external data file
- mirror: Fix deadlock
- vvfat: Fix segfault while closing read-write node
- Code cleanups

# gpg: Signature made Tue 18 Feb 2020 14:04:43 GMT
# gpg:                using RSA key 7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <[email protected]>" [full]
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream: (36 commits)
  iotests: Check that @replaces can replace filters
  iotests: Add tests for invalid Quorum @replaces
  iotests: Use self.image_len in TestRepairQuorum
  iotests: Resolve TODOs in 041
  iotests/041: Drop superfluous shutdowns
  iotests: Add VM.assert_block_path()
  iotests: Use complete_and_wait() in 155
  quorum: Stop marking it as a filter
  mirror: Double-check immediately before replacing
  block: Remove bdrv_recurse_is_first_non_filter()
  block: Use bdrv_recurse_can_replace()
  quorum: Implement .bdrv_recurse_can_replace()
  blkverify: Implement .bdrv_recurse_can_replace()
  block: Add bdrv_recurse_can_replace()
  quorum: Fix child permissions
  iotests: Let 041 use -blockdev for quorum children
  block: Drop bdrv_is_first_non_filter()
  blockdev: Allow resizing everywhere
  blockdev: Allow external snapshots everywhere
  block/io_uring: Remove superfluous semicolon
  ...

Signed-off-by: Peter Maydell <[email protected]>
5 years agoiotests: Check that @replaces can replace filters
Max Reitz [Tue, 18 Feb 2020 10:34:54 +0000 (11:34 +0100)]
iotests: Check that @replaces can replace filters

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20200218103454[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoiotests: Add tests for invalid Quorum @replaces
Max Reitz [Tue, 18 Feb 2020 10:34:53 +0000 (11:34 +0100)]
iotests: Add tests for invalid Quorum @replaces

Add two tests to see that you cannot replace a Quorum child with the
mirror job while the child is in use by a different parent.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20200218103454[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoiotests: Use self.image_len in TestRepairQuorum
Max Reitz [Tue, 18 Feb 2020 10:34:52 +0000 (11:34 +0100)]
iotests: Use self.image_len in TestRepairQuorum

041's TestRepairQuorum has its own image_len, no need to refer to
TestSingleDrive.  (This patch allows commenting out TestSingleDrive to
speed up 041 during test testing.)

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20200218103454[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoiotests: Resolve TODOs in 041
Max Reitz [Tue, 18 Feb 2020 10:34:51 +0000 (11:34 +0100)]
iotests: Resolve TODOs in 041

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20200218103454[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoiotests/041: Drop superfluous shutdowns
Max Reitz [Tue, 18 Feb 2020 10:34:50 +0000 (11:34 +0100)]
iotests/041: Drop superfluous shutdowns

All tearDowns in 041 shutdown the VM.  Thus, test cases do not need to
do it themselves (unless they need the VM to be down for some
post-operation check).

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20200218103454[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoiotests: Add VM.assert_block_path()
Max Reitz [Tue, 18 Feb 2020 10:34:49 +0000 (11:34 +0100)]
iotests: Add VM.assert_block_path()

Signed-off-by: Max Reitz <[email protected]>
Message-Id: <20200218103454[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoiotests: Use complete_and_wait() in 155
Max Reitz [Tue, 18 Feb 2020 10:34:48 +0000 (11:34 +0100)]
iotests: Use complete_and_wait() in 155

This way, we get to see errors during the completion phase.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20200218103454[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoquorum: Stop marking it as a filter
Max Reitz [Tue, 18 Feb 2020 10:34:47 +0000 (11:34 +0100)]
quorum: Stop marking it as a filter

Quorum is not a filter, for example because it cannot guarantee which of
its children will serve the next request.  Thus, any of its children may
differ from the data visible to quorum's parents.

We have other filters with multiple children, but they differ in this
aspect:

- blkverify quits the whole qemu process if its children differ.  As
  such, we can always skip it when we want to skip it (as a filter node)
  by going to any of its children.  Both have the same data.

- replication generally serves requests from bs->file, so this is its
  only actually filtered child.

- Block job filters currently only have one child, but they will
  probably get more children in the future.  Still, they will always
  have only one actually filtered child.

Having "filters" as a dedicated node category only makes sense if you
can skip them by going to a one fixed child that always shows the same
data as the filter node.  Quorum cannot fulfill this, so it is not a
filter.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20200218103454[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agomirror: Double-check immediately before replacing
Max Reitz [Tue, 18 Feb 2020 10:34:46 +0000 (11:34 +0100)]
mirror: Double-check immediately before replacing

There is no guarantee that we can still replace the node we want to
replace at the end of the mirror job.  Double-check by calling
bdrv_recurse_can_replace().

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20200218103454[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoblock: Remove bdrv_recurse_is_first_non_filter()
Max Reitz [Tue, 18 Feb 2020 10:34:45 +0000 (11:34 +0100)]
block: Remove bdrv_recurse_is_first_non_filter()

It no longer has any users.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20200218103454[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoblock: Use bdrv_recurse_can_replace()
Max Reitz [Tue, 18 Feb 2020 10:34:44 +0000 (11:34 +0100)]
block: Use bdrv_recurse_can_replace()

Let check_to_replace_node() use the more specialized
bdrv_recurse_can_replace() instead of
bdrv_recurse_is_first_non_filter(), which is too restrictive (or, in the
case of quorum, sometimes not restrictive enough).

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20200218103454[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoquorum: Implement .bdrv_recurse_can_replace()
Max Reitz [Tue, 18 Feb 2020 10:34:43 +0000 (11:34 +0100)]
quorum: Implement .bdrv_recurse_can_replace()

Signed-off-by: Max Reitz <[email protected]>
Message-Id: <20200218103454[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoblkverify: Implement .bdrv_recurse_can_replace()
Max Reitz [Tue, 18 Feb 2020 10:34:42 +0000 (11:34 +0100)]
blkverify: Implement .bdrv_recurse_can_replace()

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20200218103454[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoblock: Add bdrv_recurse_can_replace()
Max Reitz [Tue, 18 Feb 2020 10:34:41 +0000 (11:34 +0100)]
block: Add bdrv_recurse_can_replace()

After a couple of follow-up patches, this function will replace
bdrv_recurse_is_first_non_filter() in check_to_replace_node().

bdrv_recurse_is_first_non_filter() is both not sufficiently specific for
check_to_replace_node() (it allows cases that should not be allowed,
like replacing child nodes of quorum with dissenting data that have more
parents than just quorum), and it is too restrictive (it is perfectly
fine to replace filters).

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20200218103454[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoquorum: Fix child permissions
Max Reitz [Tue, 18 Feb 2020 10:34:40 +0000 (11:34 +0100)]
quorum: Fix child permissions

Quorum cannot share WRITE or RESIZE on its children.  Presumably, it
only does so because as a filter, it seemed intuitively correct to point
its .bdrv_child_perm to bdrv_filter_default_perm().

However, it is not really a filter, and bdrv_filter_default_perm() does
not work for it, so we have to provide a custom .bdrv_child_perm
implementation.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20200218103454[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoiotests: Let 041 use -blockdev for quorum children
Max Reitz [Tue, 18 Feb 2020 10:34:39 +0000 (11:34 +0100)]
iotests: Let 041 use -blockdev for quorum children

Using -drive with default options means that a virtio-blk drive will be
created that has write access to the to-be quorum children.  Quorum
should have exclusive write access to them, so we should use -blockdev
instead.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20200218103454[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoblock: Drop bdrv_is_first_non_filter()
Max Reitz [Tue, 18 Feb 2020 10:34:38 +0000 (11:34 +0100)]
block: Drop bdrv_is_first_non_filter()

It is unused now.  (And it was ugly because it needed to explore all BDS
chains from the top.)

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20200218103454[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoblockdev: Allow resizing everywhere
Max Reitz [Tue, 18 Feb 2020 10:34:37 +0000 (11:34 +0100)]
blockdev: Allow resizing everywhere

Block nodes that do not allow resizing should not share BLK_PERM_RESIZE.
It does not matter whether they are the first non-filter in their chain
or not.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20200218103454[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoblockdev: Allow external snapshots everywhere
Max Reitz [Tue, 18 Feb 2020 10:34:36 +0000 (11:34 +0100)]
blockdev: Allow external snapshots everywhere

There is no good reason why we would allow external snapshots only on
the first non-filter node in a chain.  Parent BDSs should not care
whether their child is replaced by a snapshot.  (If they do care, they
should announce that via freezing the chain, which is checked in
bdrv_append() through bdrv_set_backing_hd().)

Before we had bdrv_is_first_non_filter() here (since 212a5a8f095), there
was a special function bdrv_check_ext_snapshot() that allowed snapshots
by default, but block drivers could override this.  Only blkverify did
so, however.

It is not clear to me why blkverify would do so; maybe just so that the
testee block driver would not be replaced.  The introducing commit
f6186f49e2c does not explain why.  Maybe because 08b24cfe376 would have
been the correct solution?  (Which adds a .supports_backing check.)

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20200218103454[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoblock/io_uring: Remove superfluous semicolon
Philippe Mathieu-Daudé [Tue, 18 Feb 2020 09:43:53 +0000 (10:43 +0100)]
block/io_uring: Remove superfluous semicolon

Fixes: 6663a0a3376
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20200218094402[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoblock: Remove superfluous semicolons
Philippe Mathieu-Daudé [Tue, 18 Feb 2020 09:43:52 +0000 (10:43 +0100)]
block: Remove superfluous semicolons

Fixes: 132ada80c4a
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20200218094402[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoiotests: Test error handling policies with block-commit
Kevin Wolf [Fri, 14 Feb 2020 20:08:12 +0000 (21:08 +0100)]
iotests: Test error handling policies with block-commit

This tests both read failure (from the top node) and write failure (to
the base node) for on-error=report/stop/ignore.

As block-commit actually starts two different types of block jobs
(mirror.c for committing the active later, commit.c for intermediate
layers), all tests are run for both cases.

Signed-off-by: Kevin Wolf <[email protected]>
Message-Id: <20200214200812[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agocommit: Expose on-error option in QMP
Kevin Wolf [Fri, 14 Feb 2020 20:08:11 +0000 (21:08 +0100)]
commit: Expose on-error option in QMP

Now that the error handling in the common block job is fixed, we can
expose the on-error option in QMP instead of hard-coding it as 'report'
in qmp_block_commit().

This fulfills the promise that the old comment in that function made,
even if a bit later than expected: "This will be part of the QMP
command, if/when the BlockdevOnError change for blkmirror makes it in".

Signed-off-by: Kevin Wolf <[email protected]>
Message-Id: <20200214200812[email protected]>
Reviewed-by: Ján Tomko <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agocommit: Fix is_read for block_job_error_action()
Kevin Wolf [Fri, 14 Feb 2020 20:08:10 +0000 (21:08 +0100)]
commit: Fix is_read for block_job_error_action()

block_job_error_action() needs to know if reading from the top node or
writing to the base node failed so that it can set the right 'operation'
in the BLOCK_JOB_ERROR QMP event.

Signed-off-by: Kevin Wolf <[email protected]>
Message-Id: <20200214200812[email protected]>
Reviewed-by: Ján Tomko <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agocommit: Inline commit_populate()
Kevin Wolf [Fri, 14 Feb 2020 20:08:09 +0000 (21:08 +0100)]
commit: Inline commit_populate()

commit_populate() is a very short function and only called in a single
place. Its return value doesn't tell us whether an error happened while
reading or writing, which would be necessary for sending the right data
in the BLOCK_JOB_ERROR QMP event.

Signed-off-by: Kevin Wolf <[email protected]>
Message-Id: <20200214200812[email protected]>
Reviewed-by: Ján Tomko <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agocommit: Fix argument order for block_job_error_action()
Kevin Wolf [Fri, 14 Feb 2020 20:08:08 +0000 (21:08 +0100)]
commit: Fix argument order for block_job_error_action()

The block_job_error_action() error call in the commit job gives the
on_err and is_read arguments in the wrong order. Fix this.

(Of course, hard-coded is_read = false is wrong, too, but that's a
separate problem for a separate patch.)

Signed-off-by: Kevin Wolf <[email protected]>
Message-Id: <20200214200812[email protected]>
Reviewed-by: Ján Tomko <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agocommit: Remove unused bytes_written
Kevin Wolf [Fri, 14 Feb 2020 20:08:07 +0000 (21:08 +0100)]
commit: Remove unused bytes_written

The bytes_written variable is only ever written to, it serves no
purpose. This has actually been the case since the commit job was first
introduced in commit 747ff602636.

Signed-off-by: Kevin Wolf <[email protected]>
Message-Id: <20200214200812[email protected]>
Reviewed-by: Ján Tomko <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoqapi: Document meaning of 'ignore' BlockdevOnError for jobs
Kevin Wolf [Fri, 14 Feb 2020 20:08:06 +0000 (21:08 +0100)]
qapi: Document meaning of 'ignore' BlockdevOnError for jobs

It is not obvious what 'ignore' actually means for block jobs: It could
be continuing the job and returning success in the end despite the error
(no block job does this). It could also mean continuing and returning
failure in the end (this is what stream does). And it can mean retrying
the failed request later (this is what backup, commit and mirror do).

This (somewhat inconsistent) behaviour was introduced and described for
stream and mirror in commit 32c81a4a6ec. backup and commit were
introduced later and use the same model as mirror.

Signed-off-by: Kevin Wolf <[email protected]>
Message-Id: <20200214200812[email protected]>
Reviewed-by: Ján Tomko <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoblock/qcow2-bitmap: Remove unneeded variable assignment
Philippe Mathieu-Daudé [Sat, 15 Feb 2020 16:15:55 +0000 (17:15 +0100)]
block/qcow2-bitmap: Remove unneeded variable assignment

Fix warning reported by Clang static code analyzer:

    CC      block/qcow2-bitmap.o
  block/qcow2-bitmap.c:650:5: warning: Value stored to 'ret' is never read
      ret = -EINVAL;
      ^     ~~~~~~~

Fixes: 88ddffae8
Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20200215161557[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Ján Tomko <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoiotests: Test copy offloading with external data file
Kevin Wolf [Tue, 11 Feb 2020 09:49:00 +0000 (10:49 +0100)]
iotests: Test copy offloading with external data file

This adds a test for 'qemu-img convert' with copy offloading where the
target image has an external data file. If the test hosts supports it,
it tests both the case where copy offloading is supported and the case
where it isn't (otherwise we just test unsupported twice).

More specifically, the case with unsupported copy offloading tests
qcow2_alloc_cluster_abort() with external data files.

Signed-off-by: Kevin Wolf <[email protected]>
Message-Id: <20200211094900[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoqcow2: Fix qcow2_alloc_cluster_abort() for external data file
Kevin Wolf [Tue, 11 Feb 2020 09:48:59 +0000 (10:48 +0100)]
qcow2: Fix qcow2_alloc_cluster_abort() for external data file

For external data file, cluster allocations return an offset in the data
file and are not refcounted. In this case, there is nothing to do for
qcow2_alloc_cluster_abort(). Freeing the same offset in the qcow2 file
is wrong and causes crashes in the better case or image corruption in
the worse case.

Signed-off-by: Kevin Wolf <[email protected]>
Message-Id: <20200211094900[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoqcow2: update_refcount(): Reset old_table_index after qcow2_cache_put()
Kevin Wolf [Tue, 11 Feb 2020 09:48:58 +0000 (10:48 +0100)]
qcow2: update_refcount(): Reset old_table_index after qcow2_cache_put()

In the case that update_refcount() frees a refcount block, it evicts it
from the metadata cache. Before doing so, however, it returns the
currently used refcount block to the cache because it might be the same.
Returning the refcount block early means that we need to reset
old_table_index so that we reload the refcount block in the next
iteration if it is actually still in use.

Fixes: f71c08ea8e60f035485a512fd2af8908567592f0
Signed-off-by: Kevin Wolf <[email protected]>
Message-Id: <20200211094900[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoblock/vvfat: Do not unref qcow on closing backing bdrv
Hikaru Nishida [Sun, 9 Feb 2020 17:51:56 +0000 (02:51 +0900)]
block/vvfat: Do not unref qcow on closing backing bdrv

Before this commit, BDRVVVFATState.qcow is unrefed in write_target_close
on closing backing bdrv of vvfat. However, qcow bdrv is opend as a child
of vvfat in enable_write_target() so it will be also unrefed on closing
vvfat itself. This causes use-after-free of qcow on freeing vvfat which
has backing bdrv and qcow bdrv as children in this order because
bdrv_close(vvfat) tries to free qcow bdrv after freeing backing bdrv
as QLIST_FOREACH_SAFE() loop keeps next pointer, but BdrvChild of qcow
is already freed in bdrv_close(backing bdrv).

Signed-off-by: Hikaru Nishida <[email protected]>
Message-Id: <20200209175156[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agoqcow2: Fix alignment checks in encrypted images
Alberto Garcia [Thu, 13 Feb 2020 17:16:46 +0000 (18:16 +0100)]
qcow2: Fix alignment checks in encrypted images

I/O requests to encrypted media should be aligned to the sector size
used by the underlying encryption method, not to BDRV_SECTOR_SIZE.
Fortunately this doesn't break anything at the moment because
both existing QCRYPTO_BLOCK_*_SECTOR_SIZE have the same value as
BDRV_SECTOR_SIZE.

The checks in qcow2_co_preadv_encrypted() are also unnecessary because
they are repeated immediately afterwards in qcow2_co_encdec().

Signed-off-by: Alberto Garcia <[email protected]>
Message-Id: <20200213171646[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
5 years agomirror: Don't let an operation wait for itself
Kevin Wolf [Tue, 28 Jan 2020 15:09:28 +0000 (16:09 +0100)]
mirror: Don't let an operation wait for itself

mirror_wait_for_free_in_flight_slot() just picks a random operation to
wait for. However, when mirror_co_read() waits for free slots, its
MirrorOp is already in s->ops_in_flight, so if not enough slots are
immediately available, an operation can end up waiting for itself to
complete, which results in a hang.

Fix this by passing the current MirrorOp and skipping this operation
when picking an operation to wait for.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1794692
Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
5 years agomirror: Store MirrorOp.co for debuggability
Kevin Wolf [Tue, 28 Jan 2020 15:06:41 +0000 (16:06 +0100)]
mirror: Store MirrorOp.co for debuggability

If a coroutine is launched, but the coroutine pointer isn't stored
anywhere, debugging any problems inside the coroutine is quite hard.
Let's store the coroutine pointer of a mirror operation in MirrorOp to
have it available in the debugger.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
5 years agoMerge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2020-02-15-v2' into...
Peter Maydell [Mon, 17 Feb 2020 13:32:25 +0000 (13:32 +0000)]
Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2020-02-15-v2' into staging

Monitor patches for 2020-02-15

# gpg: Signature made Mon 17 Feb 2020 13:26:20 GMT
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Markus Armbruster <[email protected]>" [full]
# gpg:                 aka "Markus Armbruster <[email protected]>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-monitor-2020-02-15-v2:
  qemu-doc: Clarify extent of build platform support
  monitor: Move qmp_query_qmp_schema to qmp-cmds-control.c
  monitor: Collect "control" command handlers in qmp-cmds.control.c
  qapi: Split control.json off misc.json
  monitor: Move monitor option parsing to monitor/monitor.c

Signed-off-by: Peter Maydell <[email protected]>
5 years agoqemu-doc: Clarify extent of build platform support
Markus Armbruster [Thu, 13 Feb 2020 08:43:34 +0000 (09:43 +0100)]
qemu-doc: Clarify extent of build platform support

Supporting a build platform beyond its end of life makes no sense.
Spell that out just to be clear.

Signed-off-by: Markus Armbruster <[email protected]>
Message-Id: <20200213084335[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Eduardo Habkost <[email protected]>
5 years agomonitor: Move qmp_query_qmp_schema to qmp-cmds-control.c
Kevin Wolf [Wed, 29 Jan 2020 10:22:39 +0000 (11:22 +0100)]
monitor: Move qmp_query_qmp_schema to qmp-cmds-control.c

monitor/misc.c contains code that works only in the system emulator, so
it can't be linked to tools like a storage daemon. In order to make
schema introspection available for tools, move the function to
monitor/qmp-cmds-control.c, which can be linked into the storage daemon.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20200129102239[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
5 years agomonitor: Collect "control" command handlers in qmp-cmds.control.c
Kevin Wolf [Wed, 29 Jan 2020 10:22:38 +0000 (11:22 +0100)]
monitor: Collect "control" command handlers in qmp-cmds.control.c

Move all of the QMP commands handlers to implement the 'control' module
(qapi/control.json) that can be shared between the system emulator and
tools such as a storage daemon to a new file monitor/qmp-cmds-control.c.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20200129102239[email protected]>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <[email protected]>
5 years agoqapi: Split control.json off misc.json
Kevin Wolf [Wed, 29 Jan 2020 10:22:37 +0000 (11:22 +0100)]
qapi: Split control.json off misc.json

misc.json contains definitions that are related to the system emulator,
so it can't be used for other tools like the storage daemon. This patch
moves basic functionality that is shared between all tools (and mostly
related to the monitor itself) into a new control.json, which could be
used in tools as well.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20200129102239[email protected]>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <[email protected]>
5 years agomonitor: Move monitor option parsing to monitor/monitor.c
Kevin Wolf [Wed, 29 Jan 2020 10:22:36 +0000 (11:22 +0100)]
monitor: Move monitor option parsing to monitor/monitor.c

Both the system emulators and tools with QMP support (specifically, the
planned storage daemon) will need to parse monitor options, so move that
code to monitor/monitor.c, which can be linked into binaries that aren't
a system emulator.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20200129102239[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
5 years agoMerge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.0-pull-request...
Peter Maydell [Mon, 17 Feb 2020 10:01:02 +0000 (10:01 +0000)]
Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.0-pull-request' into staging

Update syscall numbers to kernel 5.5 level

# gpg: Signature made Mon 17 Feb 2020 09:30:12 GMT
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Laurent Vivier <[email protected]>" [full]
# gpg:                 aka "Laurent Vivier <[email protected]>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <[email protected]>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/linux-user-for-5.0-pull-request:
  linux-user: xtensa: Remove unused constant TARGET_NR_syscall_count
  linux-user: xtensa: Update syscall numbers to kernel 5.5 level
  linux-user: x86_64: Update syscall numbers to kernel 5.5 level
  linux-user: sh4: Update syscall numbers to kernel 5.5 level
  linux-user: mips: Update syscall numbers to kernel 5.5 level
  linux-user: microblaze: Update syscall numbers to kernel 5.5 level
  linux-user: m68k: Update syscall numbers to kernel 5.5 level
  linux-user: arm: Update syscall numbers to kernel 5.5 level
  linux-user: alpha: Update syscall numbers to kernel 5.5 level

Signed-off-by: Peter Maydell <[email protected]>
5 years agolinux-user: xtensa: Remove unused constant TARGET_NR_syscall_count
Aleksandar Markovic [Thu, 13 Feb 2020 12:29:14 +0000 (13:29 +0100)]
linux-user: xtensa: Remove unused constant TARGET_NR_syscall_count

Currently, there is no usage of TARGET_NR_syscall_count for target
xtensa, and there is no obvious indication if there is some planned
usage in future.

CC: Max Filippov <[email protected]>
Acked-by: Max Filippov <[email protected]>
Signed-off-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Message-Id: <1581596954[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
5 years agolinux-user: xtensa: Update syscall numbers to kernel 5.5 level
Aleksandar Markovic [Thu, 13 Feb 2020 12:29:13 +0000 (13:29 +0100)]
linux-user: xtensa: Update syscall numbers to kernel 5.5 level

Update xtensa syscall numbers based on Linux kernel v5.5.

CC: Max Filippov <[email protected]>
Acked-by: Max Filippov <[email protected]>
Signed-off-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Message-Id: <1581596954[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
5 years agolinux-user: x86_64: Update syscall numbers to kernel 5.5 level
Aleksandar Markovic [Thu, 13 Feb 2020 12:29:12 +0000 (13:29 +0100)]
linux-user: x86_64: Update syscall numbers to kernel 5.5 level

Update x86_64 syscall numbers based on Linux kernel v5.5.

CC: Paolo Bonzini <[email protected]>
CC: Richard Henderson <[email protected]>
CC: Eduardo Habkost <[email protected]>
Signed-off-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Message-Id: <1581596954[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
5 years agolinux-user: sh4: Update syscall numbers to kernel 5.5 level
Aleksandar Markovic [Thu, 13 Feb 2020 12:29:11 +0000 (13:29 +0100)]
linux-user: sh4: Update syscall numbers to kernel 5.5 level

Update sh4 syscall numbers based on Linux kernel v5.5.

CC: Aurelien Jarno <[email protected]>
Signed-off-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Message-Id: <1581596954[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
5 years agolinux-user: mips: Update syscall numbers to kernel 5.5 level
Aleksandar Markovic [Thu, 13 Feb 2020 12:29:10 +0000 (13:29 +0100)]
linux-user: mips: Update syscall numbers to kernel 5.5 level

Update mips syscall numbers based on Linux kernel tag v5.5.

CC: Aurelien Jarno <[email protected]>
CC: Aleksandar Rikalo <[email protected]>
Signed-off-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Message-Id: <1581596954[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
5 years agolinux-user: microblaze: Update syscall numbers to kernel 5.5 level
Aleksandar Markovic [Thu, 13 Feb 2020 12:29:09 +0000 (13:29 +0100)]
linux-user: microblaze: Update syscall numbers to kernel 5.5 level

Update microblaze syscall numbers based on Linux kernel v5.5.

CC: Edgar E. Iglesias <[email protected]>
Signed-off-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Message-Id: <1581596954[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
5 years agolinux-user: m68k: Update syscall numbers to kernel 5.5 level
Aleksandar Markovic [Thu, 13 Feb 2020 12:29:08 +0000 (13:29 +0100)]
linux-user: m68k: Update syscall numbers to kernel 5.5 level

Update m68k syscall numbers based on Linux kernel v5.5.

CC: Laurent Vivier <[email protected]>
Signed-off-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Message-Id: <1581596954[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
5 years agolinux-user: arm: Update syscall numbers to kernel 5.5 level
Aleksandar Markovic [Thu, 13 Feb 2020 12:29:07 +0000 (13:29 +0100)]
linux-user: arm: Update syscall numbers to kernel 5.5 level

Update arm syscall numbers based on Linux kernel v5.5.

CC: Peter Maydell <[email protected]>
Signed-off-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Message-Id: <1581596954[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
5 years agolinux-user: alpha: Update syscall numbers to kernel 5.5 level
Aleksandar Markovic [Thu, 13 Feb 2020 12:29:06 +0000 (13:29 +0100)]
linux-user: alpha: Update syscall numbers to kernel 5.5 level

Update alpha syscall numbers based on Linux kernel v5.5.

CC: Richard Henderson <[email protected]>
Signed-off-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Message-Id: <1581596954[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
5 years agoMerge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-02-15' into staging
Peter Maydell [Sun, 16 Feb 2020 21:15:25 +0000 (21:15 +0000)]
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-02-15' into staging

QAPI patches for 2020-02-15

# gpg: Signature made Sat 15 Feb 2020 10:44:28 GMT
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Markus Armbruster <[email protected]>" [full]
# gpg:                 aka "Markus Armbruster <[email protected]>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-qapi-2020-02-15:
  qapi: Delete all the "foo: dropped in n.n" notes
  qapi/migration.json: Replace _this_ with *this*
  qapi: Add blank lines before bulleted lists
  qapi: Use explicit bulleted lists
  qapi/ui.json: Avoid `...' Texinfo style quoting
  qapi/ui.json: Put input-send-event body text in the right place
  qapi: Remove hardcoded tabs
  qapi: Fix indent level on doc comments in json files
  qapi: Fix incorrect "Not documented" claims in QMP documentation
  qapi/block-core.json: Use literal block for ascii art
  qga/qapi-schema.json: minor format fixups for rST
  qga/qapi-schema.json: Fix indent level on doc comments
  qga/qapi-schema.json: Fix missing '-' in GuestDiskBusType doc comment
  Makefile: Fix typo in dependency list for interop manpages
  configure: Check that sphinx-build is using Python 3
  configure: Pick sphinx-build-3 when available
  configure: Allow user to specify sphinx-build binary
  qapi: Expand documentation for LostTickPolicy

Signed-off-by: Peter Maydell <[email protected]>
5 years agoqapi: Delete all the "foo: dropped in n.n" notes
Peter Maydell [Thu, 13 Feb 2020 17:56:35 +0000 (17:56 +0000)]
qapi: Delete all the "foo: dropped in n.n" notes

A handful of QAPI doc comments include lines like
"ppcemb: dropped in 3.1". The doc comment parser will just
put these into whatever the preceding section was; sometimes
that's "Notes", and sometimes it's some random other section,
as with "NetClientDriver" where the "'dump': dropped in 2.12"
line ends up in the "Since:" section.

This tends to render wrongly, more so in the upcoming rST
generator, but sometimes even in the Texinfo, as in the case
of QKeyCode:
   ac_bookmarks
       since 2.10 altgr, altgr_r: dropped in 2.10

Since commit 3264ffced3 (v4.2.0), we have a better place to tell
users about deprecated and deleted functionality --
qemu-deprecated.texi.  These "dropped in" remarks all predate it, and
other feature drops of that vintage are not documented anywhere, so
moving these to qemu-deprecated.texi makes little sense.  Drop them
instead.

Signed-off-by: Peter Maydell <[email protected]>
Message-Id: <20200213175647[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <[email protected]>
5 years agoqapi/migration.json: Replace _this_ with *this*
Peter Maydell [Thu, 13 Feb 2020 17:56:34 +0000 (17:56 +0000)]
qapi/migration.json: Replace _this_ with *this*

The MigrationInfo::setup-time documentation is the only place where we
use _this_ inline markup for emphasis, commonly rendered in italics.
We would like to switch the doc comments to rST format, but rST
doesn't recognize that markup and emits literal underscores.

Switch to *this* instead.  Changes markup to strong emphasis with
Texinfo, commonly rendered as bold.  With rST, it will go right back
to emphasis / italics.

rST also uses **this** for strong (commonly rendered bold) where
Texinfo uses *this*. We have one place in the doc comments
which uses strong/bold markup, in qapi/introspect.json:
    Note: the QAPI schema is also used to help define *internal*

When we switch to rST that will be rendered as emphasis / italics.
Markus (who wrote that) thinks that using emphasis / italics
there is an improvement, so we leave that markup alone.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20200213175647[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <[email protected]>
5 years agoqapi: Add blank lines before bulleted lists
Peter Maydell [Thu, 13 Feb 2020 17:56:33 +0000 (17:56 +0000)]
qapi: Add blank lines before bulleted lists

We would like to switch the doc comments to rST format. rST
insists on a blank line before and after a bulleted list, but our
Texinfo doc generator did not. Add some extra blank lines in the doc
comments so they're acceptable rST input.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20200213175647[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <[email protected]>
5 years agoqapi: Use explicit bulleted lists
Peter Maydell [Thu, 13 Feb 2020 17:56:30 +0000 (17:56 +0000)]
qapi: Use explicit bulleted lists

A JSON block comment like this:
     Returns: nothing on success
              If @node is not a valid block device, DeviceNotFound
              If @name is not found, GenericError with an explanation

renders like this:

     Returns: nothing on success If node is not a valid block device,
     DeviceNotFound If name is not found, GenericError with an explanation

because whitespace is not significant.

Use an actual bulleted list, so that the formatting is correct.

Signed-off-by: Peter Maydell <[email protected]>
Message-Id: <20200213175647[email protected]>
Message-Id: <20200213175647[email protected]>
Message-Id: <20200213175647[email protected]>
[Three commits squashed into one]
Reviewed-by: Markus Armbruster <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
5 years agoqapi/ui.json: Avoid `...' Texinfo style quoting
Peter Maydell [Thu, 13 Feb 2020 17:56:29 +0000 (17:56 +0000)]
qapi/ui.json: Avoid `...' Texinfo style quoting

Avoid Texinfo style quoting with `...', because we would like to
switch the doc comments to rST format, and rST treats it as a syntax
error. Use '...' instead, as we do in other doc comments. This looks
OK in Texinfo, and rST formats it as paired-quotation-marks.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20200213175647[email protected]>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <[email protected]>
5 years agoqapi/ui.json: Put input-send-event body text in the right place
Peter Maydell [Thu, 13 Feb 2020 17:56:28 +0000 (17:56 +0000)]
qapi/ui.json: Put input-send-event body text in the right place

In the doc comment for input-send-event, there is a multi-line
chunk of text ("The @device...take precedence") which is intended
to be the main body text describing the event. However it has
been placed after the arguments and Returns: section, which
means that the parser actually thinks that this text is
part of the "Returns" section text.

Move the body text up to the top so that the parser correctly
classifies it as body.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20200213175647[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
5 years agoqapi: Remove hardcoded tabs
Peter Maydell [Thu, 13 Feb 2020 17:56:27 +0000 (17:56 +0000)]
qapi: Remove hardcoded tabs

There are some stray hardcoded tabs in some of our json files;
remove them.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20200213175647[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
5 years agoqapi: Fix indent level on doc comments in json files
Peter Maydell [Thu, 13 Feb 2020 17:56:26 +0000 (17:56 +0000)]
qapi: Fix indent level on doc comments in json files

The current doc generation doesn't care much about indentation levels,
but we would like to switch to an rST format, and rST does care about
indentation.

Make the doc comments more strongly consistent about indentation
for multiline constructs like:

@arg: description line 1
      description line 2

Returns: line one
         line 2

so that there is always exactly one space after the colon, and
subsequent lines align with the first.

This commit is a purely whitespace change, and it does not alter the
generated .texi files (because the texi generation code strips away
all the extra whitespace).  This does mean that we end up with some
over-length lines.

Note that when the documentation for an argument fits on a single
line like this:

@arg: one line only

then stray extra spaces after the ':' don't affect the rST output, so
I have not attempted to methodically fix them, though the preference
is a single space here too.

Signed-off-by: Peter Maydell <[email protected]>
Message-Id: <20200213175647[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <[email protected]>
5 years agoqapi: Fix incorrect "Not documented" claims in QMP documentation
Peter Maydell [Thu, 13 Feb 2020 17:56:25 +0000 (17:56 +0000)]
qapi: Fix incorrect "Not documented" claims in QMP documentation

Some qapi doc comments have forgotten the ':' after the
@argument, like this:

# @filename         Filename for the new image file
# @size             Size of the virtual disk in bytes

The result is that these are parsed as part of the body
text and appear as a run-on line:
  filename Filename for the new image file size Size of the virtual disk in bytes"
followed by
  filename: string
    Not documented
  size: int
    Not documented

in the 'Members' section.

Correct the formatting.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20200213175647[email protected]>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <[email protected]>
5 years agoqapi/block-core.json: Use literal block for ascii art
Peter Maydell [Thu, 13 Feb 2020 17:56:24 +0000 (17:56 +0000)]
qapi/block-core.json: Use literal block for ascii art

The ascii-art graph in the BlockLatencyHistogramInfo documentation
doesn't render correctly, because the whitespace is collapsed.

Use the '|' format that emits a literal 'example' block so the graph
is displayed correctly.

Strictly the Texinfo generated is still wrong because each line
goes into its own @example environment, but it renders better
than what we had before.

Fixing this rendering is a necessary prerequisite for the upcoming rST
generator, which otherwise complains about the inconsistent
indentation in the ascii-art graph.

Signed-off-by: Peter Maydell <[email protected]>
Message-Id: <20200213175647[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <[email protected]>
5 years agoqga/qapi-schema.json: minor format fixups for rST
Peter Maydell [Thu, 13 Feb 2020 17:56:23 +0000 (17:56 +0000)]
qga/qapi-schema.json: minor format fixups for rST

We would like to switch the doc comments to rST format, and rST
requires a blank line before the start of a bulleted or enumerated
list. Two places in qapi-schema.json were missing this blank line.

Some places were using an indented line as a sort of single-item
bulleted list, which in the Texinfo output comes out all run
onto a single line; use a real bulleted list instead.

Some places unnecessarily indented lists, which confuses rST.

guest-fstrim:minimum's documentation was indented the
right amount to share a line with @minimum, but wasn't
actually doing so.

The indent on the bulleted list in the guest-set-vcpus
Returns section meant rST misindented it.

Changes to the generated Texinfo are very minor (the new
bulleted lists, and a few extra blank lines).

Signed-off-by: Peter Maydell <[email protected]>
Message-Id: <20200213175647[email protected]>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <[email protected]>
5 years agoqga/qapi-schema.json: Fix indent level on doc comments
Peter Maydell [Thu, 13 Feb 2020 17:56:22 +0000 (17:56 +0000)]
qga/qapi-schema.json: Fix indent level on doc comments

The current doc generation doesn't care much about indentation levels,
but we would like to switch to an rST format, and rST does care about
indentation.

Make the doc comments more strongly consistent about indentation
for multiline constructs like:

@arg: description line 1
      description line 2

Returns: line one
         line 2

so that there is always exactly one space after the colon, and
subsequent lines align with the first.

This commit is a purely whitespace change, and it does not alter the
generated .texi files (because the texi generation code strips away
all the extra whitespace).  This does mean that we end up with some
over-length lines.

Note that when the documentation for an argument fits on a single
line like this:

@arg: one line only

then stray extra spaces after the ':' don't affect the rST output, so
I have not attempted to methodically fix them, though the preference
is a single space here too.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20200213175647[email protected]>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <[email protected]>
5 years agoqga/qapi-schema.json: Fix missing '-' in GuestDiskBusType doc comment
Peter Maydell [Thu, 13 Feb 2020 17:56:21 +0000 (17:56 +0000)]
qga/qapi-schema.json: Fix missing '-' in GuestDiskBusType doc comment

The doc comment for GuestDiskBusType doesn't match up with the
enumeration because of a missing hyphen in 'file-backed-virtual'.
This means the docs are rendered wrongly:
       "virtual"
           Win virtual bus type "file-backed" virtual: Win file-backed bus type

       "file-backed-virtual"
           Not documented

Add the missing hyphen.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20200213175647[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
5 years agoMakefile: Fix typo in dependency list for interop manpages
Peter Maydell [Thu, 13 Feb 2020 17:56:20 +0000 (17:56 +0000)]
Makefile: Fix typo in dependency list for interop manpages

Fix a typo in the dependency list for the manpages built from the
'interop' manual, which meant we were accidentally not including
the .hx file in the dependency list.

Fixes: e13c59fa4414215500e6
Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20200213175647[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
5 years agoconfigure: Check that sphinx-build is using Python 3
Peter Maydell [Thu, 13 Feb 2020 17:56:19 +0000 (17:56 +0000)]
configure: Check that sphinx-build is using Python 3

Currently configure's has_sphinx_build() check simply runs a dummy
sphinx-build and either passes or fails.  This means that "no
sphinx-build at all" and "sphinx-build exists but is too old" are
both reported the same way.

Further, we want to assume that all the Python we write is running
with at least Python 3.5; configure checks that for our scripts, but
Sphinx extensions run with whatever Python version sphinx-build
itself is using.

Add a check to our conf.py which makes sphinx-build fail if it would
be running our extensions with an old Python, and handle this
in configure so we can report failure helpfully to the user.
This will mean that configure --enable-docs will fail like this
if the sphinx-build provided is not suitable:

Warning: sphinx-build exists but it is either too old or uses too old a Python version

ERROR: User requested feature docs
       configure was not able to find it.
       Install texinfo, Perl/perl-podlators and a Python 3 version of python-sphinx

(As usual, the default is to simply not build the docs, as we would
if sphinx-build wasn't present at all.)

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Alex Bennée <[email protected]>
Reviewed-by: Wainer dos Santos Moschetta <[email protected]>
Message-Id: <20200213175647[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
5 years agoconfigure: Pick sphinx-build-3 when available
Markus Armbruster [Fri, 14 Feb 2020 17:18:41 +0000 (18:18 +0100)]
configure: Pick sphinx-build-3 when available

The next commit will require a sphinx-build that uses Python 3.  On
some systems, sphinx-build is fine, on others you need to use
sphinx-build-3.  To keep things working out of the box on both kinds
of systems, try sphinx-build-3, then sphinx-build.

Signed-off-by: Markus Armbruster <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
5 years agoMerge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-5.0-sf2' into...
Peter Maydell [Fri, 14 Feb 2020 18:37:11 +0000 (18:37 +0000)]
Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-5.0-sf2' into staging

RISC-V Patches for the 5.0 Soft Freeze, Part 2

This is a fairly light-weight pull request, but I wanted to send it out to
avoid the Goldfish stuff getting buried as the next PR should contain the H
extension implementation.

As far as this PR goes, it contains:

* The addition of syscon device tree nodes for reboot and poweroff, which
  allows Linux to control QEMU without an additional driver.  The existing
  device was already compatible with the syscon interface.
* A fix to our GDB stub to avoid confusing XLEN and FLEN, specifically useful
  for rv32id-based systems.
* A device emulation for the Goldfish RTC device, a simple memory-mapped RTC.
* The addition of the Goldfish RTC device to the RISC-V virt board.

This passes "make check" and boots buildroot for me.

# gpg: Signature made Mon 10 Feb 2020 21:28:04 GMT
# gpg:                using RSA key 2B3C3747446843B24A943A7A2E1319F35FBB1889
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Palmer Dabbelt <[email protected]>" [unknown]
# gpg:                 aka "Palmer Dabbelt <[email protected]>" [unknown]
# gpg:                 aka "Palmer Dabbelt <[email protected]>" [unknown]
# 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: 00CE 76D1 8349 60DF CE88  6DF8 EF4C A150 2CCB AB41
#      Subkey fingerprint: 2B3C 3747 4468 43B2 4A94  3A7A 2E13 19F3 5FBB 1889

* remotes/palmer/tags/riscv-for-master-5.0-sf2:
  MAINTAINERS: Add maintainer entry for Goldfish RTC
  riscv: virt: Use Goldfish RTC device
  hw: rtc: Add Goldfish RTC device
  riscv: Separate FPU register size from core register size in gdbstub [v2]
  riscv/virt: Add syscon reboot and poweroff DT nodes

Signed-off-by: Peter Maydell <[email protected]>
5 years agoMerge remote-tracking branch 'remotes/juanquintela/tags/pull-migration-pull-request...
Peter Maydell [Fri, 14 Feb 2020 17:57:15 +0000 (17:57 +0000)]
Merge remote-tracking branch 'remotes/juanquintela/tags/pull-migration-pull-request' into staging

Migration pull request

# gpg: Signature made Thu 13 Feb 2020 13:04:43 GMT
# gpg:                using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723
# gpg: Good signature from "Juan Quintela <[email protected]>" [full]
# gpg:                 aka "Juan Quintela <[email protected]>" [full]
# Primary key fingerprint: 1899 FF8E DEBF 58CC EE03  4B82 F487 EF18 5872 D723

* remotes/juanquintela/tags/pull-migration-pull-request:
  git: Make submodule check only needed modules
  migration-test: fix some memleaks in migration-test
  tests/migration: Add some slack to auto converge
  migration/rdma: rdma_accept_incoming_migration fix error handling
  migration: Optimization about wait-unplug migration state
  migration: Maybe VM is paused when migration is cancelled

Signed-off-by: Peter Maydell <[email protected]>
5 years agoMerge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.0-pull-request...
Peter Maydell [Fri, 14 Feb 2020 16:54:23 +0000 (16:54 +0000)]
Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.0-pull-request' into staging

Implement TARGET_SO_PEERSEC
Fix rt signals management

# gpg: Signature made Thu 13 Feb 2020 12:20:50 GMT
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Laurent Vivier <[email protected]>" [full]
# gpg:                 aka "Laurent Vivier <[email protected]>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <[email protected]>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/linux-user-for-5.0-pull-request:
  linux-user: implement TARGET_SO_PEERSEC
  linux-user: fix use of SIGRTMIN
  linux-user: fix TARGET_NSIG and _NSIG uses
  linux-user: cleanup signal.c
  linux-user: add missing TARGET_SIGRTMIN for hppa

Signed-off-by: Peter Maydell <[email protected]>
# Conflicts:
# linux-user/signal.c

5 years agoconfigure: Allow user to specify sphinx-build binary
Peter Maydell [Thu, 13 Feb 2020 17:56:18 +0000 (17:56 +0000)]
configure: Allow user to specify sphinx-build binary

Currently we insist on using 'sphinx-build' from the $PATH;
allow the user to specify the binary to use. This will be
more useful as we become pickier about the capabilities
we require (eg needing a Python 3 sphinx-build).

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Alex Bennée <[email protected]>
Reviewed-by: Wainer dos Santos Moschetta <[email protected]>
Message-Id: <20200213175647[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
5 years agoqapi: Expand documentation for LostTickPolicy
Andrea Bolognani [Tue, 11 Feb 2020 18:37:44 +0000 (19:37 +0100)]
qapi: Expand documentation for LostTickPolicy

The current documentation is fairly terse and not easy to decode
for someone who's not intimately familiar with the inner workings
of timer devices. Expand on it by providing a somewhat verbose
description of what behavior each policy will result in, as seen
from both the guest OS and host point of view.

Signed-off-by: Andrea Bolognani <[email protected]>
Message-Id: <20200211183744[email protected]>
Reviewed-by: Ján Tomko <[email protected]>
Reviewed-by: Andrew Jones <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
5 years agoMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200213' into...
Peter Maydell [Fri, 14 Feb 2020 15:10:33 +0000 (15:10 +0000)]
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200213' into staging

target-arm queue:
 * i.MX: Fix inverted sense of register bits in watchdog timer
 * i.MX: Add support for WDT on i.MX6
 * arm/virt: cleanups to ACPI tables
 * Implement ARMv8.1-VMID16 extension
 * Implement ARMv8.1-PAN
 * Implement ARMv8.2-UAO
 * Implement ARMv8.2-ATS1E1
 * ast2400/2500/2600: Wire up EHCI controllers
 * hw/char/exynos4210_uart: Fix memleaks in exynos4210_uart_init
 * hw/arm/raspi: Clean up the board code

# gpg: Signature made Thu 13 Feb 2020 14:40:34 GMT
# gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Peter Maydell <[email protected]>" [ultimate]
# gpg:                 aka "Peter Maydell <[email protected]>" [ultimate]
# gpg:                 aka "Peter Maydell <[email protected]>" [ultimate]
# Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE

* remotes/pmaydell/tags/pull-target-arm-20200213: (46 commits)
  target/arm: Implement ARMv8.1-VMID16 extension
  hw/arm/raspi: Extract the cores count from the board revision
  hw/arm/raspi: Use a unique raspi_machine_class_init() method
  hw/arm/raspi: Extract the board model from the board revision
  hw/arm/raspi: Set default RAM size to size encoded in board revision
  hw/arm/raspi: Let class_init() directly call raspi_machine_init()
  hw/arm/raspi: Make board_rev a field of RaspiMachineClass
  hw/arm/raspi: Make machines children of abstract RaspiMachineClass
  hw/arm/raspi: Trivial code movement
  hw/arm/raspi: Extract the processor type from the board revision
  hw/arm/raspi: Extract the RAM size from the board revision
  hw/arm/raspi: Extract the version from the board revision
  hw/arm/raspi: Correct the board descriptions
  hw/arm/raspi: Use BCM2708 machine type with pre Device Tree kernels
  hw/char/exynos4210_uart: Fix memleaks in exynos4210_uart_init
  hw/arm: ast2600: Wire up EHCI controllers
  hw/arm: ast2400/ast2500: Wire up EHCI controllers
  target/arm: Enable ARMv8.2-UAO in -cpu max
  target/arm: Implement UAO semantics
  target/arm: Update MSR access to UAO
  ...

Signed-off-by: Peter Maydell <[email protected]>
5 years agoMerge remote-tracking branch 'remotes/kraxel/tags/vga-20200213-pull-request' into...
Peter Maydell [Thu, 13 Feb 2020 18:55:57 +0000 (18:55 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/vga-20200213-pull-request' into staging

qxl: introduce hardware revision 5

# gpg: Signature made Thu 13 Feb 2020 09:06:14 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <[email protected]>" [full]
# gpg:                 aka "Gerd Hoffmann <[email protected]>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <[email protected]>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/vga-20200213-pull-request:
  qxl: introduce hardware revision 5

Signed-off-by: Peter Maydell <[email protected]>
5 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-tcg-20200212' into staging
Peter Maydell [Thu, 13 Feb 2020 18:00:37 +0000 (18:00 +0000)]
Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20200212' into staging

Fix breakpoint invalidation.
Add support for tcg helpers with 7 arguments.
Add support for gvec helpers with 5 arguments.

# gpg: Signature made Thu 13 Feb 2020 00:21:34 GMT
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Richard Henderson <[email protected]>" [full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* remotes/rth/tags/pull-tcg-20200212:
  tcg: Add tcg_gen_gvec_5_ptr
  tcg: Add support for a helper with 7 arguments
  exec: flush CPU TB cache in breakpoint_invalidate

Signed-off-by: Peter Maydell <[email protected]>
5 years agoMerge remote-tracking branch 'remotes/kraxel/tags/usb-20200212-pull-request' into...
Peter Maydell [Thu, 13 Feb 2020 14:44:07 +0000 (14:44 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/usb-20200212-pull-request' into staging

usb: bugfixes

# gpg: Signature made Wed 12 Feb 2020 20:57:44 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <[email protected]>" [full]
# gpg:                 aka "Gerd Hoffmann <[email protected]>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <[email protected]>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/usb-20200212-pull-request:
  uas: fix super speed bMaxPacketSize0
  usb-host: wait for cancel complete

Signed-off-by: Peter Maydell <[email protected]>
5 years agotarget/arm: Implement ARMv8.1-VMID16 extension
Peter Maydell [Mon, 10 Feb 2020 12:01:46 +0000 (12:01 +0000)]
target/arm: Implement ARMv8.1-VMID16 extension

The ARMv8.1-VMID16 extension extends the VMID from 8 bits to 16 bits:

 * the ID_AA64MMFR1_EL1.VMIDBits field specifies whether the VMID is
   8 or 16 bits
 * the VMID field in VTTBR_EL2 is extended to 16 bits
 * VTCR_EL2.VS lets the guest specify whether to use the full 16 bits,
   or use the backwards-compatible 8 bits

For QEMU implementing this is trivial:
 * we do not track VMIDs in TLB entries, so we never use the VMID field
 * we treat any write to VTTBR_EL2, not just a change to the VMID field
   bits, as a "possible VMID change" that causes us to throw away TLB
   entries, so that code doesn't need changing
 * we allow the guest to read/write the VTCR_EL2.VS bit already

So all that's missing is the ID register part: report that we support
VMID16 in our 'max' CPU.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Alex Bennée <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-id: 20200210120146[email protected]

5 years agohw/arm/raspi: Extract the cores count from the board revision
Philippe Mathieu-Daudé [Sat, 8 Feb 2020 16:56:45 +0000 (17:56 +0100)]
hw/arm/raspi: Extract the cores count from the board revision

The count of ARM cores is encoded in the board revision.  Add a
helper to extract the number of cores, and use it.  This will be
helpful when we add the Raspi0/1 that have a single core.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20200208165645[email protected]
Reviewed-by: Peter Maydell <[email protected]>
[PMM: tweaked commit message as suggested by Igor]
Signed-off-by: Peter Maydell <[email protected]>
5 years agohw/arm/raspi: Use a unique raspi_machine_class_init() method
Philippe Mathieu-Daudé [Sat, 8 Feb 2020 16:56:44 +0000 (17:56 +0100)]
hw/arm/raspi: Use a unique raspi_machine_class_init() method

With the exception of the ignore_memory_transaction_failures
flag set for the raspi2, both machine_class_init() methods
are now identical. Merge them to keep a unique method.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Igor Mammedov <[email protected]>
Message-id: 20200208165645[email protected]
Signed-off-by: Peter Maydell <[email protected]>
This page took 0.104804 seconds and 4 git commands to generate.