qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

vhost-user's disk can support physical_block_size=4096, logical_block_si


From: 顾泽兵
Subject: vhost-user's disk can support physical_block_size=4096, logical_block_size=512?
Date: Thu, 23 Mar 2023 04:40:25 -0700

Hello community,

I have a disk with both logical and physical sector size being 4096. I have a qcow2 image which is built from a virtual machine has legacy 512 bytes sector size.
I use spdk-vhost as the backend storage.

The commandline of qemu is like this:
/usr/bin/qemu-system-x86_64  \
-nographic \
-name debug-threads=on -nic none  -m 8G,slots=3,maxmem=16G -mem-prealloc -cpu host  -enable-kvm  -M q35 \
-smp 8,sockets=4,cores=2,threads=1 \
-object memory-backend-file,id=ram-node0,mem-path=/dev/hugepages,share=yes,size=8G,host-nodes=0,policy=bind \
-numa node,nodeid=0,cpus='0-7',memdev=ram-node0 \
-device pcie-root-port,port=0x10,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x2 \
-object iothread,id=iothread1 \
-object iothread,id=iothread2 \
-device pcie-root-port,port=0x11,chassis=2,id=pci.2,bus=pcie.0,addr=0x2.0x1 \
-device pcie-root-port,port=0x12,chassis=3,id=pci.3,bus=pcie.0,addr=0x2.0x2 \
-device pcie-root-port,port=0x13,chassis=4,id=pci.4,bus=pcie.0,addr=0x2.0x3 \
-device pcie-root-port,port=0x14,chassis=5,id=pci.5,bus=pcie.0,addr=0x2.0x4 \
-chardev socket,id=charvirtio-disk1,path=/var/run/spdk/qemu/disk0.sock,reconnect=1 \
-device vhost-user-blk-pci-non-transitional,chardev=charvirtio-disk1,bus=pci.4,addr=0x0,id=virtio-disk1,num-queues=2,bootindex=0 \


The result is that the system can’t start normally.
As I konw, there are 2 questios:
1、Seabios can't support sector size of 4096.
2、The qcow2 image which is built with sector size of 512 can’t interpreted with sector size of 4096. The key point is MBR partion table.


I have konwn that QEMU is supposed to emulate 512 byte sectors on top of a 4k sector disk on the host. The command line is like this:
'physical_block_size=4096,logical_block_size=512’.

Unfortunately, When I add 'physical_block_size=4096,logical_block_size=512’ to vhost-user-blk-pci-non-transitional, qemu print error:
Property 'vhost-user-blk-pci-non-transitional.physical_block_size' not found.

Can we have a plan to support params of 'physical_block_size=4096,logical_block_size=512’ to vhost-user-blk-pci-non-transitional? Or any other advice on how to possibly work around this?
Thank you very much!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]