[Ovirt-devel] [Patch] better exceptions for ruby-libvirt bindings

Mohammed Morsi mmorsi at redhat.com
Fri Mar 28 01:07:47 UTC 2008


David Lutterkort wrote:
> On Wed, 2008-03-26 at 19:58 -0400, Mohammed Morsi wrote:
>   
>> Defined custom libvirt ruby exceptions and altered the code so as to 
>> throw them instead of the generic 'rb_eSystemCallError'. If additional 
>> more-granular exceptions are needed, they can be easily added.
>>     
>
> The patch looks good, except for some small formatting issues (try to
> keep the lines to < 80 columns, I usually stop at 78)
>   
Gotchya, will do.
>   
>>  (note 
>> this diff is against ruby-libvirt-0.0.2 due to issues with the upstream 
>> ruby-libvirt and libvirt-devel)
>>     
>
> The issue, I assume is that the ruby-libvirt bindings will only build
> against a libvirt with storage API. That really needs to be ifdef'd out;
> one option is to do that function by function: that's so tedious that
> we'll probably need to switch to generating _libvirt.c.
>
> The other option is to just check for certain types (like
> virStoragePoolPtr) and then ifdefing the whole storage API out. I'll
> have a stab at that and hope that it won't make forward porting your
> patch impossible.
>
> David
>
>   
The storage APIs are most likely the problem, I remember seeing related 
errors when I tried compiling the upstream version. If you change it so 
that it works, don't worry about breaking my
patch, it shouldn't take too long to readd it (plus its really simple, 
just the error definitions, instantiations, and usage). One question I 
had was as to the need to pass the virConnectPtr into the _E / vir_error 
methods. It is not used, yet everything passes it in. If there is no 
need for it, can it be removed?

-Mo




More information about the ovirt-devel mailing list