Re: [libvirt] [PATCH] Fix error squashing when refreshing file volumes

2009-05-12 Thread Cole Robinson
On 05/11/2009 10:33 AM, Daniel Veillard wrote:
> On Mon, May 11, 2009 at 10:03:24AM -0400, Cole Robinson wrote:
>> When refreshing a file based pool, errors hit when determining a
>> volume's format were being squashed, reporting OOM instead. The attached
>> patch fixes the error reporting here.
> 
>   Looks fine, though if you start to add function comments it would be
> better to have them match the format used in libvirt.c (i.e. one Return
> sentence and description of args and functionality.
> 
>   ACK,
> 
> Daniel
> 

Okay, I committed this, with the comment to match existing convention.

Thanks,
Cole

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


Re: [libvirt] [PATCH] Fix error squashing when refreshing file volumes

2009-05-11 Thread Daniel Veillard
On Mon, May 11, 2009 at 10:03:24AM -0400, Cole Robinson wrote:
> When refreshing a file based pool, errors hit when determining a
> volume's format were being squashed, reporting OOM instead. The attached
> patch fixes the error reporting here.

  Looks fine, though if you start to add function comments it would be
better to have them match the format used in libvirt.c (i.e. one Return
sentence and description of args and functionality.

  ACK,

Daniel

-- 
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
dan...@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

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


Re: [libvirt] [PATCH] Fix error squashing when refreshing file volumes

2009-05-11 Thread Daniel P. Berrange
On Mon, May 11, 2009 at 10:03:24AM -0400, Cole Robinson wrote:
> When refreshing a file based pool, errors hit when determining a
> volume's format were being squashed, reporting OOM instead. The attached
> patch fixes the error reporting here.
> 
> Reported by Jason Guiditta.
> 

ACK.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

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


[libvirt] [PATCH] Fix error squashing when refreshing file volumes

2009-05-11 Thread Cole Robinson
When refreshing a file based pool, errors hit when determining a
volume's format were being squashed, reporting OOM instead. The attached
patch fixes the error reporting here.

Reported by Jason Guiditta.

Thanks,
Cole
diff --git a/src/storage_backend.c b/src/storage_backend.c
index b154140..acdb288 100644
--- a/src/storage_backend.c
+++ b/src/storage_backend.c
@@ -156,6 +156,10 @@ virStorageBackendUpdateVolInfo(virConnectPtr conn,
 return 0;
 }
 
+/*
+ * Return -1 on a legitimate error condition
+ * Return -2 if passed FD isn't a regular, char, or block file.
+ */
 int
 virStorageBackendUpdateVolTargetInfoFD(virConnectPtr conn,
virStorageVolTargetPtr target,
diff --git a/src/storage_backend_fs.c b/src/storage_backend_fs.c
index 92ff3cb..d64b64d 100644
--- a/src/storage_backend_fs.c
+++ b/src/storage_backend_fs.c
@@ -843,7 +843,7 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn,
 &vol->allocation,
 &vol->capacity) < 0)) {
 if (ret == -1)
-goto no_memory;
+goto cleanup;
 else {
 /* Silently ignore non-regular files,
  * eg '.' '..', 'lost+found' */
@@ -883,7 +883,7 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn,
 &vol->backingStore,
 NULL, NULL, NULL)) < 0) {
 if (ret == -1)
-goto no_memory;
+goto cleanup;
 else {
 /* Silently ignore non-regular files,
  * eg '.' '..', 'lost+found' */
--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list