From: Samuel Thibault Subject: Re: [Minios-devel] [PATCH MINI-OS v2] xenbus: notify the other end when necessary Date: Tue, 27 Oct 2015 17:03:32 +0100 Message-ID: <20151027160332.GA2931@var.bordeaux.inria.fr> References: <1445863676-14874-1-git-send-email-wei.liu2@citrix.com> <20151026125247.GP19459@var.bordeaux.inria.fr> <20151026135531.GG13118@zion.uk.xensource.com> <20151026163001.GF18602@var.bordeaux.inria.fr> <22062.21898.162478.153744@mariner.uk.xensource.com> <20151026163751.GH18602@var.bordeaux.inria.fr> <20151026164115.GE19925@zion.uk.xensource.com> <20151026171104.GJ18602@var.bordeaux.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <20151026171104.GJ18602@var.bordeaux.inria.fr> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Liu , Ian Jackson , minios-devel@lists.xenproject.org, Xen-devel , Ian Campbell List-Id: xen-devel@lists.xenproject.org Samuel Thibault, le Mon 26 Oct 2015 18:11:04 +0100, a =E9crit : > diff --git a/tools/ocaml/libs/xb/xb.ml b/tools/ocaml/libs/xb/xb.ml > index 50944b5..33298d2 100644 > --- a/tools/ocaml/libs/xb/xb.ml > +++ b/tools/ocaml/libs/xb/xb.ml > @@ -91,10 +91,12 @@ let write_fd back con s len =3D > Unix.write back.fd s 0 len > = > let write_mmap back con s len =3D > - let ws =3D Xs_ring.write back.mmap s len in > - if ws > 0 then > + let ws =3D ref (Xs_ring.write back.mmap s len) in > + if !ws < len then > + ws :=3D !ws + Xs_ring.write back.mmap (String.sub s !ws (len-!ws)) (le= n-!ws); > + if !ws > 0 then > back.eventchn_notify (); > - ws > + !ws > = > let write con s len =3D > match con.backend with Signed-off-by: Samuel Thibault Not-tested-by: Samuel Thibault Not-even-compiled-by: Samuel Thibault Samuel