Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] avocado-vt: add support for virtio-blk-vhost-user #4018

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

XueqiangWei
Copy link
Contributor

Signed-off-by: Xueqiang Wei [email protected]

@XueqiangWei XueqiangWei force-pushed the blk_vhost_user branch 2 times, most recently from 92e738d to 9a764bc Compare October 28, 2024 21:31
@XueqiangWei
Copy link
Contributor Author

add the following parameters in test case:
vm_mem_backend = memory-backend-memfd
vm_mem_share = yes
vhost_user_blk_images = "stg1"
images += " ${vhost_user_blk_images}"
image_format_stg1 = raw
image_raw_device_stg1 = yes
drive_format_stg1 = virtio
#drive_format_stg1 = scsi-hd
storage_type_stg1 = "vhost-user"
remove_image_stg1 = no
force_create_image_stg1 = no
create_image_stg1 = no
check_image_stg1 = no
drv_extra_params_stg1 += ",cache.direct=on"
image_name_stg1 = "/tmp/vhost-user-blk1.sock"

The results were passed.
(1/1) Host_RHEL.m9.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.8.10.0.x86_64.io-github-autotest-qemu.boot.q35: PASS (35.90 s)
(1/1) Host_RHEL.m9.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.x86_64.io-github-autotest-qemu.boot.q35: PASS (97.76 s)

@@ -2547,6 +2547,8 @@ def define_hbas(
protocol_cls = qdevices.QBlockdevProtocolFTP
elif filename.startswith("vdpa:"):
protocol_cls = qdevices.QBlockdevProtocolVirtioBlkVhostVdpa
elif "vhost-user-blk" in filename:
protocol_cls = qdevices.QBlockdevProtocolVirtioBlkVhostUser
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have a question here:
for vdpa "filename=/dev/vhost-vdpa-x" is defined by the system automatically as a device after loading the vhost-vdpa module.

But for virtio-blk-vhost-user, filename was defined in qsd, like: --export type=vhost-user-blk,id=export1,addr.type=unix,addr.path=/tmp/vhost-user-blk1.sock,node-name=fmt1 \

So if I set the socket name to addr.path=/tmp/test.sock, then no filename matched here, so no QBlockdevProtocolVirtioBlkVhostUser node created.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I see, it's just a draft. Currently it is only supported in this way. (path=/tmp/vhost-user-blk1.sock, path=/tmp/vhost-user-blk2.sock)
For the sake of program readability, I suggest that we fix the naming format. We can discuss it later.

@@ -211,6 +211,8 @@ def filename_to_file_opts(filename):
elif filename.startswith("vdpa:"):
# filename[7:] mean: remove the prefix "vdpa://"
file_opts = {"driver": "virtio-blk-vhost-vdpa", "path": filename[7:]}
elif "vhost-user-blk" in filename:
file_opts = {"driver": "virtio-blk-vhost-user", "path": filename}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above.

@XueqiangWei XueqiangWei marked this pull request as draft December 11, 2024 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants