Re: [PATCH 1/9] Add flags argument to virStorageVolDefParse*

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

 



On Wed, Feb 25, 2015 at 09:17:26AM +0100, Peter Krempa wrote:
> On Thu, Feb 19, 2015 at 15:59:09 +0100, Ján Tomko wrote:
> > Allow the callers to pass down libvirt-internal flags.
> > ---
> >  src/conf/storage_conf.c            | 25 ++++++++++++++++---------
> >  src/conf/storage_conf.h            |  9 ++++++---
> >  src/esx/esx_storage_backend_vmfs.c |  4 ++--
> >  src/parallels/parallels_storage.c  |  6 +++---
> >  src/phyp/phyp_driver.c             |  2 +-
> >  src/storage/storage_driver.c       |  4 ++--
> >  src/test/test_driver.c             |  6 +++---
> >  src/vbox/vbox_storage.c            |  2 +-
> >  tests/storagebackendsheepdogtest.c |  2 +-
> >  tests/storagevolxml2argvtest.c     |  4 ++--
> >  tests/storagevolxml2xmltest.c      | 13 ++++++++-----
> >  11 files changed, 45 insertions(+), 32 deletions(-)
> > 
> > diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
> > index e9aaa8a..c8a860b 100644
> > --- a/src/conf/storage_conf.c
> > +++ b/src/conf/storage_conf.c
> > @@ -1245,7 +1245,8 @@ virStorageSize(const char *unit,
> >  
> >  static virStorageVolDefPtr
> >  virStorageVolDefParseXML(virStoragePoolDefPtr pool,
> > -                         xmlXPathContextPtr ctxt)
> > +                         xmlXPathContextPtr ctxt,
> > +                         unsigned long flags)
> 
> Almost every other place in libvirt uses an integer for flags. Why did
> you use a long?
> 

I have absolutely no excuse for the blatant waste of memory and screen space.

> >  {
> >      virStorageVolDefPtr ret;
> >      virStorageVolOptionsPtr options;
> > @@ -1259,6 +1260,8 @@ virStorageVolDefParseXML(virStoragePoolDefPtr pool,
> >      size_t i;
> >      int n;
> >  
> > +    virCheckFlags(0, NULL);
> > +
> >      options = virStorageVolOptionsForPoolType(pool->type);
> >      if (options == NULL)
> >          return NULL;
> 
> ...
> 
> ACK after the release if you explain why you used the "long" type or
> change it to int.

I have changed the type to unsigned int in my local branch.

Jan

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]