On Thu, 22 Apr 2021 13:40:53 +0200
Ján Tomko wrote:
> Provide an exmple in a place more visible than formatdomain.html.
>
> Signed-off-by: Ján Tomko
> ---
> docs/kbase/virtiofs.rst | 14 ++
> 1 file changed, 14 insertions(+)
>
> diff --git a/docs/kbase/virtiofs.rst
When returning early due to errors, cmd will be leaked. Use an autoptr
to handle these early returns without leaking memory.
Signed-off-by: Jonathon Jongsma
Reviewed-by: Michal Privoznik
---
src/node_device/node_device_driver.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff
Coverity complained that the 'default' case of the switch in
nodeDeviceGetMdevctlCommand() was falling through without initializing
'cmd'. Return NULL in this case even though it should never happen.
Signed-off-by: Jonathon Jongsma
Reviewed-by: Michal Privoznik
---
src/node_device
virCommandRun() already handles the case where the cmd argument is NULL,
so there's no need for the caller to check. Make all callers consistent
and remove unnecessary NULL checks.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 6 --
1 file changed, 6 deletions
handled it, but some didn't.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/node_device/node_device_driver.c
b/src/node_device/node_device_driver.c
index e565cc29ec..c1fe9db149 100644
When returning early due to errors, cmd will be leaked. Use an autoptr
to handle these early returns without leaking memory.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/node_device
On Mon, 19 Apr 2021 14:16:59 +0200
Michal Privoznik wrote:
> On 4/18/21 10:08 AM, Gavi Teitz wrote:
> > Hi,
> >
> > The page-per-vq flag is important for vdpa with vhost-user
> > performance [1].
> >
> > Currently there is no way in libvirt to set it in the xml
> > page-per-vq except with qemu
for *GroupNum(). Reverse the implementations and make
*GroupDev() call *GroupNum().
Signed-off-by: Jonathon Jongsma
Reviewed-by: Laine Stump
---
src/util/virmdev.c | 38 +-
1 file changed, 17 insertions(+), 21 deletions(-)
diff --git a/src/util/virmdev.c b/src
virMediatedDeviceGetSysfsPath() (via g_strdup_printf()) is guaranteed to
return a non-NULL value, so remove the unnecessary checks for NULL.
Signed-off-by: Jonathon Jongsma
Reviewed-by: Laine Stump
---
Changes in v2:
- remove NULL checks from 2 additional locations
src/qemu/qemu_command.c
Coverity reported that this function can return NULL, so it should be
handled properly.
Signed-off-by: Jonathon Jongsma
---
Changes in v2:
- remove virReportError() to avoid error-stacking per review from Erik
src/node_device/node_device_driver.c | 7 ++-
1 file changed, 6 insertions
On Wed, 14 Apr 2021 12:41:02 +0200
Erik Skultety wrote:
> On Tue, Apr 13, 2021 at 03:39:42PM -0500, Jonathon Jongsma wrote:
> > From: Erik Skultety
> >
> > This is not a 1:1 mapping to mdevctl because mdevctl doesn't
> > support a 'create' command. It use
Coverity reported that this function can return NULL, so it should be
handled properly.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/node_device/node_device_driver.c
b/src
for *GroupNum(). Reverse the implementations and make
*GroupDev() call *GroupNum().
Signed-off-by: Jonathon Jongsma
---
src/util/virmdev.c | 38 +-
1 file changed, 17 insertions(+), 21 deletions(-)
diff --git a/src/util/virmdev.c b/src/util/virmdev.c
index
g_strdup_printf() is guaranteed to return a non-NULL value, so remove
the unnecessary check for NULL.
Signed-off-by: Jonathon Jongsma
---
src/util/virmdev.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/util/virmdev.c b/src/util/virmdev.c
index 7f4a499536..102eb2bf67 100644
These per-command generator functions were only exposed in the header to
allow the commandline generation to be tested. Now that we have a
generic mdevctl command generator, we can get rid of the per-command
wrappers and reduce the noise in the header.
Signed-off-by: Jonathon Jongsma
---
src
This variable was leftover from previous changes but is no longer used.
Signed-off-by: Jonathon Jongsma
---
tests/nodedevmdevctltest.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/tests/nodedevmdevctltest.c b/tests/nodedevmdevctltest.c
index 4c316e3ed0..65286761c1 100644
--- a/tests
specifying
it in the test macro.
Signed-off-by: Jonathon Jongsma
---
tests/nodedevmdevctltest.c | 43 +-
1 file changed, 28 insertions(+), 15 deletions(-)
diff --git a/tests/nodedevmdevctltest.c b/tests/nodedevmdevctltest.c
index bba521e563..4c316e3ed0 100644
-
From: Erik Skultety
Now that we have a generic mdevctl command generator, we can unify the
test infrastructure as well.
Signed-off-by: Erik Skultety
---
...19_36ea_4111_8f0a_8c9a70e21366-start.argv} | 0
...019_36ea_4111_8f0a_8c9a70e21366-stop.argv} | 0
rather than using short opentions (e.g. "-p :00:02.0"), use long
options everywhere (e.g. "--parent=:00:02.0")
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 28 ++-
...19_36ea_4111_8f0a_8c9a70e21
Now that the last cleanup task was removed in the previous commit, just
remove the label and return early on error rather than goto cleanup.
Signed-off-by: Jonathon Jongsma
---
tests/nodedevmdevctltest.c | 20
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git
start" instance
mean, use "create" internally instead only to translate it to "start"
just before executing mdevctl.
Signed-off-by: Erik Skultety
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 7 +++
src/node_device/node_device_driver.h |
posed to be created.
Signed-off-by: Erik Skultety
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 34 ++---
src/node_device/node_device_driver.h | 10 ++--
...9_36ea_4111_8f0a_8c9a70e21366-create.argv} | 0
...9_36ea_4111_8f0a_8c9a70e21366-c
t them call a single
global translator that handles all the mdevctl command differences and
commonalities.
Signed-off-by: Erik Skultety
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 125 ---
src/node_device/node_device_driver.h | 6 +-
tests/
as expected.
[1] See the implementation of daemonErrorLogFilter() for details:
https://gitlab.com/libvirt/libvirt/-/blob/e2f82a3704f680fbb37a733476d870c19232c23e/src/remote/remote_daemon.c#L89
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 2 +-
1 file changed, 1
Rather than specifying a UUID string to some test macros, just pass a
filename to an xml definition. This helps work toward unifying the test
macros and making it more maintainable.
Signed-off-by: Jonathon Jongsma
---
tests/nodedevmdevctldata/mdevctl-create.argv | 2 +-
tests
The calling function will log the error. Just return NULL if a device
cannot be found.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/node_device/node_device_driver.c
b/src/node_device
test function and helper generic
Jonathon Jongsma (8):
nodedev: don't log error in nodeDeviceFindAddressByName()
nodedev: avoid use of VIR_ERR_NO_* errors internally
tests: nodedev: switch all test macros to accept a filename
nodedev: Switch to using long options for mdevctl
nodedev
These per-command generator functions were only exposed in the header to
allow the commandline generation to be tested. Now that we have a
generic mdevctl command generator, we can get rid of the per-command
wrappers and reduce the noise in the header.
Signed-off-by: Jonathon Jongsma
---
src
t them call a single
global translator that handles all the mdevctl command differences and
commonalities.
Signed-off-by: Erik Skultety
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 125 ---
src/node_device/node_device_driver.h | 6 +-
tests/
posed to be created.
Signed-off-by: Erik Skultety
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 34 ++---
src/node_device/node_device_driver.h | 10 ++--
...9_36ea_4111_8f0a_8c9a70e21366-create.argv} | 0
...9_36ea_4111_8f0a_8c9a70e21366-c
rather than using short opentions (e.g. "-p :00:02.0"), use long
options everywhere (e.g. "--parent=:00:02.0")
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 28 ++-
...19_36ea_4111_8f0a_8c9a70e21
Rather than specifying a UUID string to some test macros, just pass a
filename to an xml definition. This helps work toward unifying the test
macros and making it more maintainable.
Signed-off-by: Jonathon Jongsma
---
tests/nodedevmdevctldata/mdevctl-create.argv | 2 +-
tests
This variable was leftover from previous changes but is no longer used.
Signed-off-by: Jonathon Jongsma
---
tests/nodedevmdevctltest.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/tests/nodedevmdevctltest.c b/tests/nodedevmdevctltest.c
index 3a53254195..b2507e1567 100644
--- a/tests
start" instance
mean, use "create" internally instead only to translate it to "start"
just before executing mdevctl.
Signed-off-by: Erik Skultety
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 7 +++
src/node_device/node_device_driver.h |
specifying
it in the test macro.
Signed-off-by: Jonathon Jongsma
---
tests/nodedevmdevctltest.c | 43 +-
1 file changed, 28 insertions(+), 15 deletions(-)
diff --git a/tests/nodedevmdevctltest.c b/tests/nodedevmdevctltest.c
index 7e192ce118..3a53254195 100644
-
as expected.
[1] See the implementation of daemonErrorLogFilter() for details:
https://gitlab.com/libvirt/libvirt/-/blob/e2f82a3704f680fbb37a733476d870c19232c23e/src/remote/remote_daemon.c#L89
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 2 +-
1 file changed, 1
executing mdevctl).
Erik Skultety (4):
nodedev: driver: Swap virMdevctlStart and virMdevctlCreate
nodedev: driver: Introduce internal mdevctl commands enum
nodedev: driver: Create a generic mdevctl command translator
tests: nodedev: Make the mdevctl test function and helper generic
Jonathon
From: Erik Skultety
Now that we have a generic mdevctl command generator, we can unify the
test infrastructure as well.
Signed-off-by: Erik Skultety
---
...19_36ea_4111_8f0a_8c9a70e21366-start.argv} | 0
...019_36ea_4111_8f0a_8c9a70e21366-stop.argv} | 0
The calling function will log the error. Just return NULL if a device
cannot be found.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/node_device/node_device_driver.c
b/src/node_device
Follow best practices and add a unsigned int flags parameter to these
new APIs that have not been in a release yet.
Signed-off-by: Jonathon Jongsma
---
include/libvirt/libvirt-nodedev.h| 6 --
src/driver-nodedev.h | 6 --
src/libvirt-nodedev.c| 16
A couple issues with the recently merged mdev patch series that were caught by
Daniel Berrange.
Jonathon Jongsma (2):
nodedev: fix release version in comments for new API
api: Add 'flags' param to virNodeDeviceCreate/Undefine()
include/libvirt/libvirt-nodedev.h| 6 --
src/driver
The comments mistakenly say 7.2.0, when they were actually merged during
the 7.3 development cycle.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_udev.c | 6 +++---
src/remote/remote_driver.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git
On Wed, 7 Apr 2021 08:05:17 +0200
Erik Skultety wrote:
> On Thu, Apr 01, 2021 at 10:18:45AM -0500, Jonathon Jongsma wrote:
> > On Wed, 31 Mar 2021 16:00:48 +0200
> > Erik Skultety wrote:
> >
> > > On Fri, Mar 26, 2021 at 11:47:56AM -0500, Jonathon Jongsma wro
On Wed, 31 Mar 2021 16:00:48 +0200
Erik Skultety wrote:
> On Fri, Mar 26, 2021 at 11:47:56AM -0500, Jonathon Jongsma wrote:
> > This patch series follows the previously-merged series which added
> > support for transient mediated devices. This series expands mdev
> &g
On Wed, 31 Mar 2021 08:31:11 +0200
Erik Skultety wrote:
> On Fri, Mar 26, 2021 at 11:48:12AM -0500, Jonathon Jongsma wrote:
> > With mediated devices, we can now define persistent node devices
> > that can be started and stopped. In order to take advantage of
> > this, we
lists in libvirt) to facilitate that. They will be used in
coming commits.
Signed-off-by: Jonathon Jongsma
---
src/conf/virnodedeviceobj.c | 58 ++---
src/conf/virnodedeviceobj.h | 11 +++
src/libvirt_private.syms| 2 ++
3 files changed, 67 insertions(+), 4
When calling virNodeDeviceDefineXML() to define a new mediated device,
we call virMdevctlDefine() and then wait for the new device to appear in
the driver's device list before returning. This caused long delays due
to the behavior of nodeDeviceFindNewMediatedDevice(). This function
checks to see
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
Reviewed-by: Erik Skultety
---
tools/virsh-nodedev.c | 62 +++
1
It will be useful to be able to specify a particular UUID for a mediated
device when defining the node device. To accomodate that, allow this to
be specified in the xml schema. This patch also parses and formats that
value to the xml, but does not yet use it.
Signed-off-by: Jonathon Jongsma
Use the new element in the mdev caps to define and start devices
with a specific UUID.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 19 ---
...19_36ea_4111_8f0a_8c9a70e21366-define.argv | 3 ++-
...019_36ea_4111_8f0a_8c9a70e21366
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
Reviewed-by: Erik Skultety
---
include/libvirt/libvirt-nodedev.h| 2
To accomodate re-use of this functionality in a following patch, split
out the processing of an individual mdev definition into a separate
function.
---
src/node_device/node_device_driver.c | 103 +++
1 file changed, 57 insertions(+), 46 deletions(-)
diff --git
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
Reviewed-by: Erik Skultety
---
tools/virsh-nodedev.c | 57
Add a virsh command that maps to virNodeDeviceUndefine().
Signed-off-by: Jonathon Jongsma
Reviewed-by: Erik Skultety
---
tools/virsh-nodedev.c | 59 +++
1 file changed, 59 insertions(+)
diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c
index
Mention that mdev attribute order is significant.
Signed-off-by: Jonathon Jongsma
---
docs/formatnode.html.in | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/docs/formatnode.html.in b/docs/formatnode.html.in
index 5c7286df8a..c58cd01395 100644
--- a/docs
-by: Jonathon Jongsma
Reviewed-by: Erik Skultety
---
tools/virsh-nodedev.c | 29 +
1 file changed, 25 insertions(+), 4 deletions(-)
diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c
index b9fe9b8be1..7ab5b264fc 100644
--- a/tools/virsh-nodedev.c
+++ b/tools
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
one provided by the udev backend, we will lose
extra information that was provided by mdevctl (e.g. attributes, etc).
To avoid this, make sure to copy the extra information into the new
device definition.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 153
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
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
on the fact that a vfio group can only be opened
by one user at a time. If we get an EBUSY error when attempting to open
the group file, we assume the device is in use and refuse to try to
destroy that device.
Signed-off-by: Jonathon Jongsma
Reviewed-by: Erik Skultety
---
src/node_device
This adds an internal API to query for persistent mediated devices
that are defined by mdevctl. Upcoming commits will make use of this
information.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 18 +
src/node_device/node_device_driver.h
config directory for changes to files. When a change is
detected, we query mdevctl and update our device list. The mdevctl
querying is handled in a throwaway thread, and these threads are
synchronized with a mutex.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_udev.c | 161
Abstract out the function used to generate the commandline for 'mdevctl
start' since they take the same arguments. Add tests to ensure that
we're generating the command properly.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 34 +++--
src/node_device
Add a virsh command that maps to virNodeDeviceDefineXML().
Signed-off-by: Jonathon Jongsma
Reviewed-by: Erik Skultety
---
tools/virsh-nodedev.c | 58 +++
1 file changed, 58 insertions(+)
diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c
index
Expose a helper function that can be used by udev and mdevctl to
generate device names for node devices.
Signed-off-by: Jonathon Jongsma
Reviewed-by: Erik Skultety
---
src/node_device/node_device_driver.c | 25 +
src/node_device/node_device_driver.h | 6 ++
src
This function will parse the list of mediated devices that are returned
by mdevctl and convert it into our internal node device representation.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 143 ++
src/node_device/node_device_driver.h
hen we get such an event, we remove the device from the list if it's
not active. Otherwise, we simply mark it as non-persistent.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 67 ++--
1 file changed, 64 insertions(+), 3 deletions(-)
diff -
Add two flag values for virConnectListAllNodeDevices() so that we can
list only node devices that are active or inactive.
Signed-off-by: Jonathon Jongsma
Reviewed-by: Erik Skultety
---
include/libvirt/libvirt-nodedev.h| 9 +++--
src/conf/node_device_conf.h | 8
src/conf
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
It doesn't make sense to list all of the flag values in the function
documentation. This is unnecessary duplication, we already refer to the
enum type. Also, remove reference to exclusive groups of flags, since
that does not apply to this API.
Signed-off-by: Jonathon Jongsma
---
include
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
Reviewed-by: Erik Skultety
---
src/conf/virnodedeviceobj.c
Consistent with other objects (e.g. virDomainObj), add a field to
indicate whether the node device is persistent or transient.
Signed-off-by: Jonathon Jongsma
---
src/conf/virnodedeviceobj.c | 16
src/conf/virnodedeviceobj.h | 6 ++
src/libvirt_private.syms| 2 ++
3
When an mdevctl command fails, there is not much information available
to the user about why it failed. This is partly because we were not
making use of the error message that mdevctl itself prints upon failure.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 46
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
Reviewed-by: Erik Skultety
---
tests/nodedevmdevctltest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests
to latest git master
Jonathon Jongsma (30):
nodedev: capture and report stderror from mdevctl
tests: remove extra trailing semicolon
nodedev: introduce concept of 'active' node devices
nodedev: Add ability to filter by active state
nodedev: fix docs for virConnectListAllNodeDevices
On Fri, 26 Mar 2021 07:27:46 +0100
Erik Skultety wrote:
> On Thu, Mar 25, 2021 at 11:49:49AM -0500, Jonathon Jongsma wrote:
> > Just a friendly ping ;)
>
> I'm sorry I've been neglecting this for the past 3 weeks or so, I'll
> dive right into it starting Monday next we
Just a friendly ping ;)
On Tue, 2 Mar 2021 16:30:35 -0600
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,
with the cleanup. This is similar to how we handle the udev
event handler thread.
The separate initialization thread was added in commit
9f0ae0b1.
https://bugzilla.redhat.com/show_bug.cgi?id=1933590
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_udev.c | 7 +--
1 file
It will be useful to be able to specify a particular UUID for a mediated
device when defining the node device. To accomodate that, allow this to
be specified in the xml schema. This patch also parses and formats that
value to the xml, but does not yet use it.
Signed-off-by: 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
Reviewed-by: Erik Skultety
---
tools/virsh-nodedev.c | 62 +++
1
Add a virsh command that maps to virNodeDeviceDefineXML().
Signed-off-by: Jonathon Jongsma
Reviewed-by: Erik Skultety
---
tools/virsh-nodedev.c | 58 +++
1 file changed, 58 insertions(+)
diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c
index
Mention that mdev attribute order is significant.
Signed-off-by: Jonathon Jongsma
---
docs/formatnode.html.in | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/docs/formatnode.html.in b/docs/formatnode.html.in
index 5c7286df8a..c58cd01395 100644
--- a/docs
When calling virNodeDeviceDefineXML() to define a new mediated device,
we call virMdevctlDefine() and then wait for the new device to appear in
the driver's device list before returning. This caused long delays due
to the behavior of nodeDeviceFindNewMediatedDevice(). This function
checks to see
on the fact that a vfio group can only be opened
by one user at a time. If we get an EBUSY error when attempting to open
the group file, we assume the device is in use and refuse to try to
destroy that device.
Signed-off-by: Jonathon Jongsma
Reviewed-by: Erik Skultety
---
src/node_device
To accomodate re-use of this functionality in a following patch, split
out the processing of an individual mdev definition into a separate
function.
---
src/node_device/node_device_driver.c | 103 +++
1 file changed, 57 insertions(+), 46 deletions(-)
diff --git
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
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
Reviewed-by: Erik Skultety
---
tools/virsh-nodedev.c | 57
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
Reviewed-by: Erik Skultety
---
include/libvirt/libvirt-nodedev.h| 2
-by: Jonathon Jongsma
Reviewed-by: Erik Skultety
---
tools/virsh-nodedev.c | 29 +
1 file changed, 25 insertions(+), 4 deletions(-)
diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c
index b9fe9b8be1..7ab5b264fc 100644
--- a/tools/virsh-nodedev.c
+++ b/tools
Use the new element in the mdev caps to define and start devices
with a specific UUID.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 19 ---
...19_36ea_4111_8f0a_8c9a70e21366-define.argv | 3 ++-
...019_36ea_4111_8f0a_8c9a70e21366
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
Reviewed-by: Erik Skultety
---
tools/virsh-nodedev.c | 59 +++
1 file changed, 59 insertions(+)
diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c
index
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
config directory for changes to files. When a change is
detected, we query mdevctl and update our device list. The mdevctl
querying is handled in a throwaway thread, and these threads are
synchronized with a mutex.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_udev.c | 161
Abstract out the function used to generate the commandline for 'mdevctl
start' since they take the same arguments. Add tests to ensure that
we're generating the command properly.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 34 +++--
src/node_device
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
Consistent with other objects (e.g. virDomainObj), add a field to
indicate whether the node device is persistent or transient.
Signed-off-by: Jonathon Jongsma
---
src/conf/virnodedeviceobj.c | 16
src/conf/virnodedeviceobj.h | 6 ++
src/libvirt_private.syms| 2 ++
3
lists in libvirt) to facilitate that. They will be used in
coming commits.
Signed-off-by: Jonathon Jongsma
---
src/conf/virnodedeviceobj.c | 58 ++---
src/conf/virnodedeviceobj.h | 11 +++
src/libvirt_private.syms| 2 ++
3 files changed, 67 insertions(+), 4
hen we get such an event, we remove the device from the list if it's
not active. Otherwise, we simply mark it as non-persistent.
Signed-off-by: Jonathon Jongsma
---
src/node_device/node_device_driver.c | 67 ++--
1 file changed, 64 insertions(+), 3 deletions(-)
diff -
501 - 600 of 1088 matches
Mail list logo