This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


RE: [Xen-devel] [PATCH] tools: ocaml: fix the logging in the ocaml libxl

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH] tools: ocaml: fix the logging in the ocaml libxl bindings
From: Dave Scott <Dave.Scott@xxxxxxxxxxxxx>
Date: Thu, 31 Mar 2011 23:57:58 +0100
Accept-language: en-US
Acceptlanguage: en-US
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 31 Mar 2011 15:59:22 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19860.49534.110558.18863@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <67525892e2c6ee27c254.1300913609@ely> <19860.49534.110558.18863@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcvvzavE4aa4450sS5yiUnJCIwocyQAJPDhw
Thread-topic: [Xen-devel] [PATCH] tools: ocaml: fix the logging in the ocaml libxl bindings

> David Scott writes ("[Xen-devel] [PATCH] tools: ocaml: fix the logging
> in the ocaml libxl bindings"):
> > tools: ocaml: fix the logging in the ocaml libxl bindings.
[ snip ]

Ian Jackson replied:
> Thanks, but:
>  * Can you make a version where the line lengths do not exceed 75 ?
>    That allows for a patch +/- column, plus a couple of levels of
>    quoting, to fit in an 80-column window.

Will do. I think I've got into a habit of writing very long lines.
I blame my poor choice in editors and email clients :-)

>  * Now that I read this code I'm very confused.  Why does log_vmessage
>    not actually output the message anywhere ?  Looking at the code,
>    the buffer is printed out only if the call fails (I assume that's
>    what failwith_xl is).  That's not right.  What about debugging
>    output ?
>    There is no guarantee that the logger will be called to report any
>    particular number of messages if a libxl call fails.  Specifically,
>    it may output zero error messages, or several one, before returning
>    a failure code.  And it will frequently output a number of
>    informational messages.

That is indeed the current behaviour -- most log messages end up dropped,
only those which are in the buffer when the libxl call fails get bubbled
up to the user in an exception. The main difference after my patch is
that the code nolonger segfaults after calling (IIRC) gettopologyinfo 
and hopefully won't blow its buffer if the logging ever gets spammy :-)

If you recommend changing the policy to always record/handle all log 
messages then that sounds fine to me. From the point of view of the 
ocaml code I can think of the following options (Vincent: do you have any

1. add the notion of a per-call context to the ocaml and associate 
   logging callbacks with this. The ocaml code can then do whatever it 
   likes on a per-call basis.

2. allow the ocaml to set a global logging callback which would handle
   logging from all ocaml xl calls in the same process

3. allow the ocaml to set some syslog logging parameters so all ocaml xl
   calls would just log via syslog

I don't think any of these are particularly complicated. Anyone have any
thoughts / recommendations / preferences / suggestions?


Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>