All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	vsementsov@virtuozzo.com, Eduardo Habkost <ehabkost@redhat.com>,
	qemu-block@nongnu.org, Markus Armbruster <armbru@redhat.com>,
	Max Reitz <mreitz@redhat.com>,
	pkrempa@redhat.com, Cleber Rosa <crosa@redhat.com>,
	John Snow <jsnow@redhat.com>
Subject: [PATCH 4/6] iotests: add hmp helper with logging
Date: Mon, 24 Feb 2020 19:56:39 -0500	[thread overview]
Message-ID: <20200225005641.5478-5-jsnow@redhat.com> (raw)
In-Reply-To: <20200225005641.5478-1-jsnow@redhat.com>

Just a mild cleanup while I was here.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 tests/qemu-iotests/iotests.py | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 8815052eb5..5d2990a0e4 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -525,23 +525,27 @@ def add_incoming(self, addr):
         self._args.append(addr)
         return self
 
+    def hmp(self, command_line, log=False):
+        cmd = 'human-monitor-command'
+        kwargs = { 'command-line': command_line }
+        if log:
+            return self.qmp_log(cmd, **kwargs)
+        return self.qmp(cmd, **kwargs)
+
     def pause_drive(self, drive, event=None):
         '''Pause drive r/w operations'''
         if not event:
             self.pause_drive(drive, "read_aio")
             self.pause_drive(drive, "write_aio")
             return
-        self.qmp('human-monitor-command',
-                    command_line='qemu-io %s "break %s bp_%s"' % (drive, event, drive))
+        self.hmp('qemu-io %s "break %s bp_%s"' % (drive, event, drive))
 
     def resume_drive(self, drive):
-        self.qmp('human-monitor-command',
-                    command_line='qemu-io %s "remove_break bp_%s"' % (drive, drive))
+        self.hmp('qemu-io %s "remove_break bp_%s"' % (drive, drive))
 
-    def hmp_qemu_io(self, drive, cmd):
+    def hmp_qemu_io(self, drive, cmd, log=False):
         '''Write to a given drive using an HMP command'''
-        return self.qmp('human-monitor-command',
-                        command_line='qemu-io %s "%s"' % (drive, cmd))
+        return self.hmp('qemu-io %s "%s"' % (drive, cmd), log=log)
 
     def flatten_qmp_object(self, obj, output=None, basestr=''):
         if output is None:
-- 
2.21.1



  parent reply	other threads:[~2020-02-25  0:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-25  0:56 [PATCH 0/6] block: add block-dirty-bitmap-populate job John Snow
2020-02-25  0:56 ` [PATCH 1/6] block: add bitmap-populate job John Snow
2020-02-25 16:04   ` Vladimir Sementsov-Ogievskiy
2020-02-25 20:41     ` John Snow
2020-02-26  5:07       ` Vladimir Sementsov-Ogievskiy
2020-02-26 19:11         ` John Snow
2020-02-27  6:11           ` Vladimir Sementsov-Ogievskiy
2020-03-03 21:39             ` John Snow
2020-02-25  0:56 ` [PATCH 2/6] qmp: expose block-dirty-bitmap-populate John Snow
2020-02-27 10:44   ` Vladimir Sementsov-Ogievskiy
2020-03-03 21:48     ` John Snow
2020-02-25  0:56 ` [PATCH 3/6] iotests: move bitmap helpers into their own file John Snow
2020-02-27 10:54   ` Vladimir Sementsov-Ogievskiy
2020-03-03 21:55     ` John Snow
2020-02-25  0:56 ` John Snow [this message]
2020-02-27 10:57   ` [PATCH 4/6] iotests: add hmp helper with logging Vladimir Sementsov-Ogievskiy
2020-02-25  0:56 ` [PATCH 5/6] qmp.py: change event_wait to use a dict John Snow
2020-02-27 11:25   ` Vladimir Sementsov-Ogievskiy
2020-03-03 21:58     ` John Snow
2020-02-25  0:56 ` [PATCH 6/6] iotests: add 287 for block-dirty-bitmap-populate John Snow

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=20200225005641.5478-5-jsnow@redhat.com \
    --to=jsnow@redhat.com \
    --cc=armbru@redhat.com \
    --cc=crosa@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pkrempa@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.