Re: [PATCH 08/13] Replace use of virStorageReportError with virReportError

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

 



On Wed, Jul 18, 2012 at 12:05:20PM -0600, Eric Blake wrote:
> On 07/18/2012 05:52 AM, Daniel P. Berrange wrote:
> > From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> > 
> > Update the storage driver to use virReportError instead of
> > the virStorageReportError custom macro
> > 
> > Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> > ---
> 
> Still big, but not as big as 7/13.  Again, mostly mechanical, and I
> didn't spot any blatant problems.
> 
> ACK.
> 
> > +++ b/src/storage/storage_backend_rbd.c
> > @@ -145,8 +145,8 @@ static int virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr *ptr,
> >                                pool->def->source.hosts[i].name,
> >                                pool->def->source.hosts[i].port);
> >          } else {
> > -            virStorageReportError(VIR_ERR_INTERNAL_ERROR,
> > -                                  _("received malformed monitor, check the XML definition"));
> > +            virReportError(VIR_ERR_INTERNAL_ERROR,
> > +                           _("received malformed monitor, check the XML definition"));
> 
> Another case of missing "%s", worth a separate cleanup patch.  [hmm,
> wonder how hard it would be to make cfg.mk detect a message without a
> '%' as part of syntax-check, rather than the current approach of
> building with NLS disabled to trigger a gcc warning]

I've pushed a fix for this bug /before/ applying this change.


> > +++ b/src/storage/storage_driver.c
> > @@ -475,7 +475,7 @@ static int storagePoolIsActive(virStoragePoolPtr pool)
> >      obj = virStoragePoolObjFindByUUID(&driver->pools, pool->uuid);
> >      storageDriverUnlock(driver);
> >      if (!obj) {
> > -        virStorageReportError(VIR_ERR_NO_STORAGE_POOL, NULL);
> > +        virReportError(VIR_ERR_NO_STORAGE_POOL, NULL);
> 
> While this still gives a working error message, it's pretty weak, and
> I've noticed that at least on FreeBSD, the gcc version tends to issue
> warnings about a NULL format string.

Yeah, there are quite a few areas of the code which pass a NULL
error string that I've seen. Another thing to put on the TODO
list....



Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
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]