Mohammed Morsi
2008-Mar-26 23:58 UTC
[Ovirt-devel] [Patch] better exceptions for ruby-libvirt bindings
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. (note this diff is against ruby-libvirt-0.0.2 due to issues with the upstream ruby-libvirt and libvirt-devel) -------------- next part -------------- A non-text attachment was scrubbed... Name: _libvirt.c.patch Type: text/x-patch Size: 22489 bytes Desc: not available URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20080326/613c7e5d/attachment.bin>
David Lutterkort
2008-Mar-27 16:14 UTC
[Ovirt-devel] [Patch] better exceptions for ruby-libvirt bindings
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)> (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