On Mon, 2012-01-16 at 16:09 +0000, Ian Jackson wrote:
> Ian Campbell writes ("[Xen-devel] [PATCH 23 of 32 RFC] libxl: use libxl_*_init internally too"):
> > libxl: use libxl_*_init internally too
> ...
> > + ret = libxl_device_vfb_init(CTX, vfb);
> > + if (ret) return ret;
>
> Can we make these init functions infallible ? (I haven't read
> their code yet...)
I think the reason is that sometimes they might allocate memory. Many of
them don't (I don't know about vfb in particular) and I don't know
whether we prefer consistency in similar functions or avoiding pointless
return values (I prefer the former so as to avoid needing to change the
public API in the future when we find that we have introduced a way for
a function to fail).
Possibly in the new world order (where init ~= memset and setdefaults
does thework) this will no longer be the case, but then the same will
become true of the setdefaults function.
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
> Ian Campbell writes ("[Xen-devel] [PATCH 23 of 32 RFC] libxl: use libxl_*_init internally too"):
> > libxl: use libxl_*_init internally too
> ...
> > + ret = libxl_device_vfb_init(CTX, vfb);
> > + if (ret) return ret;
>
> Can we make these init functions infallible ? (I haven't read
> their code yet...)
I think the reason is that sometimes they might allocate memory. Many of
them don't (I don't know about vfb in particular) and I don't know
whether we prefer consistency in similar functions or avoiding pointless
return values (I prefer the former so as to avoid needing to change the
public API in the future when we find that we have introduced a way for
a function to fail).
Possibly in the new world order (where init ~= memset and setdefaults
does thework) this will no longer be the case, but then the same will
become true of the setdefaults function.
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel