From: Wei Liu Subject: Re: [PATCH 4/5] libxc: minios: Introduce abstraction for files[] Date: Thu, 26 Feb 2015 12:56:05 +0000 Message-ID: <20150226125605.GE1824@zion.uk.xensource.com> References: <1424951781-14935-1-git-send-email-wei.liu2@citrix.com> <1424951781-14935-5-git-send-email-wei.liu2@citrix.com> <54EF15F3.8000608@suse.com> 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: <54EF15F3.8000608@suse.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: =?iso-8859-1?Q?J=FCrgen_Gro=DF?= Cc: Ian Jackson , Wei Liu , ian.campbell@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, Feb 26, 2015 at 01:47:47PM +0100, J=FCrgen Gro=DF wrote: > On 02/26/2015 12:56 PM, Wei Liu wrote: > >From: Ian Jackson > > > >We are going to want to reuse this code for NetBSD rump kernels, where > >there is no gntmap device and we just want to call the MiniOS gntmap > >code directly. > > > >As part of this we want to abstract away the use of files[] inside the > >actual functions. Do this with a #define whose definition we are > >going to make conditional in just a moment. > > > >No functional change in this patch. > > > >Signed-off-by: Ian Jackson > >--- > > tools/libxc/xc_minios_privcmd.c | 15 +++++++-------- > > 1 file changed, 7 insertions(+), 8 deletions(-) > > > >diff --git a/tools/libxc/xc_minios_privcmd.c b/tools/libxc/xc_minios_pri= vcmd.c > >index 7766b86..27d9076 100644 > >--- a/tools/libxc/xc_minios_privcmd.c > >+++ b/tools/libxc/xc_minios_privcmd.c > >@@ -208,12 +208,14 @@ struct xc_osdep_ops xc_privcmd_ops =3D { > > }, > > }; > > > >+#define GNTMAP(h) (files[(int)(h)].gntmap) > >+ > > static xc_osdep_handle minios_gnttab_open(xc_gnttab *xcg) > > { > > int fd =3D alloc_fd(FTYPE_GNTMAP); > > if ( fd =3D=3D -1 ) > > return XC_OSDEP_OPEN_ERROR; > >- gntmap_init(&files[fd].gntmap); > >+ gntmap_init(&GNTMAP(h)); > = > GNTMAP(fd)? > = > Same multiple times below. > = Good catch. I will fix this, thanks. Wei.