Bug 1870197 - Build dir pool failed since try to control COW flag without btrfs
Summary: Build dir pool failed since try to control COW flag without btrfs
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 33
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1866157
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-19 14:07 UTC by Neal Gompa
Modified: 2023-03-09 11:10 UTC (History)
19 users (show)

Fixed In Version:
Clone Of: 1866157
Environment:
Last Closed: 2020-08-21 12:15:33 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Neal Gompa 2020-08-19 14:07:20 UTC
+++ This bug was initially created as a clone of Bug #1866157 +++

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.

--- Additional comment from Jiri Denemark on 2020-08-05 04:34:54 EDT ---

Patch sent upstream for review
  
  https://www.redhat.com/archives/libvir-list/2020-August/msg00259.html

--- Additional comment from Jiri Denemark on 2020-08-05 05:06:35 EDT ---

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>

--- Additional comment from gaojianan on 2020-08-06 21:36:27 EDT ---

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 1 Daniel Berrangé 2020-08-21 12:15:33 UTC
Built into libvirt-6.6.0-2.fc33


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