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 1594113

Summary: Error returned after issue {"execute":"guest-fstrim"} cmd for win7-32/64 and win2008-32/64/r2 guest
Product: Red Hat Enterprise Linux 7 Reporter: xiagao
Component: virtio-winAssignee: Sameeh Jubran <sjubran>
virtio-win sub component: qemu-ga-win QA Contact: Virtualization Bugs <virt-bugs>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: ddepaula, vrozenfe
Version: 7.6   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
NO_DOCS
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 16:21:51 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 xiagao 2018-06-22 06:54:00 UTC
Description of problem:
as summary

Version-Release number of selected component (if applicable):
mingw-qemu-ga-win-7.5.0-2.el7ev
virtio-win-prewhql-153

How reproducible:
100%

Steps to Reproduce:
1.boot up win7-32 guest with vioser driver installed and qemu-ga installed.
    -device pcie-root-port,id=pcie.0-root-port-4,slot=4,chassis=4,addr=0x4,bus=pcie.0 \
    -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pcie.0-root-port-4,addr=0x0 \
    -drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,format=qcow2,file=win732.qcow2 \
    -device pcie-root-port,id=pcie.0-root-port-15,bus=pcie.0 \
    -device virtio-scsi-pci,id=scsi1,bus=pcie.0-root-port-15 \
    -drive file=disk-scsi.qcow2,if=none,id=drive-data-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop,discard=on -device scsi-disk,drive=drive-data-disk,bus=scsi1.0,id=data-disk \


2.issue fstrim from host
{"execute":"guest-fstrim"}
{"return": {"paths": [{"path": "C:\\", "error": "An invalid command line option was specified. (0x89000008)"}, {"path": "F:\\", "error": "An invalid command line option was specified. (0x89000008)"}, {"path": "S:\\", "error": "An invalid command line option was specified. (0x89000008)"}]}}

3.check event viewer,there is no any log.

4.run "defrag -L" in guest

C:\Users\Administrator>defrag -L
Microsoft Disk Defragmenter
Copyright (c) 2007 Microsoft Corp.

An invalid command line option was specified. (0x89000008)

Description:

        Locates and consolidates fragmented files on local volumes to
        improve system performance.

Syntax:

        defrag <volumes> | /C | /E <volumes>    [/H] [/M | [/U] [/V]]
        defrag <volumes> | /C | /E <volumes> /A [/H] [/M | [/U] [/V]]
        defrag <volumes> | /C | /E <volumes> /X [/H] [/M | [/U] [/V]]
        defrag <volume>                      /T [/H]       [/U] [/V]

Parameters:

        Value   Description

        /A      Perform analysis on the specified volumes.

        /C      Perform the operation on all volumes.

        /E      Perform the operation on all volumes except those specified.

        /H      Run the operation at normal priority (default is low).

        /M      Run the operation on each volume in parallel in the background.

        /T      Track an operation already in progress on the specified volume.

        /U      Print the progress of the operation on the screen.

        /V      Print verbose output containing the fragmentation statistics.

        /X      Perform free space consolidation on the specified volumes.

Examples:

        defrag C: /U /V
        defrag C: D: /M
        defrag C:\mountpoint /A /U
        defrag /C /H /V




Actual results:
as steps.

Expected results:
defrag -L is not supported in win7 and win2008, if there is another fstrim method to support.

Additional info:
1.boot up win2012-r2 guest with the same cmd line.

2.issue fstrim from host
{"execute":"guest-fstrim"}
{"return": {"paths": [{"path": "C:\\"}, {"path": "D:\\"}]}}

3.check event viewer, there is log about defrag which is "The storage optimizer successfully completed retrim on c:".

Comment 2 Sameeh Jubran 2018-06-24 15:39:22 UTC
Can you please confirm that in this build the issue is fixed?

https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=16850812

Comment 3 xiagao 2018-06-25 02:45:04 UTC
(In reply to Sameeh Jubran from comment #2)
> Can you please confirm that in this build the issue is fixed?
> 
> https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=16850812

yes, it is fixed.
# nc -U /tmp/qga-win7 
{"execute":"guest-fstrim"}
{"error": {"class": "GenericError", "desc": "fstrim is only supported for Win8+"}}

Comment 4 xiagao 2018-07-10 07:10:53 UTC
Verified this bug in build mingw-qemu-ga-win-7.6.0-2.el7ev.
virtio-win-prewhql-156

win7-32 guest:
{"execute":"guest-fstrim"}
{"error": {"class": "GenericError", "desc": "fstrim is only supported for Win8+"}}

win10-32 guest:
{"execute":"guest-fstrim"}
{"return": {"paths": [{"path": "C:\\"}, {"path": "S:\\"}]}}

Comment 5 Danilo de Paula 2018-08-21 14:08:54 UTC
Can we have QA, PM and Release flags for this, please?

Comment 7 errata-xmlrpc 2018-10-30 16:21:51 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, 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-2018:3413