Bug 962620
Summary: | Backport qemu-ga guest-fstrim command to RHEL7 [TestOnly] | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Sibiao Luo <sluo> |
Component: | qemu-kvm | Assignee: | Laszlo Ersek <lersek> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.0 | CC: | acathrow, chayang, flang, hhuang, juzhang, kwolf, lersek, michen, pbonzini, qzhang, virt-maint, xfu |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | qemu-kvm-1.4.0-2.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-06-13 10:43:59 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: |
Description
Sibiao Luo
2013-05-14 04:54:57 UTC
Hi pbonzini, Does it only support on passthrough scsi disk(scsi-block) with RAW format in rhel7? How about the emulated SCSI hard disk(scsi-hd) with 'discard=on', does it support the guest-fstrim ? btw, it works well according to my test(https://bugzilla.redhat.com/show_bug.cgi?id=918311#c17). Could you help me make a note here about what's the difference will be between rhel6.5 and rhel7 for the 'discard=on'? Thanks. Best Regards, sluo (In reply to comment #1) > Hi pbonzini, > > Does it only support on passthrough scsi disk(scsi-block) with RAW format > in rhel7? How about the emulated SCSI hard disk(scsi-hd) with 'discard=on', > does it support the guest-fstrim ? btw, it works well according to my > test(https://bugzilla.redhat.com/show_bug.cgi?id=918311#c17). > Could you help me make a note here about what's the difference will be > between rhel6.5 and rhel7 for the 'discard=on'? Thanks. sorry, a mistake here. Could you help me make a note here about what's the difference will be between rhel6.5 and rhel7 for the 'guest-fstrim'? > Best Regards, > sluo Hi sluo, RHEL7 will support guest-fstrim also with emulated SCSI hard disks and rhel7.x.0 machine types. It will work with both discard=on and discard=off, but it will only have an actual effect with discard=on. With discard=off, it will be a "no-op". (In reply to comment #3) > Hi sluo, > > RHEL7 will support guest-fstrim also with emulated SCSI hard disks and > rhel7.x.0 machine types. It will work with both discard=on and discard=off, > but it will only have an actual effect with discard=on. With discard=off, > it will be a "no-op". Got it, thanks for your info. We will verify this issue with the passthrough scsi disk(scsi-block) and emulated SCSI hard disk(scsi-hd) with 'discard=on' in rhel7. Paolo, Kevin, do we need commit 50b05b6f2e24296b4d739a638e1e7427767ed7cd Author: Kevin Wolf <kwolf> Date: Wed Jun 19 13:44:21 2013 +0200 block: Always enable discard on the protocol level for this bug, or can I bump it to MODIFIED? I think we should be all set. BTW I'd prefer if one you took the BZ, or at least gave a concise description of all the layers that can mess with UNMAP going through. (The commit messages, eg. 9e8f1835 too -- already in RHEL-7 -- imply that it can go wrong in many places.) Thanks. The patch will be needed for qcow2 to pass through discard requests to the image file. We still have bug 978402 for that, this one can concentrate on the guest agent part. Thanks. Verified this issue on qemu-kvm-1.5.3-38.el7.x86_64 with the instruction of Paolo. I verified this issue with the passthrough scsi disk(scsi-block) and emulated SCSI hard disk(scsi-hd) with 'discard=on' in rhel7. host info: # uname -r && rpm -q qemu-kvm 3.10.0-76.el7.x86_64 qemu-kvm-1.5.3-38.el7.x86_64 guest info: # uname -r 3.10.0-76.el7.x86_64 Steps: 1.Boot guest with /dev/sdb (generaled as setup) with virtio serial and start guest agent inside guest. # modprobe scsi_debug lbpu=1 lbpws=1 # lsscsi ... [9:0:0:0] disk Linux scsi_debug 0004 /dev/sdb e.g:/usr/libexec/qemu-kvm...-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x3 -chardev socket,id=channel1,path=/tmp/helloworld1,server,nowait -device virtserialport,chardev=channel1,name=org.qemu.guest_agent.0,bus=virtio-serial0.0,id=port1,nr=1 -drive file=/dev/sdb,if=none,id=drive-data-disk,format=raw,cache=none,aio=native,werror=stop,rerror=stop,discard=on -device virtio-scsi-pci,id=scsi1,bus=pci.0,addr=0x7 -device scsi-hd|scsi-block,drive=drive-data-disk,id=data-disk,bus=scsi1.0 2.Make file system to the disk in the guest. # mkfs.ext4 /dev/sdb 3. On the host # cat /sys/bus/pseudo/drivers/scsi_debug/map 4.On the guest # mount /dev/sdb /home/test # dd if=/dev/zero of=/home/test/file 5.cat map in host. # cat /sys/bus/pseudo/drivers/scsi_debug/map 6.in guest. # rm /home/test/file 7.connect the chardev socket in host side and send "guest-fstrim" command in the host side: # nc -U /tmp/qga.sock {"execute":"guest-fstrim"} 8.cat map in host. # cat /sys/bus/pseudo/drivers/scsi_debug/map Results: - for scsi-hd: 1.after step 1, boot guest successfully. 2.after step 3, # cat /sys/bus/pseudo/drivers/scsi_debug/map 0-2663,16256-16383 3.after step 5, # cat /sys/bus/pseudo/drivers/scsi_debug/map 0-7379,8194-16383 4.after step 7, {"execute":"guest-fstrim"} {"return": {}} 5.after step 8, # cat /sys/bus/pseudo/drivers/scsi_debug/map 0-2659 - for scsi-block: 1.after step 1, boot guest successfully. 2.after step 3, # cat /sys/bus/pseudo/drivers/scsi_debug/map 0-135,640-2663,16256-16383 3.after step 5, # cat /sys/bus/pseudo/drivers/scsi_debug/map 0-135,640-2663,2688-15595,16256-16383 4.after step 7, {"execute":"guest-fstrim"} {"return": {}} 5.after step 8, # cat /sys/bus/pseudo/drivers/scsi_debug/map 0-135,640-2659 Base on above, this issue has been fixed correctly, the "guest-fstrim" command worked successfully. Best Regards, sluo According comment #9 and comment #10, this bug has been fixed, move it to VERIFIED status. Please correct me if any mistake, thanks in advance. Best Regards, sluo This request was resolved in Red Hat Enterprise Linux 7.0. Contact your manager or support representative in case you have further questions about the request. |