qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, John Snow <jsnow@redhat.com>, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH for-2.6 3/3] iotests: 124: don't reopen qcow2
Date: Tue,  1 Dec 2015 18:16:39 -0500	[thread overview]
Message-ID: <1449011799-2790-4-git-send-email-jsnow@redhat.com> (raw)
In-Reply-To: <1449011799-2790-1-git-send-email-jsnow@redhat.com>

Don't create two interfaces to the same drive in the recently moved
failure test.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 tests/qemu-iotests/124 | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/tests/qemu-iotests/124 b/tests/qemu-iotests/124
index 2a0119d..7d33422 100644
--- a/tests/qemu-iotests/124
+++ b/tests/qemu-iotests/124
@@ -494,6 +494,12 @@ class TestIncrementalBackup(TestIncrementalBackupBase):
 class TestIncrementalBackupBlkdebug(TestIncrementalBackupBase):
     '''Incremental backup tests that utilize a BlkDebug filter on drive0.'''
 
+    def setUp(self):
+        drive0 = self.add_node('drive0')
+        self.img_create(drive0['file'], drive0['fmt'])
+        self.write_default_pattern(drive0['file'])
+        self.vm.launch()
+
     def test_incremental_failure(self):
         '''Test: Verify backups made after a failure are correct.
 
@@ -502,19 +508,15 @@ class TestIncrementalBackupBlkdebug(TestIncrementalBackupBase):
         afterwards and verify that the backup created is correct.
         '''
 
-        # Create a blkdebug interface to this img as 'drive1',
-        # but don't actually create a new image.
-        drive1 = self.add_node('drive1', self.drives[0]['fmt'],
-                               path=self.drives[0]['file'],
-                               backup=self.drives[0]['backup'])
+        drive0 = self.drives[0]
         result = self.vm.qmp('blockdev-add', options={
-            'id': drive1['id'],
-            'driver': drive1['fmt'],
+            'id': drive0['id'],
+            'driver': drive0['fmt'],
             'file': {
                 'driver': 'blkdebug',
                 'image': {
                     'driver': 'file',
-                    'filename': drive1['file']
+                    'filename': drive0['file']
                 },
                 'set-state': [{
                     'event': 'flush_to_disk',
@@ -532,18 +534,18 @@ class TestIncrementalBackupBlkdebug(TestIncrementalBackupBase):
         })
         self.assert_qmp(result, 'return', {})
 
-        self.create_anchor_backup(self.drives[0])
-        self.add_bitmap('bitmap0', drive1)
+        self.create_anchor_backup(drive0)
+        self.add_bitmap('bitmap0', drive0)
         # Note: at this point, during a normal execution,
         # Assume that the VM resumes and begins issuing IO requests here.
 
-        self.hmp_io_writes(drive1['id'], (('0xab', 0, 512),
+        self.hmp_io_writes(drive0['id'], (('0xab', 0, 512),
                                           ('0xfe', '16M', '256k'),
                                           ('0x64', '32736k', '64k')))
 
         result = self.create_incremental(validate=False)
         self.assertFalse(result)
-        self.hmp_io_writes(drive1['id'], (('0x9a', 0, 512),
+        self.hmp_io_writes(drive0['id'], (('0x9a', 0, 512),
                                           ('0x55', '8M', '352k'),
                                           ('0x78', '15872k', '1M')))
         self.create_incremental()
-- 
2.4.3

  parent reply	other threads:[~2015-12-01 23:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01 23:16 [Qemu-devel] [PATCH for-2.6 0/3] iotests: 124: Don't reopen qcow2 file John Snow
2015-12-01 23:16 ` [Qemu-devel] [PATCH for-2.6 1/3] iotests: 124: Split into two test classes John Snow
2015-12-01 23:16 ` [Qemu-devel] [PATCH for-2.6 2/3] iotests: 124: move incremental failure test John Snow
2015-12-01 23:16 ` John Snow [this message]
2015-12-02 12:43 ` [Qemu-devel] [PATCH for-2.6 0/3] iotests: 124: Don't reopen qcow2 file Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1449011799-2790-4-git-send-email-jsnow@redhat.com \
    --to=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).