Hi,
I did some testing about disk with <slice> setting and found that the value
of domblkinfo->allocation is not same with domstats.1->allocation for disk
with <slices>
Env:
libvirt-8.0.0-4.el9
qemu-kvm-6.2.0-9.el9
Step:
1. prepare a image
# qemu-img create /car/lib/libvirt/images/disk-raw -f raw 100M -o
preallocation=full
2. start a guest and attach the disk
➜ ~ cat disk.xml
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='none'
io='native'
copy_on_read='off' discard='ignore' detect_zeroes='on'/>
<source file='/var/lib/libvirt/images/disk-raw' index='1'>
<slices>
<slice type='storage' offset='0'
size='104857600'/>
</slices>
</source>
<backingStore/>
<target dev='sdb' bus='scsi'/>
<iotune>
<total_bytes_sec>10000000</total_bytes_sec>
<group_name>slice</group_name>
</iotune>
<alias name='ua-slices'/>
<address type='drive' controller='0' bus='0'
target='0' unit='1'/>
</disk>
3. Write some data to the slices disk in vm
(in vm) dd if=/dev/zero of=/dev/sdb bs=10M count=1
4. check *domblkinfo* and *domstats*
➜ ~ virsh domstats rhel9.0-1 --block|grep -Ei
'block.1.(allocation|capacity|physical)'
*block.1.allocation=0*
block.1.capacity=104857600
block.1.physical=104865792
➜ ~
➜ ~ virsh domblkinfo rhel9.0-1 sdb|grep -Ei
'(allocation|capacity|physical)'
Capacity: 104857600
*Allocation: 104865792*
Physical: 104857600
Are these 'allocation' values expected to be equal to each other?
Thanks,
Zhen Tang