Skip to content

Commit

Permalink
qemu_storage: support the vdpa device
Browse files Browse the repository at this point in the history
replace the file_opts for the vdpa device

Signed-off-by: Houqi (Nick) Zuo <[email protected]>
  • Loading branch information
nickzhq committed Jul 13, 2023
1 parent a5dea7c commit 6ef52c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion virttest/qemu_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,10 @@ def filename_to_file_opts(filename):
if matches['user'] is not None:
file_opts['username'] = matches['user']
# FIXME: Judge the host device by the string starts with "/dev/".
elif filename.startswith('/dev/'):
elif filename.startswith('/dev/') and not filename.startswith("/dev/vhost-vdpa"):
file_opts = {'driver': 'host_device', 'filename': filename}
elif filename.startswith("/dev/vhost-vdpa"):
file_opts = {'driver': 'virtio-blk-vhost-vdpa', 'path': filename}
else:
file_opts = {'driver': 'file', 'filename': filename}

Expand Down

0 comments on commit 6ef52c5

Please sign in to comment.