Bug 1234150

Summary: After a recent upgrade, building a storage pool fails if the directory already exists
Product: [Community] Virtualization Tools Reporter: killyourtv
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: crobinso, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-10 21:26:34 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:

Description killyourtv 2015-06-21 17:53:00 UTC
Description of problem:
After a recent libvirt update, ruby code that we use to build a storage pool now fails. This worked prior to the update. Specifying the BUILD_NO_OVERWRITE or BUILD_OVERWRITE flags when building the pool do not help.

Version-Release number of selected component (if applicable):
Debian package version 1.2.16-2. Ruby bindings are at version 0.5.1-3+b2. The breakage was seen when libvirt was updated.


How reproducible:
Every time

Steps to Reproduce:
1. Using the ruby bindings, try to build a pool when the storage path already exists. 
2.
3.

Actual results:
Fails with 

Call to virStoragePoolBuild failed: failed to create directory '/home/kytv/git/tails/tmp/TailsToasterStorage': File exists (Libvirt::Error)


Expected results:
Continuing as it previously did.

Additional info:

The code we're using (which used to work) can be found at https://git-tails.immerda.ch/tails/tree/features/support/helpers/storage_helper.rb

In our codebase, I've tried using 

    pool.build(Libvirt::StoragePool::BUILD_NO_OVERWRITE)

and 

    pool.build(Libvirt::StoragePool::BUILD_OVERWRITE)

and it still fails.

Tails has a bug for this problem at https://labs.riseup.net/code/issues/9568

Comment 1 Cole Robinson 2016-04-10 21:26:34 UTC
This was fixed by:

commit 60d5ed8c520462fd8fbc2d8dfac7b7c16ae5eb51
Author: Christophe Fergeau <cfergeau>
Date:   Fri Jul 17 10:02:20 2015 +0200

    storage: Fix pool building when directory already exists