Bug 1475227 - 'pool-build' event can not be listened by 'pool-event'
'pool-build' event can not be listened by 'pool-event'
Status: VERIFIED
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.4
x86_64 Linux
unspecified Severity unspecified
: rc
: ---
Assigned To: Michal Privoznik
jiyan
: Upstream
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-26 04:43 EDT by jiyan
Modified: 2017-11-07 05:45 EST (History)
7 users (show)

See Also:
Fixed In Version: libvirt-3.8.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description jiyan 2017-07-26 04:43:42 EDT
Description of problem:
'pool-build' event can not be listened by 'pool-event'

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.9.0-16.el7_4.3.x86_64
kernel-3.10.0-693.el7.x86_64
libvirt-3.2.0-14.el7_4.2.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a xml file to define a pool
# cat pool.xml 
<pool type='dir'>
  <name>test</name>
  <capacity unit='bytes'>160982630400</capacity>
  <allocation unit='bytes'>63092301824</allocation>
  <available unit='bytes'>97890328576</available>
  <source>
  </source>
  <target>
    <path>/home/test</path>
    <permissions>
      <mode>0711</mode>
      <owner>0</owner>
      <group>0</group>
      <label>system_u:object_r:virt_image_t:s0</label>
    </permissions>
  </target>
</pool>

2.Define pool
Terminal 1:
# virsh pool-event --event lifecycle

Terminal 2:
# virsh pool-define pool.xml 
Pool test defined from pool.xml

Check Terminal 1:
# virsh pool-event --event lifecycle
event 'lifecycle' for storage pool test: Defined
events received: 1

3.Build pool
Terminal 1:
# virsh pool-event --event lifecycle

Terminal 2:
# virsh pool-build test
Pool test built

Check Terminal 1:
# virsh pool-event --event lifecycle
                   <--- nothing displayed

Actual results:
As step 3 shows.

Expected results:
'pool-build' should be listened by 'pool-event'

Additional info:
Comment 2 Michal Privoznik 2017-09-20 05:59:41 EDT
commit b06521928cca0b55987bdc49360f8d78a56feb04
Author:     Julio Faracco <jcfaracco@gmail.com>
AuthorDate: Sat Sep 9 12:09:49 2017 -0300
Commit:     Michal Privoznik <mprivozn@redhat.com>
CommitDate: Wed Sep 20 11:52:56 2017 +0200

    storage: Add new events for *PoolBuild() and *PoolDelete().
    
    This commit adds new events for two methods and operations: *PoolBuild() and
    *PoolDelete(). Using the event-test and the commands set below we have the
    following outputs:
    
    $ sudo ./event-test
    Registering event callbacks
    myStoragePoolEventCallback EVENT: Storage pool test Defined 0
    myStoragePoolEventCallback EVENT: Storage pool test Created 0
    myStoragePoolEventCallback EVENT: Storage pool test Started 0
    myStoragePoolEventCallback EVENT: Storage pool test Stopped 0
    myStoragePoolEventCallback EVENT: Storage pool test Deleted 0
    myStoragePoolEventCallback EVENT: Storage pool test Undefined 0
    
    Another terminal:
    $ sudo virsh pool-define test.xml
    Pool test defined from test.xml
    
    $ sudo virsh pool-build test
    Pool test built
    
    $ sudo virsh pool-start test
    Pool test started
    
    $ sudo virsh pool-destroy test
    Pool test destroyed
    
    $ sudo virsh pool-delete test
    Pool test deleted
    
    $ sudo virsh pool-undefine test
    Pool test has been undefined
    
    This commits can be a solution for RHBZ #1475227.
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1475227
    
    Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>

v3.7.0-136-gb06521928
Comment 4 jiyan 2017-10-11 05:50:45 EDT
Test env components:
kernel-3.10.0-731.el7.x86_64
libvirt-3.8.0-1.el7.x86_64
qemu-kvm-rhev-2.9.0-16.el7_4.9.x86_64

Test scenario:
1.Prepare a xml file to define a pool
# cat pool.xml 
<pool type='dir'>
  <name>test</name>
  <capacity unit='bytes'>160982630400</capacity>
  <allocation unit='bytes'>63092301824</allocation>
  <available unit='bytes'>97890328576</available>
  <source>
  </source>
  <target>
    <path>/home/test</path>
    <permissions>
      <mode>0711</mode>
      <owner>0</owner>
      <group>0</group>
      <label>system_u:object_r:virt_image_t:s0</label>
    </permissions>
  </target>
</pool>

2.Define pool
Terminal 1:
# virsh pool-event --event lifecycle

Terminal 2:
# virsh pool-define pool.xml 
Pool test defined from pool.xml

Check Terminal 1:
# virsh pool-event --event lifecycle
event 'lifecycle' for storage pool test: Defined
events received: 1

3. Build pool
Terminal 1:
# virsh pool-event --event lifecycle
 
Terminal 2:
# virsh pool-build test
Pool test built

Check Terminal 1:
# virsh pool-event --event lifecycle
event 'lifecycle' for storage pool test: Created
events received: 1

4. Start pool
Terminal 1:
# virsh pool-event --event lifecycle
 
Terminal 2:
# virsh pool-start test
Pool test started

Check Terminal 1:
# virsh pool-event --event lifecycle
event 'lifecycle' for storage pool test: Started
events received: 1


5. Destroy pool
Terminal 1:
# virsh pool-event --event lifecycle
 
Terminal 2:
# virsh pool-destroy test
Pool test destroyed

Check Terminal 1:
# virsh pool-event --event lifecycle
event 'lifecycle' for storage pool test: Stopped
events received: 1

6. Delete pool
Terminal 1:
# virsh pool-event --event lifecycle

Terminal 2:
# virsh pool-delete test
Pool test deleted

Check Terminal 1:
# virsh pool-event --event lifecycle
event 'lifecycle' for storage pool test: Deleted
events received: 1

7. Undefine pool
Terminal 1:
# virsh pool-event --event lifecycle
 
Terminal 2:
# virsh pool-undefine test
Pool test has been undefined

Check Terminal 1:
# virsh pool-event --event lifecycle
event 'lifecycle' for storage pool test: Undefined
events received: 1

All the results are as expected, move this bug to be verified.

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