qemu-kvm/kvm-iotests-Test-resizing-image-attached-to-an-iothread.patch
Miroslav Rezanina 6ee9df2871 * Mon May 22 2023 Miroslav Rezanina <mrezanin@redhat.com> - 8.0.0-4
- kvm-migration-Attempt-disk-reactivation-in-more-failure-.patch [bz#2058982]
- kvm-util-mmap-alloc-qemu_fd_getfs.patch [bz#2057267]
- kvm-vl.c-Create-late-backends-before-migration-object.patch [bz#2057267]
- kvm-migration-postcopy-Detect-file-system-on-dest-host.patch [bz#2057267]
- kvm-migration-mark-mixed-functions-that-can-suspend.patch [bz#2057267]
- kvm-postcopy-ram-do-not-use-qatomic_mb_read.patch [bz#2057267]
- kvm-migration-remove-extra-whitespace-character-for-code.patch [bz#2057267]
- kvm-migration-Merge-ram_counters-and-ram_atomic_counters.patch [bz#2057267]
- kvm-migration-Update-atomic-stats-out-of-the-mutex.patch [bz#2057267]
- kvm-migration-Make-multifd_bytes-atomic.patch [bz#2057267]
- kvm-migration-Make-dirty_sync_missed_zero_copy-atomic.patch [bz#2057267]
- kvm-migration-Make-precopy_bytes-atomic.patch [bz#2057267]
- kvm-migration-Make-downtime_bytes-atomic.patch [bz#2057267]
- kvm-migration-Make-dirty_sync_count-atomic.patch [bz#2057267]
- kvm-migration-Make-postcopy_requests-atomic.patch [bz#2057267]
- kvm-migration-Rename-duplicate-to-zero_pages.patch [bz#2057267]
- kvm-migration-Rename-normal-to-normal_pages.patch [bz#2057267]
- kvm-migration-rename-enabled_capabilities-to-capabilitie.patch [bz#2057267]
- kvm-migration-Pass-migrate_caps_check-the-old-and-new-ca.patch [bz#2057267]
- kvm-migration-move-migration_global_dump-to-migration-hm.patch [bz#2057267]
- kvm-spice-move-client_migrate_info-command-to-ui.patch [bz#2057267]
- kvm-migration-Create-migrate_cap_set.patch [bz#2057267]
- kvm-migration-Create-options.c.patch [bz#2057267]
- kvm-migration-Move-migrate_colo_enabled-to-options.c.patch [bz#2057267]
- kvm-migration-Move-migrate_use_compression-to-options.c.patch [bz#2057267]
- kvm-migration-Move-migrate_use_events-to-options.c.patch [bz#2057267]
- kvm-migration-Move-migrate_use_multifd-to-options.c.patch [bz#2057267]
- kvm-migration-Move-migrate_use_zero_copy_send-to-options.patch [bz#2057267]
- kvm-migration-Move-migrate_use_xbzrle-to-options.c.patch [bz#2057267]
- kvm-migration-Move-migrate_use_block-to-options.c.patch [bz#2057267]
- kvm-migration-Move-migrate_use_return-to-options.c.patch [bz#2057267]
- kvm-migration-Create-migrate_rdma_pin_all-function.patch [bz#2057267]
- kvm-migration-Move-migrate_caps_check-to-options.c.patch [bz#2057267]
- kvm-migration-Move-qmp_query_migrate_capabilities-to-opt.patch [bz#2057267]
- kvm-migration-Move-qmp_migrate_set_capabilities-to-optio.patch [bz#2057267]
- kvm-migration-Move-migrate_cap_set-to-options.c.patch [bz#2057267]
- kvm-migration-Move-parameters-functions-to-option.c.patch [bz#2057267]
- kvm-migration-Use-migrate_max_postcopy_bandwidth.patch [bz#2057267]
- kvm-migration-Move-migrate_use_block_incremental-to-opti.patch [bz#2057267]
- kvm-migration-Create-migrate_throttle_trigger_threshold.patch [bz#2057267]
- kvm-migration-Create-migrate_checkpoint_delay.patch [bz#2057267]
- kvm-migration-Create-migrate_max_cpu_throttle.patch [bz#2057267]
- kvm-migration-Move-migrate_announce_params-to-option.c.patch [bz#2057267]
- kvm-migration-Create-migrate_cpu_throttle_initial-to-opt.patch [bz#2057267]
- kvm-migration-Create-migrate_cpu_throttle_increment-func.patch [bz#2057267]
- kvm-migration-Create-migrate_cpu_throttle_tailslow-funct.patch [bz#2057267]
- kvm-migration-Move-migrate_postcopy-to-options.c.patch [bz#2057267]
- kvm-migration-Create-migrate_max_bandwidth-function.patch [bz#2057267]
- kvm-migration-Move-migrate_use_tls-to-options.c.patch [bz#2057267]
- kvm-migration-Move-qmp_migrate_set_parameters-to-options.patch [bz#2057267]
- kvm-migration-Allow-postcopy_ram_supported_by_host-to-re.patch [bz#2057267]
- kvm-block-bdrv-blk_co_unref-for-calls-in-coroutine-conte.patch [bz#2185688]
- kvm-block-Don-t-call-no_coroutine_fns-in-qmp_block_resiz.patch [bz#2185688]
- kvm-iotests-Use-alternative-CPU-type-that-is-not-depreca.patch [bz#2185688]
- kvm-iotests-Test-resizing-image-attached-to-an-iothread.patch [bz#2185688]
- kvm-Enable-Linux-io_uring.patch [bz#1947230]
- Resolves: bz#2058982
  (Qemu core dump if cut off nfs storage during migration)
- Resolves: bz#2057267
  (Migration with postcopy fail when vm set with shared memory)
- Resolves: bz#2185688
  ([qemu-kvm] no response with QMP command block_resize)
- Resolves: bz#1947230
  (Enable QEMU support for io_uring in RHEL9)
2023-05-22 01:24:31 -04:00

133 lines
4.1 KiB
Diff

From 2c9e6892369ff99decd4030642b8dcf3875e9ebf Mon Sep 17 00:00:00 2001
From: Kevin Wolf <kwolf@redhat.com>
Date: Tue, 9 May 2023 15:41:33 +0200
Subject: [PATCH 55/56] iotests: Test resizing image attached to an iothread
RH-Author: Kevin Wolf <kwolf@redhat.com>
RH-MergeRequest: 164: block: Fix hangs in qmp_block_resize()
RH-Bugzilla: 2185688
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
RH-Acked-by: Hanna Czenczek <hreitz@redhat.com>
RH-Acked-by: Eric Blake <eblake@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Commit: [4/4] 8d31752d1e6e8c6a422d68d9cb2251fbc34b7aef (kmwolf/centos-qemu-kvm)
This tests that trying to resize an image with QMP block_resize doesn't
hang or otherwise fail when the image is attached to a device running in
an iothread.
This is a regression test for the recent fix that changed
qmp_block_resize, which is a coroutine based QMP handler, to avoid
calling no_coroutine_fns directly.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230509134133.373408-1-kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit e113362e4cdfdcfe1d497e569527f70a0021333a)
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
tests/qemu-iotests/tests/iothreads-resize | 71 +++++++++++++++++++
tests/qemu-iotests/tests/iothreads-resize.out | 11 +++
2 files changed, 82 insertions(+)
create mode 100755 tests/qemu-iotests/tests/iothreads-resize
create mode 100644 tests/qemu-iotests/tests/iothreads-resize.out
diff --git a/tests/qemu-iotests/tests/iothreads-resize b/tests/qemu-iotests/tests/iothreads-resize
new file mode 100755
index 0000000000..36e4598c62
--- /dev/null
+++ b/tests/qemu-iotests/tests/iothreads-resize
@@ -0,0 +1,71 @@
+#!/usr/bin/env bash
+# group: rw auto quick
+#
+# Test resizing an image that is attached to a separate iothread
+#
+# Copyright (C) 2023 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+# creator
+owner=kwolf@redhat.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+status=1 # failure is the default!
+
+_cleanup()
+{
+ _cleanup_test_img
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+cd ..
+. ./common.rc
+. ./common.filter
+
+# Resizing images is only supported by a few block drivers
+_supported_fmt raw qcow2 qed
+_supported_proto file
+_require_devices virtio-scsi-pci
+
+size=64M
+_make_test_img $size
+
+qmp() {
+cat <<EOF
+{"execute":"qmp_capabilities"}
+{'execute': 'block_resize',
+ 'arguments': {'node-name': 'img', 'size': 134217728}}
+{"execute":"quit"}
+EOF
+}
+
+qmp | $QEMU -S -display none \
+ -drive if=none,format=$IMGFMT,file="$TEST_IMG",node-name=img \
+ -object iothread,id=t0 \
+ -device virtio-scsi-pci,iothread=t0 \
+ -device scsi-hd,drive=none0 \
+ -qmp stdio \
+ | _filter_qmp
+
+_img_info | _filter_img_info
+
+# success, all done
+echo "*** done"
+rm -f $seq.full
+status=0
diff --git a/tests/qemu-iotests/tests/iothreads-resize.out b/tests/qemu-iotests/tests/iothreads-resize.out
new file mode 100644
index 0000000000..2ca5a9d964
--- /dev/null
+++ b/tests/qemu-iotests/tests/iothreads-resize.out
@@ -0,0 +1,11 @@
+QA output created by iothreads-resize
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+QMP_VERSION
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 128 MiB (134217728 bytes)
+*** done
--
2.39.1