[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 3/3] xen-hvm: try to use xenforeignmemory_map
From: |
Anthony PERARD |
Subject: |
Re: [Qemu-devel] [PATCH v2 3/3] xen-hvm: try to use xenforeignmemory_map_resource() to map ioreq pages |
Date: |
Tue, 15 May 2018 17:16:41 +0100 |
User-agent: |
Mutt/1.9.5 (2018-04-13) |
On Tue, May 15, 2018 at 04:45:25PM +0100, Paul Durrant wrote:
> > > diff --git a/include/hw/xen/xen_common.h
> > b/include/hw/xen/xen_common.h
> > > index 5f1402b494..d925751040 100644
> > > --- a/include/hw/xen/xen_common.h
> > > +++ b/include/hw/xen/xen_common.h
> > > @@ -119,6 +119,20 @@ static inline int
> > xendevicemodel_pin_memory_cacheattr(
> > > return xc_domain_pin_memory_cacheattr(xen_xc, domid, start, end,
> > type);
> > > }
> > >
> > > +typedef void xenforeignmemory_resource_handle;
> > > +
> > > +#define XENMEM_resource_ioreq_server_frame_bufioreq 0
> > > +#define XENMEM_resource_ioreq_server_frame_ioreq(n) (1 + (n))
> > > +
> > > +static inline xenforeignmemory_resource_handle
> > *xenforeignmemory_map_resource(
> > > + xenforeignmemory_handle *fmem, domid_t domid, unsigned int type,
> > > + unsigned int id, unsigned long frame, unsigned long nr_frames,
> > > + void **paddr, int prot, int flags)
> > > +{
> > > + errno = EOPNOTSUPP;
> >
> > I think ENOSYS would be better. EOPNOTSUPP seems to be for sockets.
> >
>
> No, EOPNOTSUPP is more general than that and is convention for unimplemented
> API operations elsewhere. ENOSYS is supposed to strictly mean 'system call
> not implemented' but we use it for hypercalls in Xen, leading to occasional
> fun with Linux checkpatch.pl.
In man errno, I have:
ENOTSUP Operation not supported (POSIX.1-2001)
EOPNOTSUPP Operation not supported on socket (POSIX.1-2001).
ENOSYS Function not implemented (POSIX.1-2001).
But I guess any of these would work.
--
Anthony PERARD
Re: [Qemu-devel] [PATCH v2 0/2] xen-hvm: use new resource mapping API, Paul Durrant, 2018/05/14