Bug 1211973
Summary: | 'guest-fstrim' failed for guest with os on spapr-vscsi disk | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Gu Nini <ngu> | |
Component: | qemu-guest-agent | Assignee: | Thomas Huth <thuth> | |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> | |
Severity: | unspecified | Docs Contact: | ||
Priority: | unspecified | |||
Version: | 7.2 | CC: | hhuang, huding, juzhang, knoel, michen, mrezanin, qzhang, thuth, xuhan, ypu, zhengtli | |
Target Milestone: | rc | |||
Target Release: | --- | |||
Hardware: | All | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | qemu-guest-agent-2.3.0-2.el7 | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1213236 (view as bug list) | Environment: | ||
Last Closed: | 2015-11-19 07:11:12 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: | ||||
Bug Blocks: | 1213236 |
Description
Gu Nini
2015-04-15 10:33:43 UTC
(In reply to Gu Nini from comment #0) Please note after the bug, cmd 'fstrim' inside the guest could still be used normally. Seems like the problem can also be reproduced without real scsi disk. I can also get the error when I run qemu with this slightly stripped command line and by using disk images instead: /usr/libexec/qemu-kvm -name bz1211973 -machine pseries-rhel7.1.0,accel=kvm,usb=off -m 32768 -realtime mlock=off -smp 8,sockets=1,cores=16,threads=8 -no-user-config -nodefaults -serial stdio -device pci-ohci,id=usb1,bus=pci.0,addr=0x1 -device virtio-scsi-pci,id=scsi1,bus=pci.0,addr=0x8 -device spapr-vscsi,id=scsi0,reg=0x1000 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x3 -drive file=/home/thuth/rhel-7.1-le.qcow2,if=none,id=drive-scsi0-0-0-0,format=qcow2 -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 -drive file=/home/thuth/hd-0414.qcow2,if=none,id=drive-scsi1-0-2-0,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop,discard=on -device scsi-hd,bus=scsi1.0,channel=0,scsi-id=2,lun=0,drive=drive-scsi1-0-2-0,id=scsi1-0-2-0 -drive file=/home/thuth/qemudisk.raw,if=none,id=drive-scsi0-0-3-0,format=raw,cache=none,aio=native,werror=stop,rerror=stop,discard=on -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=3,lun=0,drive=drive-scsi0-0-3-0,id=scsi0-0-3-0 -chardev socket,id=charchannel0,path=/tmp/qemu.guest_agent.0,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 -nographic This problem is likely the same as one that has been recently reported to the qemu mailing list: https://lists.gnu.org/archive/html/qemu-devel/2015-04/msg00109.html (the values in struct fstrim_range have to be refreshed before each ioctl in qmp_guest_fstrim() in qga/commands-posix.c) I'll try to revive that discussion to see whether we can get a fix in upstream... Fix is now available upstream: http://git.qemu-project.org/?p=qemu.git;a=commitdiff;h=73a652a1b08445e8d91e50cdbb2da50e571c61b3 Fix included in qemu-guest-agent-2.3.0-2.el7 Reproduce this bug using the following version: Host: kernel-3.10.0-292.el7.x86_64 qemu-kvm-rhev-2.3.0-12.el7.x86_64 Guest: kernel-3.10.0-229.el7.x86_64 qemu-guest-agent-2.1.0-4.el7.x86_64 Steps to Reproduce: 1. Start a guest rhel7.2 with scsi hd system disk and data disk: # /usr/libexec/qemu-kvm -name bz1211973 -machine pc,accel=kvm,usb=off -m 4096 -realtime mlock=off -smp 8,sockets=1,cores=16,threads=8 -device virtio-scsi-pci,id=scsi1,bus=pci.0,addr=0x8 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x3 -drive file=/home/RHEL-Server-7.2-64-virtio-scsi.qcow2,if=none,id=drive-scsi0-0-0-0,format=qcow2 -device scsi-hd,bus=scsi1.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 -drive file=/home/hd-0414.qcow2,if=none,id=drive-scsi1-0-2-0,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop,discard=on -device scsi-hd,bus=scsi1.0,channel=0,scsi-id=2,lun=0,drive=drive-scsi1-0-2-0,id=scsi1-0-2-0 -drive file=/home/qemudisk.raw,if=none,id=drive-scsi0-0-3-0,format=raw,cache=none,aio=native,werror=stop,rerror=stop,discard=on -device scsi-hd,bus=scsi1.0,channel=0,scsi-id=3,lun=0,drive=drive-scsi0-0-3-0,id=scsi0-0-3-0 -chardev socket,id=charchannel0,path=/tmp/qemu.guest_agent.0,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 -qmp tcp:0:6666,server,nowait -nodefaults -nodefconfig -spice port=5910,seamless-migration=on,disable-ticketing -vga qxl -global qxl-vga.vram_size=67108864 -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -monitor stdio -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,mac=52:54:00:c6:4b:15,id=test 2. In the guest, install and start guest agent; 'mkfs.ext4' and 'mount' the 2 data disks; write/remove some data on them 3. In the host, connect to the guest agent channel with cmd 'nc -U /tmp/qemu.guest_agent.0' 4. On above channel, execute guest agent cmd 'guest-fstrim' for 5 times: {"execute":"guest-fstrim"} {"return": {}} {"execute":"guest-fstrim"} {"error": {"class": "GenericError", "desc": "failed to trim /media: Invalid argument"}} {"execute":"guest-fstrim"} {"error": {"class": "GenericError", "desc": "failed to trim /media: Invalid argument"}} {"execute":"guest-fstrim"} {"error": {"class": "GenericError", "desc": "failed to trim /media: Invalid argument"}} {"execute":"guest-fstrim"} {"error": {"class": "GenericError", "desc": "failed to trim /media: Invalid argument"}} Actual results: The fstrim cmd execution failed since the 2nd time Test this bug using the following version: Host: kernel-3.10.0-292.el7.x86_64 qemu-kvm-rhev-2.3.0-12.el7.x86_64 Guest: kernel-3.10.0-229.el7.x86_64 qemu-guest-agent-2.3.0-2.el7.x86_64 Steps to Reproduce: 1. Start a guest rhel7.2 with scsi hd system disk and data disk: # /usr/libexec/qemu-kvm -name bz1211973 -machine pc,accel=kvm,usb=off -m 4096 -realtime mlock=off -smp 8,sockets=1,cores=16,threads=8 -device virtio-scsi-pci,id=scsi1,bus=pci.0,addr=0x8 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x3 -drive file=/home/RHEL-Server-7.2-64-virtio-scsi.qcow2,if=none,id=drive-scsi0-0-0-0,format=qcow2 -device scsi-hd,bus=scsi1.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 -drive file=/home/hd-0414.qcow2,if=none,id=drive-scsi1-0-2-0,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop,discard=on -device scsi-hd,bus=scsi1.0,channel=0,scsi-id=2,lun=0,drive=drive-scsi1-0-2-0,id=scsi1-0-2-0 -drive file=/home/qemudisk.raw,if=none,id=drive-scsi0-0-3-0,format=raw,cache=none,aio=native,werror=stop,rerror=stop,discard=on -device scsi-hd,bus=scsi1.0,channel=0,scsi-id=3,lun=0,drive=drive-scsi0-0-3-0,id=scsi0-0-3-0 -chardev socket,id=charchannel0,path=/tmp/qemu.guest_agent.0,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 -qmp tcp:0:6666,server,nowait -nodefaults -nodefconfig -spice port=5910,seamless-migration=on,disable-ticketing -vga qxl -global qxl-vga.vram_size=67108864 -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -monitor stdio -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,mac=52:54:00:c6:4b:15,id=test 2. In the guest, install and start guest agent; 'mkfs.ext4' and 'mount' the 2 data disks; write/remove some data on them 3. In the host, connect to the guest agent channel with cmd 'nc -U /tmp/qemu.guest_agent.0' 4. On above channel, execute guest agent cmd 'guest-fstrim' for 5 times: {"execute":"guest-fstrim"} {"return": {}} {"execute":"guest-fstrim"} {"return": {}} {"execute":"guest-fstrim"} {"return": {}} {"execute":"guest-fstrim"} {"return": {}} {"execute":"guest-fstrim"} {"return": {}} Actual results: The fstrim cmd execution always success. 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, 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://rhn.redhat.com/errata/RHBA-2015-2217.html |