|
@@ -212,12 +212,18 @@ def get_virtio_scsi_device():
|
|
|
|
|
|
class QemuIoInteractive:
|
|
class QemuIoInteractive:
|
|
def __init__(self, *args):
|
|
def __init__(self, *args):
|
|
- self.args = qemu_io_args + list(args)
|
|
|
|
|
|
+ self.args = qemu_io_args_no_fmt + list(args)
|
|
self._p = subprocess.Popen(self.args, stdin=subprocess.PIPE,
|
|
self._p = subprocess.Popen(self.args, stdin=subprocess.PIPE,
|
|
stdout=subprocess.PIPE,
|
|
stdout=subprocess.PIPE,
|
|
stderr=subprocess.STDOUT,
|
|
stderr=subprocess.STDOUT,
|
|
universal_newlines=True)
|
|
universal_newlines=True)
|
|
- assert self._p.stdout.read(9) == 'qemu-io> '
|
|
|
|
|
|
+ out = self._p.stdout.read(9)
|
|
|
|
+ if out != 'qemu-io> ':
|
|
|
|
+ # Most probably qemu-io just failed to start.
|
|
|
|
+ # Let's collect the whole output and exit.
|
|
|
|
+ out += self._p.stdout.read()
|
|
|
|
+ self._p.wait(timeout=1)
|
|
|
|
+ raise ValueError(out)
|
|
|
|
|
|
def close(self):
|
|
def close(self):
|
|
self._p.communicate('q\n')
|
|
self._p.communicate('q\n')
|
|
@@ -339,8 +345,9 @@ def filter_qmp(qmsg, filter_fn):
|
|
return qmsg
|
|
return qmsg
|
|
|
|
|
|
def filter_testfiles(msg):
|
|
def filter_testfiles(msg):
|
|
- prefix = os.path.join(test_dir, "%s-" % (os.getpid()))
|
|
|
|
- return msg.replace(prefix, 'TEST_DIR/PID-')
|
|
|
|
|
|
+ pref1 = os.path.join(test_dir, "%s-" % (os.getpid()))
|
|
|
|
+ pref2 = os.path.join(sock_dir, "%s-" % (os.getpid()))
|
|
|
|
+ return msg.replace(pref1, 'TEST_DIR/PID-').replace(pref2, 'SOCK_DIR/PID-')
|
|
|
|
|
|
def filter_qmp_testfiles(qmsg):
|
|
def filter_qmp_testfiles(qmsg):
|
|
def _filter(_key, value):
|
|
def _filter(_key, value):
|