diff options
author | Corey Bryant <coreyb@linux.vnet.ibm.com> | 2012-11-14 17:53:16 -0500 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2012-12-11 11:05:11 +0100 |
commit | 23e956bfe6af6f71046772478ed08d4e5c9c62d4 (patch) | |
tree | f29f321de4c1e45dcd02e176282aa44bd858054f /tests/qemu-iotests/iotests.py | |
parent | d92ada2202a0730e396304908ff7b870168387d2 (diff) |
tests: Add tests for fdsets
Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/iotests.py')
-rw-r--r-- | tests/qemu-iotests/iotests.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 0be5c7e13f..569ca3d804 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -79,6 +79,18 @@ class VM(object): self._num_drives += 1 return self + def add_fd(self, fd, fdset, opaque, opts=''): + '''Pass a file descriptor to the VM''' + options = ['fd=%d' % fd, + 'set=%d' % fdset, + 'opaque=%s' % opaque] + if opts: + options.append(opts) + + self._args.append('-add-fd') + self._args.append(','.join(options)) + return self + def launch(self): '''Launch the VM and establish a QMP connection''' devnull = open('/dev/null', 'rb') |