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 928197 - virsh domfstrim will get uncorrelated error
Summary: virsh domfstrim will get uncorrelated error
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-27 06:21 UTC by EricLee
Modified: 2014-06-18 00:46 UTC (History)
4 users (show)

Fixed In Version: libvirt-1.0.5-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 12:46:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description EricLee 2013-03-27 06:21:12 UTC
Description of problem:
virsh domfstrim will get uncorrelated error

Version-Release number of selected component (if applicable):
# rpm -qa libvirt qemu-kvm virt-manager kernel
kernel-3.7.0-0.36.el7.x86_64
virt-manager-0.9.4-4.el7.noarch
libvirt-1.0.3-1.el7.x86_64
qemu-kvm-1.4.0-1.el7.x86_64

Reproduce steps:
1. prepare a guest with qemu-guest-agent installed and start the qemu-guest-agent.service, guest xml should include:
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/r7.agent'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0'
      port='2'/>
    </channel>

2. # virsh domfstrim r7

error: Failed to disconnect from the hypervisor, 1 leaked
reference(s)

# echo $?
0

From # virsh help domfstrim
...
  SYNOPSIS
    domfstrim <domain> [--minimum <number>] [<mountpoint>]
...

We can see those two options are both not requisite, and should have
default values if needed, furthermore the error info is indeed
uncorrelated and unnecessary.

And we can see from # man virsh
...
domfstrim domain [--minimum bytes] [--mountpoint mountPoint]
           Issue a fstrim command on all mounted filesystems within a running domain. It discards blocks which are not in
           use by the filesystem.  If --minimum bytes is specified, it tells guest kernel length of contiguous free
           range. Smaller than this may be ignored (this is a hint and the guest may not respect it). By increasing this
           value, the fstrim operation will complete more quickly for filesystems with badly fragmented free space,
           although not all blocks will be discarded.  The default value is zero, meaning "discard every free block".
           Moreover, a if user wants to trim only one mount point, it can be specified via optional --mountpoint            ---there is a typeset error here "a if user"
           parameter.
...

There is a default value zero for "--minimum" and if user wants to trim only one mount point, then can add --mountpoint.

Actual results:
As steps.

Expected results:
Step 2 should not get that uncorrelated error.

Additional info:

Comment 2 Michal Privoznik 2013-04-02 15:20:36 UTC
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2013-April/msg00131.html

Comment 3 Michal Privoznik 2013-04-02 15:37:11 UTC
Moving to POST:

commit deb86ee9123ef47dce80dd77a9bc583f2b0214db
Author:     Michal Privoznik <mprivozn>
AuthorDate: Tue Apr 2 17:18:30 2013 +0200
Commit:     Michal Privoznik <mprivozn>
CommitDate: Tue Apr 2 17:36:06 2013 +0200

    virsh: Call virDomainFree in cmdDomFSTrim
    
    https://bugzilla.redhat.com/show_bug.cgi?id=928197
    
    The virsh domfstrim command was not freeing allocated domain,
    leaving leaked references behind.

v1.0.4-19-gdeb86ee

Comment 4 EricLee 2013-05-06 10:56:47 UTC
Verified pass in libvirt-1.0.5-1.el7.x86_64:

# virsh dumpxml r7
....
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/r7.agent'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <alias name='channel1'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>
    </channel>
....

# virsh domfstrim r7

# echo $?
0

No error like:
error: Failed to disconnect from the hypervisor, 1 leaked
reference(s)

Setting VERIFIED.

Comment 5 Ludek Smid 2014-06-13 12:46:41 UTC
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.


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