Bug 1966511

Summary: Add workaround for qemu reduced maximum disk size
Product: Red Hat Enterprise Linux 9 Reporter: xinyli
Component: nbdkitAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 9.0CC: chhu, eblake, juzhou, mxie, rjones, tyan, tzheng, virt-maint, vwu, xiaodwan, zili
Target Milestone: betaKeywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1913740 Environment:
Last Closed: 2021-06-02 02:33:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1906049, 1913740    
Bug Blocks:    

Comment 1 Richard W.M. Jones 2021-06-01 17:09:42 UTC
Hi Xinyu,

As far as I know this bug ought to be fixed by nbdkit 1.25.7 in RHEL 9.
Could you share the results of the test?  What was run and what failed?

Comment 2 xinyli 2021-06-02 02:07:38 UTC
Version-Release number of selected component (if applicable):

nbdkit-1.25.7-1.el9.x86_64
qemu-kvm-6.0.0-2.el9.x86_64

Steps to Reproduce:

# nbdkit memory $(( 2**63 - 512 )) --run 'qemu-img info "$uri"'
qemu-img: Could not open 'nbd://localhost:10809': Could not refresh total sector count: File too large

# nbdkit memory $(( 2**63 - 2**30 )) --run 'qemu-img info "$uri"'
image: nbd://localhost:10809
file format: raw
virtual size: 8 EiB (9223372035781033984 bytes)
disk size: unavailable

# nbdkit memory $(( 2**63 - 2**30 + 512 )) --run 'qemu-img info "$uri"'
qemu-img: Could not open 'nbd://localhost:10809': Could not refresh total sector count: File too large

Actual results:
as above description

Comment 3 xinyli 2021-06-02 02:33:10 UTC
Verify the bug with builds:
qemu-kvm-5.2.0-2.scrmod+el8.4.0+9296+87860477.wrb210106.x86_64
nbdkit-1.24.0-1.module+el8.4.0+9341+96cf2672.x86_64

Steps:
1.Use nbdkit memory plugin to create the largest possible RAM disk and use qemu-img to check the disk info:
#nbdkit memory $(( 2**63 - 2**30 )) --run 'qemu-img info "$uri"'
image: nbd://localhost:10809
file format: raw
virtual size: 8 EiB (9223372035781033984 bytes)
disk size: unavailable


2.Combine the nbdkit-streaming-plugin with qemu-img
# mkfifo pipe
# cat pipe > out &
[1] 642654
# qemu-img create -f qcow2 qcow2 1G
Formatting 'qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1073741824 lazy_refcounts=off refcount_bits=16
# nbdkit memory $(( 2**63 - 2**30 )) --run 'qemu-img info "$uri"'
image: nbd://localhost:10809
file format: raw
virtual size: 8 EiB (9223372035781033984 bytes)
disk size: unavailable