Bug 1021858 - add "-drive ...,discard=on|off" for guest-fstrim supported with passthrough or emulated SCSI hard disk
Summary: add "-drive ...,discard=on|off" for guest-fstrim supported with passthrough o...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Virtualization Maintenance
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-22 08:36 UTC by Sibiao Luo
Modified: 2013-10-24 23:15 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-24 23:15:11 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Sibiao Luo 2013-10-22 08:36:49 UTC
Description of problem:
As now rhel7 work with both discard=on and discard=off, but it will only have an actual effect with discard=on for passthrough and emulated SCSI hard disk. So we should also add "-drive ...,discard=on|off" for guest-fstrim supported with passthrough or emulated SCSI hard disk in rhel6.

Version-Release number of selected component (if applicable):
host info:
# uname -r && rpm -q qemu-kvm-rhev
2.6.32-424.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.414.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.check the discard=on|off in qmeu-kvm man help.
2.boot guest with '-drive ...,discard=on' specified.
e.g:...-drive file=/dev/disk/by-path/ip-10.66.90.100\:3260-iscsi-iqn.2001-05.com.equallogic\:0-8a0906-0971f7d03-1dff49b26885073d-s2-sluo-172259-lun-0,if=none,id=drive-data-disk,format=raw,aio=native,discard=on -device virtio-scsi-pci,bus=pci.0,addr=0x7,id=scsi0 -device scsi-block,drive=drive-data-disk,id=data-disk,bus=scsi0.0
qemu-kvm: -drive file=/dev/disk/by-path/ip-10.66.90.100:3260-iscsi-iqn.2001-05.com.equallogic:0-8a0906-0971f7d03-1dff49b26885073d-s2-sluo-172259-lun-0,if=none,id=drive-data-disk,format=raw,aio=native,discard=on: Invalid parameter 'discard'
3.

Actual results:
after step 1, there is no any discard=on|off info in qmeu-kvm man help.
after step 2, QEMU quit with message prompt: Invalid parameter 'discard'.

Expected results:
Add "-drive ...,discard=on|off" for guest-fstrim supported with passthrough or emulated SCSI hard disk in rhel6.
e.g.]# man qemu-kvm
...
           discard=discard
               discard is one of "ignore" (or "off") or "unmap" (or "on") and controls whether discard (also known as
               trim or unmap) requests are ignored or passed to the filesystem.  Some machine types may not support
               discard requests.
...

Additional info:

Comment 1 Paolo Bonzini 2013-10-24 23:15:11 UTC
You cannot disable discard on passthrough; passthrough will always pass the commands to the underlying device.  The right way to disable discard for passthrough is to configure it on the storage.

It might be better if libvirt forbids configuration of passthrough if the disk type='lun'.  That would be a separate bug.


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