From 23e956bfe6af6f71046772478ed08d4e5c9c62d4 Mon Sep 17 00:00:00 2001 From: Corey Bryant Date: Wed, 14 Nov 2012 17:53:16 -0500 Subject: tests: Add tests for fdsets Signed-off-by: Corey Bryant Reviewed-by: Kevin Wolf Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/iotests.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/qemu-iotests/iotests.py') 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') -- cgit v1.2.1