RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2026537 - Can't vol-download volume with --sparse option in split daemon mode
Summary: Can't vol-download volume with --sparse option in split daemon mode
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libvirt
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Meina Li
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-25 02:15 UTC by Meina Li
Modified: 2022-05-17 13:05 UTC (History)
5 users (show)

Fixed In Version: libvirt-8.0.0-0rc1.1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-17 12:45:52 UTC
Type: Bug
Target Upstream Version: 8.0.0
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-103898 0 None None None 2021-11-25 02:32:53 UTC
Red Hat Product Errata RHBA-2022:2390 0 None None None 2022-05-17 12:46:20 UTC

Description Meina Li 2021-11-25 02:15:57 UTC
Description of problem:
Can't vol-download volume with --sparse option in split daemon mode

Version-Release number of selected component (if applicable):
libvirt-7.9.0-1.el9.x86_64
qemu-kvm-6.1.0-6.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Create a pool and a volume for it.
# virsh pool-create-as --name dir-pool --type dir --target /var/tmp/dir-pool
Pool dir-pool created
# virsh vol-create-as --pool dir-pool dir-vol --capacity 10485760 --allocation 10485760 --format qcow2
Vol dir-vol created
# virsh pool-refresh dir-pool
Pool dir-pool refreshed

2. Prepare a disk image and attach it to the guest.
# qemu-img create -f raw /var/tmp/dir-pool/test.img 1G
Formatting '/var/tmp/dir-pool/test.img', fmt=raw size=1073741824
# cat /tmp/test.xml 
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/tmp/dir-pool/test.img'/>
      <target dev='vdb' bus='virtio'/>
    </disk>
# virsh attach-device avocado-vt-vm1 /tmp/test.xml --config
Device attached successfully

3. Write some data to the disk.
# virsh start avocado-vt-vm1
Domain 'avocado-vt-vm1' started
[in guest] #mkfs.ext4 -F /dev/vdb && mkdir -p test && mount /dev/vdb test && dd if=/dev/urandom of=test/file bs=1M count=100 && sync

4. Vol-download the volume with --sparse option.
# virsh pool-refresh dir-pool
Pool dir-pool refreshed
# virsh vol-download test.img /var/tmp/download-sparse.raw --pool dir-pool --sparse
error: cannot receive data from volume test.img
error: this function is not supported by the connection driver: virStreamInData

Actual results:
Can't vol-download the volume with --sparse option with unsupported error

Expected results:
Can vol-download the volume with --sparse option

Additional info:
Can run successfully with virsh -c storage:///system:
# virsh -c storage:///system vol-download test.img /var/tmp/download-sparse.raw --pool dir-pool --sparse

Comment 1 Meina Li 2021-11-25 02:24:58 UTC
Enable split daemon mode:
# cat split-daemon.sh 
systemctl stop libvirtd.service
systemctl stop libvirtd{,-ro,-admin,-tcp,-tls}.socket
systemctl start virtqemud
systemctl start virtsecretd
systemctl start virtstoraged
systemctl start virtproxyd

Comment 2 Michal Privoznik 2021-11-25 10:11:19 UTC
This is because remote driver isn't prepared to call virStreamInData(). I mean, when designing sparse streams, virStreamInData() was meant to be local only, there's no RPC representation. Let me see if we need one or we can go with something different.

Comment 3 Michal Privoznik 2021-12-07 15:37:07 UTC
Patches posted on the list:

https://listman.redhat.com/archives/libvir-list/2021-December/msg00211.html

Comment 4 Michal Privoznik 2021-12-13 13:50:36 UTC
Merged upstream as:

c1b06f5cf0 remote_driver: Implement virStreamInData() callback
2981d1c95e rpc: Introduce virNetClientStreamInData()
dd75e2e464 virStreamInData: Allow callback to not rewind the stream

v7.10.0-227-gc1b06f5cf0

Comment 5 Meina Li 2021-12-15 03:36:09 UTC
Pre-verified Version:
libvirt-8.0.0-1.fc35.x86_64
qemu-kvm-6.1.0-13.fc35.x86_64

Pre-verified Steps:
1.Prepare a split daemon environment:
systemctl stop libvirtd.service
systemctl stop libvirtd{,-ro,-admin,-tcp,-tls}.socket
systemctl start virtqemud
systemctl start virtsecretd
systemctl start virtstoraged
systemctl start virtproxyd
systemctl start virtnetworkd

2.Run vol-download and vol-upload according the following test case.
RHEL-115530 - [vol-download][vol-upload][sparse file] download and upload volume with --sparse param

Comment 6 Meina Li 2021-12-15 07:20:14 UTC
Add another scenario: 
RHEL-189537 - [storage][vol-download][vol-upload][sparse file] Download and upload volume with --sparse param when source/target is block device

Comment 10 Meina Li 2022-01-24 03:57:42 UTC
Verified Version:
libvirt-8.0.0-1.el9.x86_64
qemu-kvm-6.2.0-3.el9.x86_64

Verified Steps:
For basic test steps:
1. Create a pool and a volume for it.
# virsh pool-create-as --name dir-pool --type dir --target /var/tmp/dir-pool
Pool dir-pool created
# virsh vol-create-as --pool dir-pool dir-vol --capacity 10485760 --allocation 10485760 --format qcow2
Vol dir-vol created
# virsh pool-refresh dir-pool
Pool dir-pool refreshed

2. Prepare a disk image and attach it to the guest.
# qemu-img create -f raw /var/tmp/dir-pool/test.img 1G
Formatting '/var/tmp/dir-pool/test.img', fmt=raw size=1073741824
# cat /tmp/test.xml 
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/tmp/dir-pool/test.img'/>
      <target dev='vdb' bus='virtio'/>
    </disk>
# virsh attach-device avocado-vt-vm1 /tmp/test.xml --config
Device attached successfully

3. Write some data to the disk.
# virsh start avocado-vt-vm1
Domain 'avocado-vt-vm1' started
[in guest] #mkfs.ext4 -F /dev/vdb && mkdir -p test && mount /dev/vdb额日发ied test && dd if=/dev/urandom of=test/file bs=1M count=100 && sync

4. Vol-download the volume with --sparse option.
# virsh pool-refresh dir-pool
Pool dir-pool refreshed
# virsh vol-download test.img /var/tmp/download-sparse.raw --pool dir-pool --sparse
---Can vol-download with --sparse successfully
5. For complicated test steps, can refer to RHEL-115530 and RHEL-189537 in Links.

Comment 12 errata-xmlrpc 2022-05-17 12:45:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: libvirt), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2390


Note You need to log in before you can comment on or make changes to this bug.