aboutsummaryrefslogtreecommitdiff
path: root/scripts/qtest.py
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-02-01 17:58:27 +0000
committerPeter Maydell <peter.maydell@linaro.org>2019-02-01 17:58:27 +0000
commitb3fc0af1ff5e922d4dd7c875394dbd26dc7313b4 (patch)
tree2c59c91e8112e0be05a43543f7d11394f2d52653 /scripts/qtest.py
parente83d74286cad2b9b967e1ba0ce5c8d16cba9679f (diff)
parent7471a649fc3a391dd497297013fb2525ca9821ba (diff)
downloadqemu-b3fc0af1ff5e922d4dd7c875394dbd26dc7313b4.zip
qemu-b3fc0af1ff5e922d4dd7c875394dbd26dc7313b4.tar.gz
qemu-b3fc0af1ff5e922d4dd7c875394dbd26dc7313b4.tar.bz2
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Block layer patches: - vmdk: Support for blockdev-create - block: Apply auto-read-only for ro-whitelist drivers - virtio-scsi: Fixes related to attaching/detaching iothreads - scsi-disk: Fixed erroneously detected multipath setup with multiple disks created with node-names. Added device_id property. - block: Fix hangs in synchronous APIs with iothreads - block: Fix invalidate_cache error path for parent activation - block-backend, mirror, qcow2, vpc, vdi, qemu-iotests: Minor fixes and code improvements # gpg: Signature made Fri 01 Feb 2019 15:23:10 GMT # gpg: using RSA key 7F09B272C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full] # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6 * remotes/kevin/tags/for-upstream: (27 commits) scsi-disk: Add device_id property scsi-disk: Don't use empty string as device id qtest.py: Wait for the result of qtest commands block: Fix invalidate_cache error path for parent activation iotests/236: fix transaction kwarg order iotests: Filter second BLOCK_JOB_ERROR from 229 virtio-scsi: Forbid devices with different iothreads sharing a blockdev scsi-disk: Acquire the AioContext in scsi_*_realize() virtio-scsi: Move BlockBackend back to the main AioContext on unplug block: Eliminate the S_1KiB, S_2KiB, ... macros block: Remove blk_attach_dev_legacy() / legacy_dev code block: Apply auto-read-only for ro-whitelist drivers uuid: Make qemu_uuid_bswap() take and return a QemuUUID block/vdi: Don't take address of fields in packed structs block/vpc: Don't take address of fields in packed structs vmdk: Reject excess extents in blockdev-create iotests: Add VMDK tests for blockdev-create iotests: Filter cid numbers in VMDK extent info vmdk: Implement .bdrv_co_create callback vmdk: Refactor vmdk_create_extent ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts/qtest.py')
-rw-r--r--scripts/qtest.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/qtest.py b/scripts/qtest.py
index adf1fe3..afac3fe 100644
--- a/scripts/qtest.py
+++ b/scripts/qtest.py
@@ -31,6 +31,7 @@ class QEMUQtestProtocol(object):
"""
self._address = address
self._sock = self._get_sock()
+ self._sockfile = None
if server:
self._sock.bind(self._address)
self._sock.listen(1)
@@ -49,6 +50,7 @@ class QEMUQtestProtocol(object):
@raise socket.error on socket connection errors
"""
self._sock.connect(self._address)
+ self._sockfile = self._sock.makefile()
def accept(self):
"""
@@ -57,6 +59,7 @@ class QEMUQtestProtocol(object):
@raise socket.error on socket connection errors
"""
self._sock, _ = self._sock.accept()
+ self._sockfile = self._sock.makefile()
def cmd(self, qtest_cmd):
"""
@@ -65,9 +68,12 @@ class QEMUQtestProtocol(object):
@param qtest_cmd: qtest command text to be sent
"""
self._sock.sendall((qtest_cmd + "\n").encode('utf-8'))
+ resp = self._sockfile.readline()
+ return resp
def close(self):
self._sock.close()
+ self._sockfile.close()
def settimeout(self, timeout):
self._sock.settimeout(timeout)