Master: add get_config()/set_config() support #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@jiangliu
Please help review this PR, and i copied this whole src into our cloud-hypervisor to verify it.
From the guest kernel log, we can get right virtio-blk config info from SPDK backend.
[ 0.171460] -----------blk config value as below:--------------
[ 0.172211] capacity=131072
[ 0.172573] size_max=0
[ 0.172886] seg_max=0
[ 0.173183] blk_size=512
[ 0.173519] physical_block_exp=0
[ 0.173940] alignment_offset=0
[ 0.174347] min_io_size=1
[ 0.174692] opt_io_size=0
[ 0.175045] wce=1
[ 0.175301] num_queues=1
[ 0.175616] max_discard_sectors=32768
[ 0.176092] max_discard_seg=1
[ 0.176473] discard_sector_alignment=1
[ 0.176954] max_write_zeroes_sectors=1
[ 0.177436] max_write_zeroes_seg=1
[ 0.177881] write_zeroes_may_unmap=0
[ 0.179780] virtio_blk virtio2: [vdb] 131072 512-byte logical blocks (67.1 MB/64.0 MiB)
This also can show right vdb info from guest
root@unicorn ~ # lsblk --output "NAME,KNAME,MODEL,HCTL,SIZE,VENDOR,SUBSYSTEMS"
NAME KNAME MODEL HCTL SIZE VENDOR SUBSYSTEMS
sda sda scsi_debug 0:0:0:0 8M Linux block:scsi:pseudo
nullb0 nullb0 250G block
vda vda 8.5G 0x1af4 block:virtio:pci
├─vda1 vda1 511M block:virtio:pci
├─vda2 vda2 32M block:virtio:pci
└─vda3 vda3 8G block:virtio:pci
vdb vdb 64M 0x1af4 block:virtio:pci