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

failed to create ublk device with qcow2 #67

Open
zhongchanghui opened this issue May 2, 2024 · 5 comments
Open

failed to create ublk device with qcow2 #67

zhongchanghui opened this issue May 2, 2024 · 5 comments

Comments

@zhongchanghui
Copy link
Contributor

zhongchanghui commented May 2, 2024

I can not create ublk device with qcow2,

# qemu-img create -f qcow2 ublk_qcow2.qcow2 10G
Formatting 'ublk_qcow2.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=10737418240 lazy_refcounts=off refcount_bits=16
# ublk add -t qcow2 -f ublk_qcow2.qcow2
start dev 0 daemon failed, ret -1
#
# ublk -v
ublksrv 1.1-10-g6550517

and the testing generic/003 ,generic/005 all hit this issue:

running generic/003
	mount/umount /dev/ublkb0(ublk -t loop -q 2 -g 0 -f /mnt/tests/gitlab.com/redhat/centos-stream/tests/kernel/kernel-tests/-/archive/main/kernel-tests-main.zip/storage/block/RHEL_2107_ublk_testing/ubdsrv/tests/tmp/ublk_loop_null_1G_P1zCV) with fstype(xfs)...ok
	mount/umount /dev/ublkb0(ublk -t loop -q 2 -g 1 -f /mnt/tests/gitlab.com/redhat/centos-stream/tests/kernel/kernel-tests/-/archive/main/kernel-tests-main.zip/storage/block/RHEL_2107_ublk_testing/ubdsrv/tests/tmp/ublk_loop_null_1G_P1zCV) with fstype(xfs)...ok
	mount/umount /dev/ublkb0(ublk -t qcow2 -q 1 -g 0 -f /mnt/tests/gitlab.com/redhat/centos-stream/tests/kernel/kernel-tests/-/archive/main/kernel-tests-main.zip/storage/block/RHEL_2107_ublk_testing/ubdsrv/tests/tmp/ublk_null_1G_HA4aN.qcow2) with fstype(xfs)...failed
	mount/umount /dev/ublkb0(ublk -t qcow2 -q 1 -g 1 -f /mnt/tests/gitlab.com/redhat/centos-stream/tests/kernel/kernel-tests/-/archive/main/kernel-tests-main.zip/storage/block/RHEL_2107_ublk_testing/ubdsrv/tests/tmp/ublk_null_1G_HA4aN.qcow2) with fstype(xfs)...failed
	mount/umount /dev/ublkb0(ublk -t nbd -q 1 -g 0 -d 127 --host 127.0.0.1) with fstype(xfs)...failed
	mount/umount /dev/ublkb0(ublk -t nbd -q 1 -g 1 -d 127 --host 127.0.0.1) with fstype(xfs)...failed

running generic/005
	run fio with dev recovery, type 1:
	(1)kill all ubq_deamon, (2)recover with new ubq_daemon, (3)delete dev
	run fio with killing /dev/ublkb0(ublk add -t null -q 2 -u 1 -g 1 -r 1 -i 0 ) queue daemon 1
	run fio with killing /dev/ublkb0(ublk add -t null -q 2 -u 1 -g 1 -r 1 -i 1 ) queue daemon 1
	run fio with killing /dev/ublkb0(ublk add -t loop -q 2 -u 1 -g 1 -r 1 -i 0 -f /mnt/tests/gitlab.com/redhat/centos-stream/tests/kernel/kernel-tests/-/archive/main/kernel-tests-main.zip/storage/block/RHEL_2107_ublk_testing/ubdsrv/tests/tmp/ublk_loop_null_256M_7rATm) queue daemon 1
	run fio with killing /dev/ublkb0(ublk add -t loop -q 2 -u 1 -g 1 -r 1 -i 1 -f /mnt/tests/gitlab.com/redhat/centos-stream/tests/kernel/kernel-tests/-/archive/main/kernel-tests-main.zip/storage/block/RHEL_2107_ublk_testing/ubdsrv/tests/tmp/ublk_loop_null_256M_RQNoP) queue daemon 1
	run fio with killing /dev/ublkb0(ublk add -t qcow2 -q 1 -u 1 -g 1 -r 1 -i 0 -f /mnt/tests/gitlab.com/redhat/centos-stream/tests/kernel/kernel-tests/-/archive/main/kernel-tests-main.zip/storage/block/RHEL_2107_ublk_testing/ubdsrv/tests/tmp/ublk_null_256M_qWWtG.qcow2) queue daemon 1
can't get dev info from 0: -19
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
can't get dev info from 0: -19
can't get dev info from 0: -19
can't get dev info from 0: -19
can't get dev info from 0: -19
can't get dev info from 0: -19
can't get dev info from 0: -19
can't get dev info from 0: -19
can't get dev info from 0: -19
can't get dev info from 0: -19
can't get dev info from 0: -19
can't get dev info from 0
can't get dev info from 0
can't get dev info from 0
@ming1
Copy link
Collaborator

ming1 commented May 4, 2024

Hi Changhui,

For nbd test failure, please check if nbdkit is installed.

For qcow2 test, please ignore it, since I plan to remove qcow2 from ublksrv project and all qcow2 related tests.

And please test rublk from user viewpoint if you are interested, which is supposed for production uses.

https://github.com/ublk-org/rublk

Thanks,

@zhongchanghui
Copy link
Contributor Author

Hi,Ming

got it,thanks for reply,
what is the difference between rublk and ublksrv? it looks like their commands are similar, just rublk write by rust.
if I test rublk I only need to install rublk when testing,and I don’t need to compile and install ublksrv?

Thanks,

@ming1
Copy link
Collaborator

ming1 commented May 7, 2024

Hi,Ming

got it,thanks for reply, what is the difference between rublk and ublksrv?

rublk is re-written by Rust, and IMO, Rust is:

  • more productive(no need config/makefile, super-easy to integrate 3rd party lib/crate, more productive dev environment: auto-completion, grammar checker, online hint,...)

  • memory safe(take much less debug time, and need to design carefully)

  • explicit version & depend rule

  • central crates for package management, everyone can install
    one Rust lib/binary from crates easily, and everyone can upload
    one Rust lib/binary to crates

  • built-in tests

it looks like their commands are similar, just rublk write by rust.

Yes, but rublk supports more command line parameters, and Rust's
command line and json processing is stronger.

if I test rublk I only need to install rublk when testing,and I don’t need to compile and install ublksrv?

There are two ways:

  1. test the 'rublk' from 'crates' directly
  1. test 'rublk' from github
    https://github.com/ublk-org/rublk

Also blktests support to run test over rublk if 'rublk' is installed
on test machine, and we can add more tests for covering rublk

Thanks,

@ming1
Copy link
Collaborator

ming1 commented May 7, 2024

I can not create ublk device with qcow2,

# qemu-img create -f qcow2 ublk_qcow2.qcow2 10G
Formatting 'ublk_qcow2.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=10737418240 lazy_refcounts=off refcount_bits=16
# ublk add -t qcow2 -f ublk_qcow2.qcow2
start dev 0 daemon failed, ret -1
#
# ublk -v
ublksrv 1.1-10-g6550517

Hi Changhui,

I can't reproduce the issue, maybe io_uring doesn't work in your environment?

Thanks,

@zhongchanghui
Copy link
Contributor Author

Hi,Ming

not sure why happen this, but loop/null works well at that time.
and now I checked new test with ublksrv, all looks good,
if I hit again next time, I can share my test machine with you

Thanks,

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

No branches or pull requests

2 participants