Skip to contentSkip to conversation

Block patches for 5.1

GIT PULL Applied Max Reitz 3 participants 7 messages Jul 27, 2020 – Jul 28, 2020 Block layer

lore
Share & tools
lore
author
#1 lore raw

[PULL 1/3] block/amend: Check whether the node exists

In reply to Max Reitz

We should check whether the user-specified node-name actually refers to a node. The simplest way to do that is to use bdrv_lookup_bs() instead of bdrv_find_node() (the former wraps the latter, and produces an error message if necessary).

Reported-by Coverity (CID 1430268)
Fixes ced914d0ab9fb2c900f873f6349a0b8eecd1fdbe

Message-Id: <[email protected]>

---
 block/amend.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
block/amend.c +5 -1
index f4612dcf08..392df9ef83 100644
@@ -69,8 +69,12 @@ void qmp_x_blockdev_amend(const char *job_id,
     BlockdevAmendJob *s;
     const char *fmt = BlockdevDriver_str(options->driver);
     BlockDriver *drv = bdrv_find_format(fmt);
-    BlockDriverState *bs = bdrv_find_node(node_name);
+    BlockDriverState *bs;
 
+    bs = bdrv_lookup_bs(NULL, node_name, errp);
+    if (!bs) {
+        return;
+    }
 
     if (!drv) {
         error_setg(errp, "Block driver '%s' not found or not supported", fmt);
Signature · 1 line
2.26.2

Max Reitz

author
#0 lore raw

The following changes since commit 4215d3413272ad6d1c6c9d0234450b602e46a74c:

Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.1-20200727' into staging (2020-07-27 09:33:04 +0100)

are available in the Git repository at:

https://github.com/XanClic/qemu.git tags/pull-block-2020-07-27

for you to fetch changes up to 1855536256eb0a5708b04b85f744de69559ea323:

iotests/197: Fix for compat=0.10 (2020-07-27 16:35:17 +0200)

----------------------------------------------------------------
Block patches for 5.1:
- Coverity fix
- iotests fix for rx and avr
- iotests fix for qcow2 -o compat=0.10

----------------------------------------------------------------
Max Reitz (2):
block/amend: Check whether the node exists
iotests/197: Fix for compat=0.10

Thomas Huth (1):
iotests: Select a default machine for the rx and avr targets

 block/amend.c            |  6 +++++-
 tests/qemu-iotests/197   |  4 +++-
 tests/qemu-iotests/check | 14 +++++++++-----
 3 files changed, 17 insertions(+), 7 deletions(-)
Signature · 1 line
2.26.2
author
#2 lore raw

[PULL 2/3] iotests: Select a default machine for the rx and avr targets

From: Thomas Huth <[email protected]>

If you are building only with either the new rx-softmmu or avr-softmmu target, "make check-block" fails a couple of tests since there is no default machine defined in these new targets. We have to select a machine in the "check" script for these, just like we already do for the arm- and tricore-softmmu targets.

Message-Id: <[email protected]>

---
 tests/qemu-iotests/check | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
tests/qemu-iotests/check +9 -5
index e0d8049012..0657f7286c 100755
@@ -595,15 +595,19 @@ then
 fi
 export QEMU_PROG="$(type -p "$QEMU_PROG")"
 
+export QEMU_OPTIONS="-nodefaults -display none -accel qtest"
 case "$QEMU_PROG" in
     *qemu-system-arm|*qemu-system-aarch64)
-        export QEMU_OPTIONS="-nodefaults -display none -machine virt -accel qtest"
+        export QEMU_OPTIONS="$QEMU_OPTIONS -machine virt"
         ;;
-    *qemu-system-tricore)
-        export QEMU_OPTIONS="-nodefaults -display none -machine tricore_testboard -accel qtest"
+    *qemu-system-avr)
+        export QEMU_OPTIONS="$QEMU_OPTIONS -machine mega2560"
+        ;;
+    *qemu-system-rx)
+        export QEMU_OPTIONS="$QEMU_OPTIONS -machine gdbsim-r5f562n8"
         ;;
-    *)
-        export QEMU_OPTIONS="-nodefaults -display none -accel qtest"
+    *qemu-system-tricore)
+        export QEMU_OPTIONS="-$QEMU_OPTIONS -machine tricore_testboard"
         ;;
 esac
 
Signature · 1 line
2.26.2
author
#3 lore raw

[PULL 3/3] iotests/197: Fix for compat=0.10

In reply to Max Reitz

Writing zeroes to a qcow2 v2 images without a backing file results in an unallocated cluster as of 61b3043965. 197 has a test for COR-ing a cluster on an image without a backing file, which means that the data will be zero, so now on a v2 image that cluster will just stay unallocated, and so the test fails. Just force compat=1.1 for that particular case to enforce the cluster to get allocated.

Fixes 61b3043965fe3552ee2684a97e7cc809ca7a71b3

Message-Id: <[email protected]>

---
 tests/qemu-iotests/197 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tests/qemu-iotests/197 +3 -1
index 95f05b0e34..121959a09c 100755
@@ -112,7 +112,9 @@ echo
 echo '=== Partial final cluster ==='
 echo
 
-_make_test_img 1024
+# Force compat=1.1, because writing zeroes on a v2 image without a
+# backing file would just result in an unallocated cluster
+_make_test_img -o compat=1.1 1024
 $QEMU_IO -f $IMGFMT -C -c 'read 0 1024' "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -f $IMGFMT -c map "$TEST_IMG"
 _check_test_img
Signature · 1 line
2.26.2
#4 lore raw
In reply to Max Reitz
Quoted 11 lines · Max Reitz

The following changes since commit 4215d3413272ad6d1c6c9d0234450b602e46a74c:

Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.1-20200727' into staging (2020-07-27 09:33:04 +0100)

are available in the Git repository at:

https://github.com/XanClic/qemu.git tags/pull-block-2020-07-27

for you to fetch changes up to 1855536256eb0a5708b04b85f744de69559ea323:

Quoted 8 lines

iotests/197: Fix for compat=0.10 (2020-07-27 16:35:17 +0200)

----------------------------------------------------------------
Block patches for 5.1:
- Coverity fix
- iotests fix for rx and avr
- iotests fix for qcow2 -o compat=0.10

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/5.1
for any user-visible changes.

-- PMM

#5 lore raw
Quoted 10 lines · Peter Maydell
Quoted 6 lines · Max Reitz

----------------------------------------------------------------
Block patches for 5.1:
- Coverity fix
- iotests fix for rx and avr
- iotests fix for qcow2 -o compat=0.10

Applied, thanks.

This seems to have broken the "tcg disabled" build on gitlab:
https://gitlab.com/qemu-project/qemu/-/jobs/659352096

197 [1m [31mfail [0m [10:57:48] [10:59:34]
output mismatch (see 197.out.bad)
--- /builds/qemu-project/qemu/tests/qemu-iotests/197.out 2020-07-28 10:47:16.000000000 +0000
+++ /builds/qemu-project/qemu/build/tests/qemu-iotests/197.out.bad

2020-07-28 10:59:33.000000000 +0000

@@ -26,9 +26,9 @@

=== Partial final cluster ===

-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1024 +qemu-img: TEST_DIR/t.IMGFMT: Invalid parameter 'compat'
read 1024/1024 bytes at offset 0
1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-1 KiB (0x400) bytes allocated at offset 0 bytes (0x0)
+4 GiB (0x100000000) bytes allocated at offset 0 bytes (0x0)
No errors were found on the image.
*** done

thanks
-- PMM

#6 lore raw
Quoted 10 lines · Peter Maydell
Quoted 9 lines · Peter Maydell
Quoted 6 lines · Max Reitz

----------------------------------------------------------------
Block patches for 5.1:
- Coverity fix
- iotests fix for rx and avr
- iotests fix for qcow2 -o compat=0.10

Quoted 4 lines
Quoted 1 line

Applied, thanks.

This seems to have broken the "tcg disabled" build on gitlab:
https://gitlab.com/qemu-project/qemu/-/jobs/659352096

Max already sent another pull request that contains the fix for this issue, look for "[PULL 0/3] Block patches for 5.1.0-rc2?"

Thomas