From 6ef52c50a16927add003e0e68d8691c74ff842a4 Mon Sep 17 00:00:00 2001 From: "Houqi (Nick) Zuo" Date: Wed, 12 Jul 2023 15:01:25 +0800 Subject: [PATCH] qemu_storage: support the vdpa device replace the file_opts for the vdpa device Signed-off-by: Houqi (Nick) Zuo --- virttest/qemu_storage.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/virttest/qemu_storage.py b/virttest/qemu_storage.py index f53a388b2b8..5a3e03edc94 100755 --- a/virttest/qemu_storage.py +++ b/virttest/qemu_storage.py @@ -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}