On Thu, Dec 24, 2020 at 10:15 PM Jonathon Jongsma
wrote:
> This patch series follows the previously-merged series which added support
> for
> transient mediated devices. This series expands mdev support to include
> persistent device definitions. Again, it relies on mdevctl as the backend.
>
>
Hi Daniel,
My XML has an section. According to documentation
https://libvirt.org/drvlxc.html#securenetworking I have also tried with and
without parameter, but still files under /proc/net is owned by
user: nobody.
As might be expected there is no such problem in privileged containers, as
root
This new API function provides a way to start a persistently-defined
mediate device that was defined by virNodeDeviceDefineXML() (or one that
was defined externally via mdevctl)
Signed-off-by: Jonathon Jongsma
---
include/libvirt/libvirt-nodedev.h| 2 +
src/driver-nodedev.h
mdevctl 'stop' and 'undefine' commands take the same uuid parameter, so
refactor the test infrastructure to share common implementation for both
of these commands. The 'undefine' command will be introduced in a
following patch.
Signed-off-by: Jonathon Jongsma
---
tests/nodedevmdevctltest.c | 48
Add a virsh command that maps to virNodeDeviceUndefine().
Signed-off-by: Jonathon Jongsma
---
tools/virsh-nodedev.c | 65 +++
1 file changed, 65 insertions(+)
diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c
index 5df75013de..97d2a34056 100644
Most of the header files no longer use the space-padded function name
and parameter alignment. Update the style to be more consistent with
other headers.
Signed-off-by: Jonathon Jongsma
---
include/libvirt/libvirt-nodedev.h | 79 ---
1 file changed, 41 insertions(+),
We need to periodically query mdevctl for changes to device definitions
since an administrator can define new devices with mdevctl outside of
libvirt.
In the future, mdevctl may add a way to signal device add/remove via
events, but for now we resort to a bit of a workaround: monitoring the
mdevctl does not currently provide any events when the list of defined
devices changes, so we will need to poll mdevctl for the list of defined
devices periodically. When a mediated device no longer exists from one
iteration to the next, we need to treat it as an "undefine" event.
When we get
At startup, query devices that are defined by 'mdevctl' and add them to
the node device list.
This adds a complication: we now have two potential sources of
information for a node device:
- udev for all devices and for activated mediated devices
- mdevctl for persistent mediated devices
This interface allows you to undefine a persistently defined (but
inactive) mediated devices. It is implemented via 'mdevctl'
Signed-off-by: Jonathon Jongsma
---
include/libvirt/libvirt-nodedev.h| 2 +
src/access/viraccessperm.c | 2 +-
src/access/viraccessperm.h | 6
When a mediated device is stopped or undefined by an application outside
of libvirt, we need to remove it from our list of node devices within
libvirt. This patch introduces virNodeDeviceObjListRemoveLocked() and
virNodeDeviceObjListForEach() (which are analogous to other types of
object lists in
Expose a helper function that can be used by udev and mdevctl to
generate device names for node devices.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 25 +
src/node_device/node_device_driver.h | 6 ++
src/node_device/node_device_udev.c
Add a virsh command that maps to virNodeDeviceDefineXML().
Signed-off-by: Jonathon Jongsma
---
tools/virsh-nodedev.c | 58 +++
1 file changed, 58 insertions(+)
diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c
index e3261747e3..07d48bbfbe 100644
Now that we can filter active and inactive node devices in
virConnectListAllNodeDevices(), add these switches to the virsh command.
Eventual output (once everything is hooked up):
virsh # nodedev-list --inactive --cap mdev
mdev_07d8b8b0_7e04_4c0f_97ed_9214ce12723c
This virsh command maps to virNodeDeviceCreate(), which starts a node
device that has been previously defined by virNodeDeviceDefineXML().
This is only supported for mediated devices.
Signed-off-by: Jonathon Jongsma
---
tools/virsh-nodedev.c | 61 +++
1
Several functions accept providing a node device by name or by wwnn,wwpn
pair. Extract the logic to do this into a function that can be used by
both callers.
Signed-off-by: Jonathon Jongsma
---
tools/virsh-nodedev.c | 58 +--
1 file changed, 28
The udev thread handles received udev events. This is accomplished by
setting dataReady to 'true' and signalling the thread.
We also want to use this thread to handle mdev events, so we'll need to
add another variable to indicate which event has woken the thread. To
prepare for this, rename
With mediated devices, we can now define persistent node devices that
can be started and stopped. In order to take advantage of this, we need
an API to define new node devices.
Signed-off-by: Jonathon Jongsma
---
include/libvirt/libvirt-nodedev.h | 4 +
src/driver-nodedev.h
we will be able to define mediated devices that can be started or
stopped, so we need to be able to indicate whether the device is active
or not, similar to other resources (storage pools, domains, etc.)
Signed-off-by: Jonathon Jongsma
---
src/conf/virnodedeviceobj.c| 14 ++
This adds some internal API to query for persistent mediated devices
that are defined by mdevctl. Following commits will make use of this
information. This just provides the infrastructure and tests for this
feature. One test verifies that we are executing mdevctl with the proper
arguments, and
Since a mediated device can be persistently defined by the mdevctl
backend, we need additional lifecycle events beyond CREATED/DELETED to
indicate that e.g. the device has been stopped but the device definition
still exists.
Signed-off-by: Jonathon Jongsma
---
examples/c/misc/event-test.c
The macro should not have a trailing semicolon so that when the macro is
used, the user can add a semicolon themselves.
Signed-off-by: Jonathon Jongsma
---
tests/nodedevmdevctltest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/nodedevmdevctltest.c
This patch series follows the previously-merged series which added support for
transient mediated devices. This series expands mdev support to include
persistent device definitions. Again, it relies on mdevctl as the backend.
It follows the common libvirt pattern of APIs by adding the following
Add two flag values for virConnectListAllNodeDevices() so that we can
list only node devices that are active or inactive.
Signed-off-by: Jonathon Jongsma
---
include/libvirt/libvirt-nodedev.h| 9 +++--
src/conf/node_device_conf.h | 8
src/conf/virnodedeviceobj.c |
On Wed, Dec 23, 2020 at 14:28:04 -0600, Ryan Gahagan wrote:
> On Wed, Dec 23, 2020 at 11:45 AM Peter Krempa wrote:
>
> > For this test,
> > you'll be better off adding a hack to fill in the uid/gid values (e.g.
> > by checking that they start with a + to be safe.
>
>
> Our interpretation of
On Thu, Dec 24, 2020 at 5:32 PM Meina Li wrote:
> Signed-off-by: Meina Li
> ---
> docs/formatstorageencryption.html.in | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/docs/formatstorageencryption.html.in b/docs/
> formatstorageencryption.html.in
> index
Signed-off-by: Meina Li
---
docs/formatstorageencryption.html.in | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/docs/formatstorageencryption.html.in
b/docs/formatstorageencryption.html.in
index ea80a87cfb..7215c307d7 100644
--- a/docs/formatstorageencryption.html.in
+++
27 matches
Mail list logo