iotests: drop unnecessary accel=kvm
PATCH 1/1 iotests: drop unnecessary accel=kvm
Tests 235 and 238 do not require the kvm accelerator. TCG works fine.
Use the default accelerator instead of requiring kvm.
--- tests/qemu-iotests/235 | 1 - tests/qemu-iotests/238 | 1 - 2 files changed, 2 deletions(-)
tests/qemu-iotests/235 +0 -1
@@ -49,7 +49,6 @@ qemu_img_create('-f', iotests.imgfmt, '-o', 'preallocation=metadata', disk, str(size)) vm = QEMUMachine(iotests.qemu_prog) -vm.add_args('-machine', 'accel=kvm') if iotests.qemu_default_machine == 's390-ccw-virtio': vm.add_args('-no-shutdown') vm.add_args('-drive', 'id=src,file=' + disk)
tests/qemu-iotests/238 +0 -1
@@ -33,7 +33,6 @@ else: virtio_scsi_device = 'virtio-scsi-pci' vm = QEMUMachine(iotests.qemu_prog) -vm.add_args('-machine', 'accel=kvm') vm.launch() log(vm.qmp('blockdev-add', node_name='hd0', driver='null-co'))
Signature · 1 line
2.20.1
Quoted 16 lines · Stefan Hajnoczi
Tests 235 and 238 do not require the kvm accelerator. TCG works fine.
Use the default accelerator instead of requiring kvm.
Suggested-by Thomas Huth <[email protected]>Signed-off-by Stefan Hajnoczi <[email protected]>--- tests/qemu-iotests/235 | 1 - tests/qemu-iotests/238 | 1 - 2 files changed, 2 deletions(-)tests/qemu-iotests/235 +0
-0
tests/qemu-iotests/235 qemu_img_create('-f', iotests.imgfmt, '-o', 'preallocation=metadata', disk, · line 52
Quoted 4 lines
tests/qemu-iotests/235 +0
-1@@ -49,7 +49,6 @@ qemu_img_create('-f', iotests.imgfmt, '-o', 'preallocation=metadata', disk, str(size)) vm = QEMUMachine(iotests.qemu_prog) -vm.add_args('-machine', 'accel=kvm')
According to the initial commit log of 235:
"iotests: simple mirror test with kvm on 1G image"
... so I assume KVM was used on purpose here?
Thomas
Quoted 24 lines · Thomas Huth
Quoted 16 lines · Stefan Hajnoczi
Tests 235 and 238 do not require the kvm accelerator. TCG works fine.
Use the default accelerator instead of requiring kvm.
Suggested-by Thomas Huth <[email protected]>Signed-off-by Stefan Hajnoczi <[email protected]>--- tests/qemu-iotests/235 | 1 - tests/qemu-iotests/238 | 1 - 2 files changed, 2 deletions(-)tests/qemu-iotests/235 +0
-0tests/qemu-iotests/235 qemu_img_create('-f', iotests.imgfmt, '-o', 'preallocation=metadata', disk, · line 52
Quoted 4 lines
tests/qemu-iotests/235 +0
-1@@ -49,7 +49,6 @@ qemu_img_create('-f', iotests.imgfmt, '-o', 'preallocation=metadata', disk, str(size)) vm = QEMUMachine(iotests.qemu_prog) -vm.add_args('-machine', 'accel=kvm')According to the initial commit log of 235:
Quoted 6 lines
"iotests: simple mirror test with kvm on 1G image"
... so I assume KVM was used on purpose here?
Thomas
As I remember kvm is not really necessary, and test have a comment about it:
# And it didn't reproduce if at least one of the following:
...
# 3. drop kvm and use iotests.VM() (maybe, because of qtest) (however, it still
# reproduces, if just drop kvm, but gdb failed to produce full backtraces
# for me)
But the comment should be updated with this patch.
Signature · 2 lines
Best regards, Vladimir
Quoted 32 lines · Vladimir Sementsov-Ogievskiy
Quoted 24 lines · Thomas Huth
Quoted 16 lines · Stefan Hajnoczi
Tests 235 and 238 do not require the kvm accelerator. TCG works fine.
Use the default accelerator instead of requiring kvm.
Suggested-by Thomas Huth <[email protected]>Signed-off-by Stefan Hajnoczi <[email protected]>--- tests/qemu-iotests/235 | 1 - tests/qemu-iotests/238 | 1 - 2 files changed, 2 deletions(-)tests/qemu-iotests/235 +0
-0tests/qemu-iotests/235 qemu_img_create('-f', iotests.imgfmt, '-o', 'preallocation=metadata', disk, · line 52
Quoted 4 lines
tests/qemu-iotests/235 +0
-1@@ -49,7 +49,6 @@ qemu_img_create('-f', iotests.imgfmt, '-o', 'preallocation=metadata', disk, str(size)) vm = QEMUMachine(iotests.qemu_prog) -vm.add_args('-machine', 'accel=kvm')According to the initial commit log of 235:
Quoted 6 lines
"iotests: simple mirror test with kvm on 1G image"
... so I assume KVM was used on purpose here?
Thomas
Quoted 8 lines
As I remember kvm is not really necessary, and test have a comment about it:
# And it didn't reproduce if at least one of the following:
...
# 3. drop kvm and useiotests.VM()(maybe, because of qtest) (however, it still
# reproduces, if just drop kvm, but gdb failed to produce full backtraces
# for me)But the comment should be updated with this patch.
Will fix in v2.
Stefan
Quoted 41 lines · Stefan Hajnoczi
Quoted 39 lines · Vladimir Sementsov-Ogievskiy
Quoted 24 lines · Thomas Huth
Quoted 16 lines · Stefan Hajnoczi
Tests 235 and 238 do not require the kvm accelerator. TCG works fine.
Use the default accelerator instead of requiring kvm.
Suggested-by Thomas Huth <[email protected]>Signed-off-by Stefan Hajnoczi <[email protected]>--- tests/qemu-iotests/235 | 1 - tests/qemu-iotests/238 | 1 - 2 files changed, 2 deletions(-)tests/qemu-iotests/235 +0
-0tests/qemu-iotests/235 qemu_img_create('-f', iotests.imgfmt, '-o', 'preallocation=metadata', disk, · line 52
Quoted 4 lines
tests/qemu-iotests/235 +0
-1@@ -49,7 +49,6 @@ qemu_img_create('-f', iotests.imgfmt, '-o', 'preallocation=metadata', disk, str(size)) vm = QEMUMachine(iotests.qemu_prog) -vm.add_args('-machine', 'accel=kvm')According to the initial commit log of 235:
Quoted 6 lines
"iotests: simple mirror test with kvm on 1G image"
... so I assume KVM was used on purpose here?
Thomas
As I remember kvm is not really necessary, and test have a comment about it:
# And it didn't reproduce if at least one of the following:
...
# 3. drop kvm and useiotests.VM()(maybe, because of qtest) (however, it still
# reproduces, if just drop kvm, but gdb failed to produce full backtraces
# for me)
Quoted 3 lines
Quoted 1 line
But the comment should be updated with this patch.
Will fix in v2.
Any chance that you could even make it somehow work with -M accel=qtest instead? ... in case someone compiled their QEMU with --disable-tcg, too ...?
Thomas
Quoted 42 lines · Thomas Huth
Quoted 41 lines · Stefan Hajnoczi
Quoted 39 lines · Vladimir Sementsov-Ogievskiy
Quoted 24 lines · Thomas Huth
Quoted 16 lines · Stefan Hajnoczi
Tests 235 and 238 do not require the kvm accelerator. TCG works fine.
Use the default accelerator instead of requiring kvm.
Suggested-by Thomas Huth <[email protected]>Signed-off-by Stefan Hajnoczi <[email protected]>--- tests/qemu-iotests/235 | 1 - tests/qemu-iotests/238 | 1 - 2 files changed, 2 deletions(-)tests/qemu-iotests/235 +0
-0tests/qemu-iotests/235 qemu_img_create('-f', iotests.imgfmt, '-o', 'preallocation=metadata', disk, · line 52
Quoted 4 lines
tests/qemu-iotests/235 +0
-1@@ -49,7 +49,6 @@ qemu_img_create('-f', iotests.imgfmt, '-o', 'preallocation=metadata', disk, str(size)) vm = QEMUMachine(iotests.qemu_prog) -vm.add_args('-machine', 'accel=kvm')According to the initial commit log of 235:
Quoted 6 lines
"iotests: simple mirror test with kvm on 1G image"
... so I assume KVM was used on purpose here?
Thomas
As I remember kvm is not really necessary, and test have a comment about it:
# And it didn't reproduce if at least one of the following:
...
# 3. drop kvm and useiotests.VM()(maybe, because of qtest) (however, it still
# reproduces, if just drop kvm, but gdb failed to produce full backtraces
# for me)
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
But the comment should be updated with this patch.
Will fix in v2.
Any chance that you could even make it somehow work with -M accel=qtest instead? ... in case someone compiled their QEMU with --disable-tcg, too ...?
I didn't investigate why bug not reproduced with qtest.. I think, the simplest option should be a helper like iotests.needs_tcg(), to skip the test if it is unsupported.
Or you case is that kvm is OK for you but tcg is not? Stefan, do you have strong reason for removing kvm from iotests? Could it be something like
if not iotests.supports_tcg():
vm.add_args('-machine', 'accel=kvm')?
Hmm, maybe, good option would be topmost option, like we have for format -qcow2, -raw, etc. So, it would be -qtest, -kvm, -tcg.. But in this case nobody will run all test on something other than qtest..
It's not bad to run this test on qtest. The problem is we can miss the bug, if not run this test on kvm or tcg.
Signature · 2 lines
Best regards, Vladimir
Quoted 52 lines · Vladimir Sementsov-Ogievskiy
Quoted 39 lines · Thomas Huth
Quoted 38 lines · Stefan Hajnoczi
Quoted 36 lines · Vladimir Sementsov-Ogievskiy
Quoted 19 lines · Thomas Huth
Quoted 18 lines · Stefan Hajnoczi
Tests 235 and 238 do not require the kvm accelerator. TCG works fine.
Use the default accelerator instead of requiring kvm.
Suggested-by Thomas Huth <[email protected]>Signed-off-by Stefan Hajnoczi <[email protected]>--- tests/qemu-iotests/235 | 1 - tests/qemu-iotests/238 | 1 - 2 files changed, 2 deletions(-)tests/qemu-iotests/235 +0
-0@@ -49,7 +49,6 @@ qemu_img_create('-f', iotests.imgfmt, '-o', 'preallocation=metadata', disk, str(size))Quoted 8 lines
tests/qemu-iotests/235 qemu_img_create('-f', iotests.imgfmt, '-o', 'preallocation=metadata', disk, · line 52
Quoted 2 lines
tests/qemu-iotests/235 +0
-1vm = QEMUMachine(iotests.qemu_prog) -vm.add_args('-machine', 'accel=kvm')According to the initial commit log of 235:
"iotests: simple mirror test with kvm on 1G image"
... so I assume KVM was used on purpose here?
As I remember kvm is not really necessary, and test have a comment about it:
# And it didn't reproduce if at least one of the following:
...
# 3. drop kvm and useiotests.VM()(maybe, because of qtest) (however, it still
# reproduces, if just drop kvm, but gdb failed to produce full backtraces
# for me)Quoted 7 lines
Quoted 3 lines
Quoted 1 line
But the comment should be updated with this patch.
Will fix in v2.
Any chance that you could even make it somehow work with -M accel=qtest instead? ... in case someone compiled their QEMU with --disable-tcg, too ...?
I didn't investigate why bug not reproduced with qtest.. I think, the simplest option should be a helper like
iotests.needs_tcg(), to skip the test if it is unsupported.
Quoted 7 lines
Or you case is that kvm is OK for you but tcg is not? Stefan, do you have strong reason for removing kvm from iotests? Could it be something like
if not
iotests.supports_tcg():vm.add_args('-machine', 'accel=kvm')?
You can also use "accel=kvm:tcg" which tries to use kvm first and then falls back to tcg if KVM is not available.
I just have this weird condition where I try to compile qemu with --disable-tcg, and then run the iotests on a CI system where KVM is also not available at runtime. So qtest is the only available accelerator there...
Thomas