mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
My recent patch [1] to the Linux privcmd module introduced a mechanism to restrict an open file handle to subsequently only accept operations for a specified domain. This patch extends the libxendevicemodel API and make use of the mechanism in the Linux-specific code to restrict operations on the interface handle. [1] https://git.kernel.org/cgit/linux/kernel/git/ostr/linux.git/commit/?id=4610d240 Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Acked-by: Wei Liu <wei.liu2@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
55 lines
1.4 KiB
C
55 lines
1.4 KiB
C
/*
|
|
* Copyright (c) 2017 Citrix Systems Inc.
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation;
|
|
* version 2.1 of the License.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#include <errno.h>
|
|
|
|
#include "private.h"
|
|
|
|
int osdep_xendevicemodel_open(xendevicemodel_handle *dmod)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
int osdep_xendevicemodel_close(xendevicemodel_handle *dmod)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
int osdep_xendevicemodel_op(xendevicemodel_handle *dmod,
|
|
domid_t domid, unsigned int nr_bufs,
|
|
struct xendevicemodel_buf bufs[])
|
|
{
|
|
return xendevicemodel_xcall(dmod, domid, nr_bufs, bufs);
|
|
}
|
|
|
|
int osdep_xendevicemodel_restrict(xendevicemodel_handle *dmod,
|
|
domid_t domid)
|
|
{
|
|
errno = EOPNOTSUPP;
|
|
return -1;
|
|
}
|
|
|
|
/*
|
|
* Local variables:
|
|
* mode: C
|
|
* c-file-style: "BSD"
|
|
* c-basic-offset: 4
|
|
* tab-width: 4
|
|
* indent-tabs-mode: nil
|
|
* End:
|
|
*/
|