mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1 iQEcBAABAgAGBQJWX8xEAAoJEJykq7OBq3PIY+YH/0fhpy2S0G2LtfjYX3522Q81 3SsIC+4934+SkGLkQflnNsy8HPKvqQndkV+5FEqbzUTwJ1kjixyKapfpLyA0tvbm +uxvC1Mn91nVfqlfh3zwGOqprcEwPvXtfIyeOlfeq+6m72fDLWUakIwzAfNGWeV8 REc3j2yTEw2esRPKau5kP1q3taN7w6UvIx9I8g1/cbnq89ca0ici/+AhBz/XGGb1 gTlxtBoVWfH+k0kO2rqhZt+RLi7u22cmtPOywOTuqIt3HEYgFdaaf6S0UcZ+mgno CNf0hhbHuMhBCgWvXcGXDssFrI2GoSl8hEuTBbLHyOSFSHZ8pfRLFmoFuZzXW0c= =TtA6 -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging # gpg: Signature made Thu 03 Dec 2015 04:59:48 GMT using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" * remotes/stefanha/tags/block-pull-request: iotests: Add regresion test case for write notifier assertion failure iotests: Add "add_drive_raw" method block: Don't wait serialising for non-COR read requests iothread: include id in thread name Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
efdeb96c5a
8 changed files with 49 additions and 12 deletions
|
@ -82,6 +82,31 @@ class TestSyncModesNoneAndTop(iotests.QMPTestCase):
|
|||
time.sleep(1)
|
||||
self.assertEqual(-1, qemu_io('-c', 'read -P0x41 0 512', target_img).find("verification failed"))
|
||||
|
||||
class TestBeforeWriteNotifier(iotests.QMPTestCase):
|
||||
def setUp(self):
|
||||
self.vm = iotests.VM().add_drive_raw("file=blkdebug::null-co://,id=drive0,align=65536,driver=blkdebug")
|
||||
self.vm.launch()
|
||||
|
||||
def tearDown(self):
|
||||
self.vm.shutdown()
|
||||
os.remove(target_img)
|
||||
|
||||
def test_before_write_notifier(self):
|
||||
self.vm.pause_drive("drive0")
|
||||
result = self.vm.qmp('drive-backup', device='drive0',
|
||||
sync='full', target=target_img,
|
||||
format="file", speed=1)
|
||||
self.assert_qmp(result, 'return', {})
|
||||
result = self.vm.qmp('block-job-pause', device="drive0")
|
||||
self.assert_qmp(result, 'return', {})
|
||||
# Speed is low enough that this must be an uncopied range, which will
|
||||
# trigger the before write notifier
|
||||
self.vm.hmp_qemu_io('drive0', 'aio_write -P 1 512512 512')
|
||||
self.vm.resume_drive("drive0")
|
||||
result = self.vm.qmp('block-job-resume', device="drive0")
|
||||
self.assert_qmp(result, 'return', {})
|
||||
event = self.cancel_and_wait()
|
||||
self.assert_qmp(event, 'data/type', 'backup')
|
||||
|
||||
if __name__ == '__main__':
|
||||
iotests.main(supported_fmts=['qcow2', 'qed'])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
..
|
||||
...
|
||||
----------------------------------------------------------------------
|
||||
Ran 2 tests
|
||||
Ran 3 tests
|
||||
|
||||
OK
|
||||
|
|
|
@ -140,6 +140,11 @@ class VM(object):
|
|||
self._args.append('-monitor')
|
||||
self._args.append(args)
|
||||
|
||||
def add_drive_raw(self, opts):
|
||||
self._args.append('-drive')
|
||||
self._args.append(opts)
|
||||
return self
|
||||
|
||||
def add_drive(self, path, opts='', interface='virtio'):
|
||||
'''Add a virtio-blk drive to the VM'''
|
||||
options = ['if=%s' % interface,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue