[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2-resend 10/30] libxc: ocaml: add simple binding for xentoollog (output only).
Rob Hoes writes ("RE: [Xen-devel] [PATCH v2-resend 10/30] libxc: ocaml: add simple binding for xentoollog (output only)."): > [Ian Jackson:] > > Rob Hoes writes ("[Xen-devel] [PATCH v2-resend 10/30] libxc: ocaml: add > > This (and the next two stanzas too) needs to be autogenerated somehow > > from the list in xentoollog.h. Otherwise people will add levels in > > xentoollog.h and the ocaml code will go wrong. > > This would have been quite easy if the debug levels were part of the libxl > IDL. Unfortunately they aren't, because xentoollog is part of libxc. So what > options do we have? Adding some sort of IDL to libxc would be one. Or indeed > parsing xentoollog.h to derive the log levels, but I think the risk of that > going wrong due to changes in xentoollog.h may defeat its purpose. I think we can promise not to break the syntax too badly. Please do parse the information out of xentoollog.h. > > > +let create name cbs : handle = > > > + (* Callback names are supposed to be unique *) > > > + let suffix = string_of_int (Random.int 1000000) in > > > > Surely this can't be a good way to go about it. > > (Won't this fail at least one time in 1E6 ?) > > Most likely this function would be called just once, or at most a few times, > in the lifetime of the application, so it won't be that bad. But it would > probably be better to just use a counter instead of a random value, and raise > a proper exception when we hit 1e6 (or some other larger number). Yes. Or one 64-bit counter. > > Why are you reimplementing in ocaml the stdio logging support from > > xenttoollog ? Surely you'd want to simply call > > xtl_createlogger_stdiostream ? > > I suppose we could do that indeed. Yes :-). Unless there's some reason not to do that, that I'm missing. Thanks, Ia. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |