Bug 1866157

Summary: Build dir pool failed since try to control COW flag without btrfs
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: gaojianan <jgao>
Component: libvirtAssignee: Jiri Denemark <jdenemar>
Status: CLOSED ERRATA QA Contact: gaojianan <jgao>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.3CC: jdenemar, lcheng, lmen, mzhan, virt-maint, weizhan, yanqzhan
Target Milestone: rcKeywords: Automation, Triaged
Target Release: 8.3   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-6.6.0-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1870197 (view as bug list) Environment:
Last Closed: 2020-11-17 17:50:26 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: 1870197    

Description gaojianan 2020-08-05 02:42:12 UTC
Description of problem:
Build dir pool failed since try to control COW flag without btrfs filesystem

Version-Release number of selected component (if applicable):
libvirt-6.6.0-1.module+el8.3.0+7556+0e164df2.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a dir pool xml and define it
# cat pool.xml
<pool type='dir'>
  <name>virsh_pool_test</name>
  <uuid>46eb05db-442e-42f6-b229-855c91a9bb34</uuid>
  <capacity unit='bytes'>53660876800</capacity>
  <allocation unit='bytes'>31874580480</allocation>
  <available unit='bytes'>21786296320</available>
  <source>
  </source>
  <target>
    <path>/var/tmp/avocado_huyf7ozz/dir-pool</path>
    <permissions>
      <mode>0711</mode>
      <owner>0</owner>
      <group>0</group>
      <label>system_u:object_r:virt_tmp_t:s0</label>
    </permissions>
  </target>
</pool>

2.Try to build this pool
# virsh pool-build virsh_pool_test 
error: Failed to build pool virsh_pool_test
error: unable to control COW flag on '/var/tmp/avocado_huyf7ozz/dir-pool', not btrfs: Function not implemented

3.

Actual results:
Failed to build pool as step2

Expected results:
Successfully created pool target path

Additional info:
This problem may point to the new commit 7230bc95aa78379c9ee20cf59394c5fc4305b75b which is mainly for btrfs filesystem but also has a influence with existed logic now.

Comment 1 Jiri Denemark 2020-08-05 08:34:54 UTC
Patch sent upstream for review
  
  https://www.redhat.com/archives/libvir-list/2020-August/msg00259.html

Comment 2 Jiri Denemark 2020-08-05 09:06:35 UTC
Fixed upstream by

commit 2edd63a0dbd445112db23596ee0128521e8f1ff5
Refs: v6.6.0-488-g2edd63a0db
Author:     Jiri Denemark <jdenemar>
AuthorDate: Wed Aug 5 10:01:45 2020 +0200
Commit:     Jiri Denemark <jdenemar>
CommitDate: Wed Aug 5 11:04:17 2020 +0200

    util: Fix logic in virFileSetCOW

    When COW is not explicitly requested to be disabled or enabled, the
    function is supposed to do nothing on non-BTRFS file systems.

    Fixes commit 7230bc95aa78379c9ee20cf59394c5fc4305b75b.

    https://bugzilla.redhat.com/show_bug.cgi?id=1866157

    Signed-off-by: Jiri Denemark <jdenemar>
    Reviewed-by: Daniel P. Berrangé <berrange>

Comment 5 gaojianan 2020-08-07 01:36:27 UTC
Verified at libvirt version:
libvirt-6.6.0-2.module+el8.3.0+7567+dc41c0a9.x86_64

1.Prepare a dir pool xml and define it
# cat pool.xml
<pool type='dir'>
  <name>virsh_pool_test</name>
  <uuid>46eb05db-442e-42f6-b229-855c91a9bb34</uuid>
  <capacity unit='bytes'>53660876800</capacity>
  <allocation unit='bytes'>31874580480</allocation>
  <available unit='bytes'>21786296320</available>
  <source>
  </source>
  <target>
    <path>/var/tmp/avocado_huyf7ozz/dir-pool</path>
    <permissions>
      <mode>0711</mode>
      <owner>0</owner>
      <group>0</group>
      <label>system_u:object_r:virt_tmp_t:s0</label>
    </permissions>
  </target>
</pool>

2.Try to build this pool
# virsh pool-define pool.xml
Pool virsh_pool_test defined from pool.xml

# virsh pool-build virsh_pool_test 
Pool virsh_pool_test built

# virsh pool-start virsh_pool_test 
Pool virsh_pool_test started


Work as expected , so verified.

Comment 8 errata-xmlrpc 2020-11-17 17:50:26 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 (virt:8.3 bug fix and enhancement update), 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-2020:5137