summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/migration/stress.c34
-rw-r--r--tests/plugin/Makefile2
-rwxr-xr-xtests/qemu-iotests/0412
-rwxr-xr-xtests/qemu-iotests/1187
-rw-r--r--tests/qemu-iotests/172.out532
-rwxr-xr-xtests/qemu-iotests/1902
-rwxr-xr-xtests/qemu-iotests/2293
-rwxr-xr-xtests/qemu-iotests/2912
-rwxr-xr-xtests/qemu-iotests/2925
-rw-r--r--tests/qemu-iotests/iotests.py16
-rwxr-xr-xtests/qemu-iotests/qcow2.py2
-rw-r--r--tests/qemu-iotests/qcow2_format.py1
12 files changed, 310 insertions, 298 deletions
diff --git a/tests/migration/stress.c b/tests/migration/stress.c
index 0c23964693..a062ef6b55 100644
--- a/tests/migration/stress.c
+++ b/tests/migration/stress.c
@@ -167,29 +167,17 @@ static unsigned long long now(void)
return (tv.tv_sec * 1000ull) + (tv.tv_usec / 1000ull);
}
-static int stressone(unsigned long long ramsizeMB)
+static void stressone(unsigned long long ramsizeMB)
{
size_t pagesPerMB = 1024 * 1024 / PAGE_SIZE;
- char *ram = malloc(ramsizeMB * 1024 * 1024);
+ g_autofree char *ram = g_malloc(ramsizeMB * 1024 * 1024);
char *ramptr;
size_t i, j, k;
- char *data = malloc(PAGE_SIZE);
+ g_autofree char *data = g_malloc(PAGE_SIZE);
char *dataptr;
size_t nMB = 0;
unsigned long long before, after;
- if (!ram) {
- fprintf(stderr, "%s (%05d): ERROR: cannot allocate %llu MB of RAM: %s\n",
- argv0, gettid(), ramsizeMB, strerror(errno));
- return -1;
- }
- if (!data) {
- fprintf(stderr, "%s (%d): ERROR: cannot allocate %d bytes of RAM: %s\n",
- argv0, gettid(), PAGE_SIZE, strerror(errno));
- free(ram);
- return -1;
- }
-
/* We don't care about initial state, but we do want
* to fault it all into RAM, otherwise the first iter
* of the loop below will be quite slow. We can't use
@@ -198,9 +186,7 @@ static int stressone(unsigned long long ramsizeMB)
memset(ram, 0xfe, ramsizeMB * 1024 * 1024);
if (random_bytes(data, PAGE_SIZE) < 0) {
- free(ram);
- free(data);
- return -1;
+ return;
}
before = now();
@@ -227,9 +213,6 @@ static int stressone(unsigned long long ramsizeMB)
}
}
}
-
- free(data);
- free(ram);
}
@@ -242,7 +225,7 @@ static void *stressthread(void *arg)
return NULL;
}
-static int stress(unsigned long long ramsizeGB, int ncpus)
+static void stress(unsigned long long ramsizeGB, int ncpus)
{
size_t i;
unsigned long long ramsizeMB = ramsizeGB * 1024 / ncpus;
@@ -255,8 +238,6 @@ static int stress(unsigned long long ramsizeGB, int ncpus)
}
stressone(ramsizeMB);
-
- return 0;
}
@@ -352,8 +333,7 @@ int main(int argc, char **argv)
fprintf(stdout, "%s (%05d): INFO: RAM %llu GiB across %d CPUs\n",
argv0, gettid(), ramsizeGB, ncpus);
- if (stress(ramsizeGB, ncpus) < 0)
- exit_failure();
+ stress(ramsizeGB, ncpus);
- exit_success();
+ exit_failure();
}
diff --git a/tests/plugin/Makefile b/tests/plugin/Makefile
index b3250e2504..3a50451428 100644
--- a/tests/plugin/Makefile
+++ b/tests/plugin/Makefile
@@ -17,7 +17,7 @@ NAMES += lockstep
SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))
-QEMU_CFLAGS += -fPIC
+QEMU_CFLAGS += -fPIC -Wpsabi
QEMU_CFLAGS += -I$(SRC_PATH)/include/qemu
all: $(SONAMES)
diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
index 601c756117..b843f88a66 100755
--- a/tests/qemu-iotests/041
+++ b/tests/qemu-iotests/041
@@ -277,6 +277,8 @@ class TestSingleBlockdev(TestSingleDrive):
result = self.vm.run_job('job0')
self.assertEqual(result, 'Source and target image have different sizes')
+ # qed does not support shrinking
+ @iotests.skip_for_formats(('qed'))
def test_small_target(self):
self.do_test_target_size(self.image_len // 2)
diff --git a/tests/qemu-iotests/118 b/tests/qemu-iotests/118
index adc8a848b5..2350929fd8 100755
--- a/tests/qemu-iotests/118
+++ b/tests/qemu-iotests/118
@@ -683,11 +683,10 @@ class TestBlockJobsAfterCycle(ChangeBaseClass):
except OSError:
pass
+ # We need backing file support
+ @iotests.skip_for_formats(('vpc', 'parallels', 'qcow', 'vdi', 'vmdk', 'raw',
+ 'vhdx'))
def test_snapshot_and_commit(self):
- # We need backing file support
- if iotests.imgfmt != 'qcow2' and iotests.imgfmt != 'qed':
- return
-
result = self.vm.qmp('blockdev-snapshot-sync', device='drive0',
snapshot_file=new_img,
format=iotests.imgfmt)
diff --git a/tests/qemu-iotests/172.out b/tests/qemu-iotests/172.out
index 7abbe82427..e782c5957e 100644
--- a/tests/qemu-iotests/172.out
+++ b/tests/qemu-iotests/172.out
@@ -24,11 +24,11 @@ Testing:
dev: floppy, id ""
unit = 0 (0x0)
drive = "floppy0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "288"
@@ -54,11 +54,11 @@ Testing: -fda TEST_DIR/t.qcow2
dev: floppy, id ""
unit = 0 (0x0)
drive = "floppy0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -81,22 +81,22 @@ Testing: -fdb TEST_DIR/t.qcow2
dev: floppy, id ""
unit = 1 (0x1)
drive = "floppy1"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
dev: floppy, id ""
unit = 0 (0x0)
drive = "floppy0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "288"
@@ -119,22 +119,22 @@ Testing: -fda TEST_DIR/t.qcow2 -fdb TEST_DIR/t.qcow2.2
dev: floppy, id ""
unit = 1 (0x1)
drive = "floppy1"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
dev: floppy, id ""
unit = 0 (0x0)
drive = "floppy0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -160,11 +160,11 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2
dev: floppy, id ""
unit = 0 (0x0)
drive = "floppy0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -187,22 +187,22 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2,index=1
dev: floppy, id ""
unit = 1 (0x1)
drive = "floppy1"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
dev: floppy, id ""
unit = 0 (0x0)
drive = "floppy0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "288"
@@ -225,22 +225,22 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=floppy,file=TEST_DIR/t
dev: floppy, id ""
unit = 1 (0x1)
drive = "floppy1"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
dev: floppy, id ""
unit = 0 (0x0)
drive = "floppy0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -266,11 +266,11 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -global isa-fdc.driveA=none0
dev: floppy, id ""
unit = 0 (0x0)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -293,11 +293,11 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -global isa-fdc.driveB=none0
dev: floppy, id ""
unit = 1 (0x1)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -320,22 +320,22 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qco
dev: floppy, id ""
unit = 1 (0x1)
drive = "none1"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
dev: floppy, id ""
unit = 0 (0x0)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -361,11 +361,11 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0
dev: floppy, id ""
unit = 0 (0x0)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -388,11 +388,11 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,unit=1
dev: floppy, id ""
unit = 1 (0x1)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -415,22 +415,22 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qco
dev: floppy, id ""
unit = 1 (0x1)
drive = "none1"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
dev: floppy, id ""
unit = 0 (0x0)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -456,22 +456,22 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -global is
dev: floppy, id ""
unit = 1 (0x1)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
dev: floppy, id ""
unit = 0 (0x0)
drive = "floppy0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -494,22 +494,22 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -global is
dev: floppy, id ""
unit = 1 (0x1)
drive = "floppy1"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
dev: floppy, id ""
unit = 0 (0x0)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -532,11 +532,11 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -global is
dev: floppy, id ""
unit = 0 (0x0)
drive = "floppy0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -559,11 +559,11 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -global is
dev: floppy, id ""
unit = 1 (0x1)
drive = "floppy1"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -589,22 +589,22 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
dev: floppy, id ""
unit = 1 (0x1)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
dev: floppy, id ""
unit = 0 (0x0)
drive = "floppy0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -627,22 +627,22 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
dev: floppy, id ""
unit = 1 (0x1)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
dev: floppy, id ""
unit = 0 (0x0)
drive = "floppy0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -665,22 +665,22 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
dev: floppy, id ""
unit = 0 (0x0)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
dev: floppy, id ""
unit = 1 (0x1)
drive = "floppy1"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -703,22 +703,22 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
dev: floppy, id ""
unit = 0 (0x0)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
dev: floppy, id ""
unit = 1 (0x1)
drive = "floppy1"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -750,22 +750,22 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.q
dev: floppy, id ""
unit = 1 (0x1)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
dev: floppy, id ""
unit = 0 (0x0)
drive = "floppy0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -788,22 +788,22 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.q
dev: floppy, id ""
unit = 1 (0x1)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
dev: floppy, id ""
unit = 0 (0x0)
drive = "floppy0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -832,22 +832,22 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qco
dev: floppy, id ""
unit = 1 (0x1)
drive = "none1"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
dev: floppy, id ""
unit = 0 (0x0)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -870,22 +870,22 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qco
dev: floppy, id ""
unit = 1 (0x1)
drive = "none1"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
dev: floppy, id ""
unit = 0 (0x0)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -908,22 +908,22 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qco
dev: floppy, id ""
unit = 0 (0x0)
drive = "none1"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
dev: floppy, id ""
unit = 1 (0x1)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -946,22 +946,22 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qco
dev: floppy, id ""
unit = 0 (0x0)
drive = "none1"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
dev: floppy, id ""
unit = 1 (0x1)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -999,11 +999,11 @@ Testing: -device floppy
dev: floppy, id ""
unit = 0 (0x0)
drive = ""
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "288"
@@ -1026,11 +1026,11 @@ Testing: -device floppy,drive-type=120
dev: floppy, id ""
unit = 0 (0x0)
drive = ""
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "120"
@@ -1053,11 +1053,11 @@ Testing: -device floppy,drive-type=144
dev: floppy, id ""
unit = 0 (0x0)
drive = ""
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -1080,11 +1080,11 @@ Testing: -device floppy,drive-type=288
dev: floppy, id ""
unit = 0 (0x0)
drive = ""
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "288"
@@ -1110,11 +1110,11 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,drive-t
dev: floppy, id ""
unit = 0 (0x0)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "120"
@@ -1137,11 +1137,11 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,drive-t
dev: floppy, id ""
unit = 0 (0x0)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "288"
@@ -1167,11 +1167,11 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,logical
dev: floppy, id ""
unit = 0 (0x0)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
@@ -1194,17 +1194,17 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,physica
dev: floppy, id ""
unit = 0 (0x0)
drive = "none0"
- logical_block_size = 512 (0x200)
- physical_block_size = 512 (0x200)
- min_io_size = 0 (0x0)
- opt_io_size = 0 (0x0)
- discard_granularity = 4294967295 (0xffffffff)
+ logical_block_size = 512 (512 B)
+ physical_block_size = 512 (512 B)
+ min_io_size = 0 (0 B)
+ opt_io_size = 0 (0 B)
+ discard_granularity = 4294967295 (4 GiB)
write-cache = "auto"
share-rw = false
drive-type = "144"
Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,logical_block_size=4096
-QEMU_PROG: -device floppy,drive=none0,logical_block_size=4096: Physical and logical block size must be 512 for floppy
+QEMU_PROG: -device floppy,drive=none0,logical_block_size=4096: logical_block_size > physical_block_size not supported
Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,physical_block_size=1024
QEMU_PROG: -device floppy,drive=none0,physical_block_size=1024: Physical and logical block size must be 512 for floppy
diff --git a/tests/qemu-iotests/190 b/tests/qemu-iotests/190
index fe630918e9..c22d8d64f9 100755
--- a/tests/qemu-iotests/190
+++ b/tests/qemu-iotests/190
@@ -41,6 +41,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
# See 178 for more extensive tests across more formats
_supported_fmt qcow2
_supported_proto file
+# compat=0.10 does not support bitmaps
+_unsupported_imgopts 'compat=0.10'
echo "== Huge file without bitmaps =="
echo
diff --git a/tests/qemu-iotests/229 b/tests/qemu-iotests/229
index 99acb55ebb..89a5359f32 100755
--- a/tests/qemu-iotests/229
+++ b/tests/qemu-iotests/229
@@ -46,6 +46,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_supported_fmt qcow2 qed
_supported_proto file
_supported_os Linux
+# blkdebug can only inject errors on bs->file, so external data files
+# do not work with this test
+_unsupported_imgopts data_file
DEST_IMG="$TEST_DIR/d.$IMGFMT"
diff --git a/tests/qemu-iotests/291 b/tests/qemu-iotests/291
index 404f8521f7..28e4fb9b4d 100755
--- a/tests/qemu-iotests/291
+++ b/tests/qemu-iotests/291
@@ -39,6 +39,8 @@ _supported_fmt qcow2
_supported_proto file
_supported_os Linux
_require_command QEMU_NBD
+# compat=0.10 does not support bitmaps
+_unsupported_imgopts 'compat=0.10'
echo
echo "=== Initial image setup ==="
diff --git a/tests/qemu-iotests/292 b/tests/qemu-iotests/292
index a2de27cca4..83ab19231d 100755
--- a/tests/qemu-iotests/292
+++ b/tests/qemu-iotests/292
@@ -40,6 +40,11 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_supported_fmt qcow2
_supported_proto file
_supported_os Linux
+# We need qemu-img map to show the file where the data is allocated,
+# but with an external data file, it will show that instead of the
+# file we want to check. So just skip this test for external data
+# files.
+_unsupported_imgopts data_file
echo '### Create the backing image'
BACKING_IMG="$TEST_IMG.base"
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index f20d90f969..5ea4c4df8b 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -1103,6 +1103,22 @@ def skip_if_unsupported(required_formats=(), read_only=False):
return func_wrapper
return skip_test_decorator
+def skip_for_formats(formats: Sequence[str] = ()) \
+ -> Callable[[Callable[[QMPTestCase, List[Any], Dict[str, Any]], None]],
+ Callable[[QMPTestCase, List[Any], Dict[str, Any]], None]]:
+ '''Skip Test Decorator
+ Skips the test for the given formats'''
+ def skip_test_decorator(func):
+ def func_wrapper(test_case: QMPTestCase, *args: List[Any],
+ **kwargs: Dict[str, Any]) -> None:
+ if imgfmt in formats:
+ msg = f'{test_case}: Skipped for format {imgfmt}'
+ test_case.case_skip(msg)
+ else:
+ func(test_case, *args, **kwargs)
+ return func_wrapper
+ return skip_test_decorator
+
def skip_if_user_is_root(func):
'''Skip Test Decorator
Runs the test only without root permissions'''
diff --git a/tests/qemu-iotests/qcow2.py b/tests/qemu-iotests/qcow2.py
index 8c187e9a72..0910e6ac07 100755
--- a/tests/qemu-iotests/qcow2.py
+++ b/tests/qemu-iotests/qcow2.py
@@ -2,6 +2,8 @@
#
# Manipulations with qcow2 image
#
+# Copyright (C) 2012 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
diff --git a/tests/qemu-iotests/qcow2_format.py b/tests/qemu-iotests/qcow2_format.py
index 0f65fd161d..cc432e7ae0 100644
--- a/tests/qemu-iotests/qcow2_format.py
+++ b/tests/qemu-iotests/qcow2_format.py
@@ -1,6 +1,7 @@
# Library for manipulations with qcow2 image
#
# Copyright (c) 2020 Virtuozzo International GmbH.
+# Copyright (C) 2012 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