Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1079383

Summary: "qemu-img map" not supported on NFS
Product: Red Hat Enterprise Linux 7 Reporter: FuXiangChun <xfu>
Component: qemu-kvmAssignee: Hanna Czenczek <hreitz>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.0CC: hhuang, juzhang, knoel, michen, pbonzini, rbalakri, sluo, swhiteho, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1079385 (view as bug list) Environment:
Last Closed: 2014-11-21 15:00:13 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: 1079385    
Bug Blocks:    

Description FuXiangChun 2014-03-21 14:01:00 UTC
Description of problem:
As subject, If guest image is on NFS, discard will be invalid.

Version-Release number of selected component (if applicable):
# uname -r
3.10.0-112.el7.x86_64
qemu-kvm-rhev-1.5.3-53.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Boot guest and attached a data disk on NFS(/mnt/ss.raw) and enable discard

/usr/libexec/qemu-kvm -M pc -cpu Opteron_G1 -device virtio-scsi-pci,id=scsi2,indirect_desc=off,event_idx=off,bus=pci.0,addr=0x8 -drive file=/mnt/ss.raw,if=none,id=drive-hd-disk-3,media=disk,format=raw,cache=none,werror=stop,rerror=stop,discard=on -device scsi-hd,drive=drive-hd-disk-3,id=scsi_disk3 -vnc :1  -drive file=/mnt/RHEL-Server-7.0-64.qcow2,if=none,id=drive-virtio-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop,media=disk,discard=on,serial,copy-on-read=on,snapshot=on -device virtio-blk-pci,vectors=0,scsi=off,drive=drive-virtio-disk,id=virtio-disk,bus=pci.0,addr=0x7,bootindex=1

2.format data disk inside guest with ext4
#mkfs.ext4 /dev/sda
#mount /dev/sda /mnt
#dd if=/dev/urandom of=/mnt/test 

3.check data disk image in host
# qemu-img map --output=json /mnt/ss.raw 

Actual results:
{ "start": 0, "length": 20971520, "depth": 0, "zero": false, "data": true, "offset": 0}]

Expected results:
discard valib

Additional info:
If data disk image is on local(not NFS), then discard works well

Comment 1 Paolo Bonzini 2014-03-21 14:16:44 UTC
The problem in QEMU is that we only try FIEMAP.  The upstream proposed patches for NFS (http://thread.gmane.org/gmane.linux.nfs/59563) would use SEEK_HOLE/SEEK_DATA instead.

QEMU has code for SEEK_HOLE/SEEK_DATA, but it is not active if the OS (as is the case with Linux) supports FIEMAP.  Instead, QEMU should fall back to SEEK_HOLE/SEEK_DATA if FIEMAP fails.

Comment 7 Hanna Czenczek 2014-11-21 15:00:13 UTC
Hi,

from the QEMU side of things, this bug can be closed. The backport for BZ 1160237 completely removes FIEMAP from QEMU, and makes it use SEEK_HOLE/SEEK_DATA only.

Max

*** This bug has been marked as a duplicate of bug 1160237 ***