vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM
[qemu/kevin.git] / include / authz / simple.h
blob2b7ab0cdd9127c242ba4a7ba52d5b000f6cd634f
1 /*
2 * QEMU simple authorization driver
4 * Copyright (c) 2018 Red Hat, Inc.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
21 #ifndef QAUTHZ_SIMPLE_H
22 #define QAUTHZ_SIMPLE_H
24 #include "authz/base.h"
26 #define TYPE_QAUTHZ_SIMPLE "authz-simple"
28 #define QAUTHZ_SIMPLE_CLASS(klass) \
29 OBJECT_CLASS_CHECK(QAuthZSimpleClass, (klass), \
30 TYPE_QAUTHZ_SIMPLE)
31 #define QAUTHZ_SIMPLE_GET_CLASS(obj) \
32 OBJECT_GET_CLASS(QAuthZSimpleClass, (obj), \
33 TYPE_QAUTHZ_SIMPLE)
34 #define QAUTHZ_SIMPLE(obj) \
35 OBJECT_CHECK(QAuthZSimple, (obj), \
36 TYPE_QAUTHZ_SIMPLE)
38 typedef struct QAuthZSimple QAuthZSimple;
39 typedef struct QAuthZSimpleClass QAuthZSimpleClass;
42 /**
43 * QAuthZSimple:
45 * This authorization driver provides a simple mechanism
46 * for granting access based on an exact matched username.
48 * To create an instance of this class via QMP:
50 * {
51 * "execute": "object-add",
52 * "arguments": {
53 * "qom-type": "authz-simple",
54 * "id": "authz0",
55 * "props": {
56 * "identity": "fred"
57 * }
58 * }
59 * }
61 * Or via the command line
63 * -object authz-simple,id=authz0,identity=fred
66 struct QAuthZSimple {
67 QAuthZ parent_obj;
69 char *identity;
73 struct QAuthZSimpleClass {
74 QAuthZClass parent_class;
78 QAuthZSimple *qauthz_simple_new(const char *id,
79 const char *identity,
80 Error **errp);
83 #endif /* QAUTHZ_SIMPLE_H */