Bug 928197 - virsh domfstrim will get uncorrelated error
virsh domfstrim will get uncorrelated error
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.0
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Michal Privoznik
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-27 02:21 EDT by EricLee
Modified: 2014-06-17 20:46 EDT (History)
4 users (show)

See Also:
Fixed In Version: libvirt-1.0.5-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 08:46:41 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description EricLee 2013-03-27 02:21:12 EDT
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 11:20:36 EDT
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2013-April/msg00131.html
Comment 3 Michal Privoznik 2013-04-02 11:37:11 EDT
Moving to POST:

commit deb86ee9123ef47dce80dd77a9bc583f2b0214db
Author:     Michal Privoznik <mprivozn@redhat.com>
AuthorDate: Tue Apr 2 17:18:30 2013 +0200
Commit:     Michal Privoznik <mprivozn@redhat.com>
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 06:56:47 EDT
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 08:46:41 EDT
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.