Re: [libvirt PATCH v3 00/21] Add support for persistent mediated devices

2020-12-24 Thread Han Han
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. > >

Re: libvirt-lxc: Permission issue of /proc/net

2020-12-24 Thread John Hurnett
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

[libvirt PATCH v3 19/21] api: add virNodeDeviceCreate()

2020-12-24 Thread Jonathon Jongsma
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

[libvirt PATCH v3 15/21] nodedev: refactor tests to support mdev undefine

2020-12-24 Thread Jonathon Jongsma
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

[libvirt PATCH v3 18/21] virsh: add nodedev-undefine command

2020-12-24 Thread Jonathon Jongsma
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

[libvirt PATCH v3 21/21] libvirt-nodedev.h: remove space-padded alignment

2020-12-24 Thread Jonathon Jongsma
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(+),

[libvirt PATCH v3 11/21] nodedev: Refresh mdev devices when changes are detected

2020-12-24 Thread Jonathon Jongsma
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

[libvirt PATCH v3 09/21] nodedev: handle mdevs that disappear from mdevctl

2020-12-24 Thread Jonathon Jongsma
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

[libvirt PATCH v3 07/21] nodedev: add mdevctl devices to node device list

2020-12-24 Thread Jonathon Jongsma
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

[libvirt PATCH v3 16/21] api: add virNodeDeviceUndefine()

2020-12-24 Thread Jonathon Jongsma
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

[libvirt PATCH v3 08/21] nodedev: add helper functions to remove node devices

2020-12-24 Thread Jonathon Jongsma
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

[libvirt PATCH v3 04/21] nodedev: expose internal helper for naming devices

2020-12-24 Thread Jonathon Jongsma
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

[libvirt PATCH v3 14/21] virsh: add nodedev-define command

2020-12-24 Thread Jonathon Jongsma
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

[libvirt PATCH v3 13/21] virsh: Add --active, --inactive, --all to nodedev-list

2020-12-24 Thread Jonathon Jongsma
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

[libvirt PATCH v3 20/21] virsh: add "nodedev-start" command

2020-12-24 Thread Jonathon Jongsma
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

[libvirt PATCH v3 17/21] virsh: Factor out function to find node device

2020-12-24 Thread Jonathon Jongsma
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

[libvirt PATCH v3 10/21] nodedev: rename dataReady to udevReady

2020-12-24 Thread Jonathon Jongsma
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

[libvirt PATCH v3 12/21] api: add virNodeDeviceDefineXML()

2020-12-24 Thread Jonathon Jongsma
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

[libvirt PATCH v3 02/21] nodedev: introduce concept of 'active' node devices

2020-12-24 Thread Jonathon Jongsma
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 ++

[libvirt PATCH v3 05/21] nodedev: add ability to list and parse defined mdevs

2020-12-24 Thread Jonathon Jongsma
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

[libvirt PATCH v3 06/21] nodedev: add STOPPED/STARTED lifecycle events

2020-12-24 Thread Jonathon Jongsma
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

[libvirt PATCH v3 01/21] tests: remove extra trailing semicolon

2020-12-24 Thread Jonathon Jongsma
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

[libvirt PATCH v3 00/21] Add support for persistent mediated devices

2020-12-24 Thread Jonathon Jongsma
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

[libvirt PATCH v3 03/21] nodedev: Add ability to filter by active state

2020-12-24 Thread Jonathon Jongsma
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 |

Re: RFC PATCH: Issue 90 (Test Clarification)

2020-12-24 Thread Peter Krempa
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

Re: [PATCH v2] docs: support qcow2 format in luks encryption volume

2020-12-24 Thread Han Han
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

[PATCH v2] docs: support qcow2 format in luks encryption volume

2020-12-24 Thread Meina Li
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 +++