Re: [PATCH 3/4] storage: Add created to virDirCreate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 07, 2015 at 19:44:21 -0400, John Ferlan wrote:
> On 10/07/2015 02:50 AM, Peter Krempa wrote:
> > On Tue, Oct 06, 2015 at 18:34:55 -0400, John Ferlan wrote:
> >> Add a new boolean 'created' to virDirCreate to be set when a directory
> >> is created either directly or in a fork'd child.  This will allow
> >> a caller to make "decisions" regarding whether or not to delete the
> >> directory since virDirCreate has many other failure scenarios and there's
> >> no guarantee that the mkdir was the cause for failure.
> > 
> > Is there actually a need to pass the 'created' bool out? Can't the
> > function just delete the directory internally in case a failure happens?
> > 
> > The new semantics basically would be:
> > 
> > virDirCreate was successful -> we have a new dir we can use
> > virDirCreate failed -> nothing to do/clean up
> > 
> 
> Perhaps there's no "need" to pass a create boolean - I was merely
> following up on Michal's suggestion. I guess I assumed it was a
> suggestion discussed among those in the Brno office.

I've read that thread now. Michal's suggestion may still be necessary at
the storage driver API level as at that point the stuff seems to be too
convoluted. 
I'm unhappy though that the 'created' boolean crept into functions,
whose only purpose is to actually create a directory/file.
The "we've returned failure, but the object actually was created by us"
semantics seems rather weird at that point.

I'd still prefer if the function would clean up internally if possible
though.

Peter

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]