[libvirt PATCH] qemu: fix potential resource leak

2020-10-21 Thread Jonathon Jongsma
Coverity reported a potential resource leak. While it's probably not a real-world scenario, the code could technically jump to cleanup between the time that vdpafd is opened and when it is used. Ensure that it gets cleaned up in that case. Signed-off-by: Jonathon Jongsma --- src/qemu

Re: [libvirt PATCH v5 0/6] Add support for vDPA network devices

2020-10-20 Thread Jonathon Jongsma
On Tue, 20 Oct 2020 15:16:48 -0400 Laine Stump wrote: > On 10/14/20 1:08 PM, Jonathon Jongsma wrote: > > vDPA network devices allow high-performance networking in a virtual > > machine by providing a wire-speed data path. These devices require > > a vendor-specific host dri

[libvirt PATCH v5 0/6] Add support for vDPA network devices

2020-10-14 Thread Jonathon Jongsma
- Improved the nodedev xml. It now includes the path to the chardev in /dev - also updated the nodedev xml schema - added sample nodedev-dumpxml output to the commit message of patch #6 Jonathon Jongsma (6): conf: Add support for vDPA network devices qemu: add vhost-vdpa capability qemu: add

[libvirt PATCH v5 6/6] Include vdpa devices in node device list

2020-10-14 Thread Jonathon Jongsma
vdpa_vdpa0 /sys/devices/vdpa0 computer vhost_vdpa /dev/vhost-vdpa-0 NOTE: normally the 'parent' would be a PCI device instead of 'computer', but this example output is from the vdpa_sim kernel module, so it doesn't have a normal parent device. Signed-off-by: Jonathon

[libvirt PATCH v5 5/6] qemu: support hotplug of vdpa devices

2020-10-14 Thread Jonathon Jongsma
By using the new qemu monitor functions to handle passing and removing file descriptors, we can support hotplug of vdpa devices. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_hotplug.c | 62 +-- tests/qemuhotplugmock.c | 9

[libvirt PATCH v5 3/6] qemu: add vdpa support

2020-10-14 Thread Jonathon Jongsma
Enable for qemu domains. This provides basic support and does not support hotplug or migration. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_command.c | 35 +++-- src/qemu/qemu_command.h | 3 +- src/qemu/qemu_domain.c

[libvirt PATCH v5 1/6] conf: Add support for vDPA network devices

2020-10-14 Thread Jonathon Jongsma
path follows the virtio specification. When a device on the host is bound to an appropriate vendor-specific driver, it will create a chardev on the host at e.g. /dev/vhost-vdpa-0. That chardev path can then be used to define a new interface with type='vdpa'. Signed-off-by: Jonathon Jongsma

[libvirt PATCH v5 4/6] qemu: add monitor functions for handling file descriptors

2020-10-14 Thread Jonathon Jongsma
add-fd, remove-fd, and query-fdsets provide functionality that can be used for passing fds to qemu and closing fdsets that are no longer necessary. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_monitor.c | 93 +++ src/qemu/qemu_monitor.h | 41 + src/qemu

[libvirt PATCH v5 2/6] qemu: add vhost-vdpa capability

2020-10-14 Thread Jonathon Jongsma
Recent versions of qemu added the -netdev vhost-vdpa device. This capability allows libvirt to know whether this is supported. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests

[libvirt PATCH] qemu: remove some unnecessary local variables

2020-10-13 Thread Jonathon Jongsma
These variables seem to be left over from a previous refactoring and they don't add anything to the code. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_hotplug.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu

Re: [libvirt PATCH 00/10] use g_autoptr with cgroups (glib chronicles)

2020-10-08 Thread Jonathon Jongsma
group.h | 4 +- > src/util/vircgroupv1.c| 9 +- > tests/vircgrouptest.c | 236 > +++--- tools/virt-host-validate-common.c | > 4 +- 15 files changed, 305 insertions(+), 452 deletions(-) > Aside from the minor comment on path 3, Reviewed-by: Jonathon Jongsma

Re: [libvirt PATCH 03/10] util: vircgroup: change virCgroupFree to take only virCgroupPtr

2020-10-08 Thread Jonathon Jongsma
On Thu, 8 Oct 2020 16:26:56 +0200 Pavel Hrdina wrote: > As preparation for g_autoptr() we need to change the function to take > only virCgroupPtr. > > Signed-off-by: Pavel Hrdina > --- > src/libvirt-lxc.c | 4 +- > src/lxc/lxc_cgroup.c | 4 +- >

Re: [libvirt PATCHv2 00/16] refactor qemuAgentGetInterfaces

2020-10-07 Thread Jonathon Jongsma
agent.c | 355 > +- 1 file changed, 180 > insertions(+), 175 deletions(-) > Looks good to me. Reviewed-by: Jonathon Jongsma

Re: [libvirt PATCH 00/14] refactor qemuAgentGetInterfaces

2020-10-06 Thread Jonathon Jongsma
ame tmp_iface to iface_obj > > src/qemu/qemu_agent.c | 291 > +++--- 1 file changed, 134 > insertions(+), 157 deletions(-) > Aside from the patches I commented on (2,5,9), the others look good to me. Reviewed-by: Jonathon Jongsma

Re: [libvirt PATCH 09/14] qemu: agent: split out qemuAgentGetInterfaceAddresses

2020-10-06 Thread Jonathon Jongsma
On Tue, 6 Oct 2020 08:58:45 +0200 Ján Tomko wrote: > Convert one interface from the "return" array returned by > "guest-network-get-interfaces" to virDomainInterface. > > Due to the functionality of squashing interface aliases together, > this is not a pure function - it either: > * Adds the

Re: [libvirt PATCH 05/14] qemu: agent: expand addrs upfront

2020-10-06 Thread Jonathon Jongsma
On Tue, 6 Oct 2020 08:58:41 +0200 Ján Tomko wrote: > qemuAgentGetInterfaceOneAddress returns exactly one address > for every iteration of the loop (and we error out if not). > > Instead of expanding the addrs by one on every iteration, > do it upfront since we know how many times the loop will

Re: [libvirt PATCH 02/14] qemu: agent: split out qemuAgentGetInterfaceOneAddress

2020-10-06 Thread Jonathon Jongsma
On Tue, 6 Oct 2020 08:58:38 +0200 Ján Tomko wrote: > A function that takes one entry from the "ip-addresses" array > returned by "guest-network-get-interfaces" and converts it > into virDomainIPAddress. > > Signed-off-by: Ján Tomko > --- > src/qemu/qemu_agent.c | 78 >

Re: [libvirt PATCH v4 5/6] qemu: support hotplug of vdpa devices

2020-10-01 Thread Jonathon Jongsma
On Tue, 29 Sep 2020 15:53:39 -0400 Laine Stump wrote: > > + > > +if (vdpafdset < 0) { > > +VIR_WARN("Cannot determine fdset for vdpa device"); > > +} else { > > +if (qemuMonitorRemoveFdset(priv->mon, vdpafdset) < 0) { > > +/* if it fails,

Re: [libvirt PATCH v4 6/6] Include vdpa devices in node device list

2020-09-30 Thread Jonathon Jongsma
On Wed, 30 Sep 2020 10:02:04 -0500 Jonathon Jongsma wrote: > Adding Cindy and Jason to cc for input on the path issue below > > On Tue, 29 Sep 2020 15:56:13 -0400 > Laine Stump wrote: > > > On 9/24/20 5:45 PM, Jonathon Jongsma wrote: > > > The current udev

Re: [libvirt PATCH v4 6/6] Include vdpa devices in node device list

2020-09-30 Thread Jonathon Jongsma
Adding Cindy and Jason to cc for input on the path issue below On Tue, 29 Sep 2020 15:56:13 -0400 Laine Stump wrote: > On 9/24/20 5:45 PM, Jonathon Jongsma wrote: > > The current udev node device driver ignores all events related to > > vdpa devices. Since libvirt now suppor

Re: [libvirt PATCH 9/9] tests: Add tests for unknown elements and attributes in cpu defintion

2020-09-28 Thread Jonathon Jongsma
On Mon, 2020-09-21 at 15:07 +0200, Tim Wiederhake wrote: > Signed-off-by: Tim Wiederhake > --- > tests/cputest.c | 4 > tests/cputestdata/x86_64-bogus-attribute.xml | 2 ++ > tests/cputestdata/x86_64-bogus-element.xml | 3 +++ > 3 files changed, 9

[libvirt PATCH v4 2/6] qemu: add vhost-vdpa capability

2020-09-24 Thread Jonathon Jongsma
Recent versions of qemu added the -netdev vhost-vdpa device. This capability allows libvirt to know whether this is supported. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_capabilities.c | 4 src/qemu/qemu_capabilities.h | 3 +++ tests

[libvirt PATCH v4 0/6] Add support for vDPA network devices

2020-09-24 Thread Jonathon Jongsma
: - rebased to latest master - added hotplug support - report vdpa devices in node device list Jonathon Jongsma (6): conf: Add support for vDPA network devices qemu: add vhost-vdpa capability qemu: add vdpa support qemu: add monitor functions for handling file descriptors qemu: support

[libvirt PATCH v4 4/6] qemu: add monitor functions for handling file descriptors

2020-09-24 Thread Jonathon Jongsma
add-fd, remove-fd, and query-fdsets provide functionality that can be used for passing fds to qemu and closing fdsets that are no longer necessary. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_monitor.c | 93 +++ src/qemu/qemu_monitor.h | 41 + src/qemu

[libvirt PATCH v4 1/6] conf: Add support for vDPA network devices

2020-09-24 Thread Jonathon Jongsma
path follows the virtio specification. When a device on the host is bound to an appropriate vendor-specific driver, it will create a chardev on the host at e.g. /dev/vhost-vdpa-0. That chardev path can then be used to define a new interface with type='vdpa'. Signed-off-by: Jonathon Jongsma

[libvirt PATCH v4 3/6] qemu: add vdpa support

2020-09-24 Thread Jonathon Jongsma
Enable for qemu domains. This provides basic support and does not support hotplug or migration. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_command.c | 35 -- src/qemu/qemu_command.h | 3 +- src/qemu/qemu_domain.c

[libvirt PATCH v4 6/6] Include vdpa devices in node device list

2020-09-24 Thread Jonathon Jongsma
The current udev node device driver ignores all events related to vdpa devices. Since libvirt now supports vDPA network devices, include these devices in the device list. Signed-off-by: Jonathon Jongsma --- include/libvirt/libvirt-nodedev.h | 1 + src/conf/node_device_conf.c| 5

[libvirt PATCH v4 5/6] qemu: support hotplug of vdpa devices

2020-09-24 Thread Jonathon Jongsma
By using the new qemu monitor functions to handle passing and removing file descriptors, we can support hotplug of vdpa devices. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_hotplug.c | 60 +-- tests/qemuhotplugmock.c | 9

[libvirt PATCH v3 2/3] qemu: add vhost-vdpa capability

2020-09-11 Thread Jonathon Jongsma
Recent versions of qemu added the -netdev vhost-vdpa device. This capability allows libvirt to know whether this is supported. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_capabilities.c | 4 src/qemu/qemu_capabilities.h | 3 +++ tests

[libvirt PATCH v3 1/3] conf: Add support for vDPA network devices

2020-09-11 Thread Jonathon Jongsma
path follows the virtio specification. When a device on the host is bound to an appropriate vendor-specific driver, it will create a chardev on the host at e.g. /dev/vhost-vdpa-0. That chardev path can then be used to define a new interface with type='vdpa'. Signed-off-by: Jonathon Jongsma

[libvirt PATCH v3 0/3] Add support for vDPA network devices

2020-09-11 Thread Jonathon Jongsma
be reassigned to a different domain. - I decided not to post the preliminary hotplug patch until I can get more clarity from qemu developers. Jonathon Jongsma (3): conf: Add support for vDPA network devices qemu: add vhost-vdpa capability qemu: add vdpa support docs/formatdomain.rst

[libvirt PATCH v3 3/3] qemu: add vdpa support

2020-09-11 Thread Jonathon Jongsma
Enable for qemu domains. This provides basic support and does not support hotplug or migration. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_command.c | 30 +-- src/qemu/qemu_command.h | 3 +- src/qemu/qemu_domain.c

Re: [libvirt PATCH v2 3/3] qemu: add vdpa support

2020-09-03 Thread Jonathon Jongsma
On Thu, 2020-09-03 at 00:55 -0400, Laine Stump wrote: > On 9/2/20 3:25 PM, Jonathon Jongsma wrote: > > Enable for qemu domains. This provides > > basic > > support and does not support hotplug or migration. > > Is there something specifically preventing hot

[libvirt PATCH] tests: change confusing macro agument names

2020-09-02 Thread Jonathon Jongsma
Rather than use the names "fial" and "kep", use "fail" and "keep". In the DO_TEST() macro, to prevent the preprocessor replacing the struct member names during assignment, use the names "fail_" and "keep_" instead. Signed

[libvirt PATCH v2 3/3] qemu: add vdpa support

2020-09-02 Thread Jonathon Jongsma
Enable for qemu domains. This provides basic support and does not support hotplug or migration. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_command.c | 28 -- src/qemu/qemu_command.h | 3 +- src/qemu/qemu_domain.c

[libvirt PATCH v2 2/3] qemu: add vhost-vdpa capability

2020-09-02 Thread Jonathon Jongsma
Recent versions of qemu added the -netdev vhost-vdpa device. This capability allows libvirt to know whether this is supported. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_capabilities.c | 4 src/qemu/qemu_capabilities.h | 3 +++ tests

[libvirt PATCH v2 1/3] conf: Add support for vDPA network devices

2020-09-02 Thread Jonathon Jongsma
path follows the virtio specification. When a device on the host is bound to an appropriate vendor-specific driver, it will create a chardev on the host at e.g. /dev/vhost-vdpa-0. That chardev path can then be used to define a new interface with type='vdpa'. Signed-off-by: Jonathon Jongsma

[libvirt PATCH v2 0/3] Add support for vDPA network devices

2020-09-02 Thread Jonathon Jongsma
- add qemu capability - disallow migration for vdpa devices Jonathon Jongsma (3): conf: Add support for vDPA network devices qemu: add vhost-vdpa capability qemu: add vdpa support docs/formatdomain.rst | 23 docs/schemas/domaincommon.rng

Re: [libvirt PATCH] RFC: Add support for vDPA network devices

2020-08-27 Thread Jonathon Jongsma
:33 -0500, Jonathon Jongsma wrote: > On Thu, 2020-08-20 at 18:56 -0400, Laine Stump wrote: > > On 8/18/20 2:37 PM, Jonathon Jongsma wrote: > > > vDPA network devices allow high-performance networking in a > > > virtual > > > machine by providing a wire-speed da

Re: [libvirt PATCH] RFC: Add support for vDPA network devices

2020-08-24 Thread Jonathon Jongsma
On Thu, 2020-08-20 at 18:56 -0400, Laine Stump wrote: > On 8/18/20 2:37 PM, Jonathon Jongsma wrote: > > vDPA network devices allow high-performance networking in a virtual > > machine by providing a wire-speed data path. These devices require > > a > > vendor-specific ho

[libvirt PATCH] RFC: Add support for vDPA network devices

2020-08-18 Thread Jonathon Jongsma
vDPA network devices allow high-performance networking in a virtual machine by providing a wire-speed data path. These devices require a vendor-specific host driver but the data path follows the virtio specification. The support for vDPA devices was recently added to qemu. This allows libvirt to

[libvirt PATCH v2 16/16] virsh: add "nodedev-start" command

2020-08-18 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 v2 13/16] virsh: Factor out function to find node device

2020-08-18 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 insertions

[libvirt PATCH v2 06/16] nodedev: add STOPPED/STARTED lifecycle events

2020-08-18 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 v2 01/16] tests: remove extra trailing semicolon

2020-08-18 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 b/tests

[libvirt PATCH v2 00/16] Add support for persistent mediated devices

2020-08-18 Thread Jonathon Jongsma
and re-query mdevctl when we detect changes within that directory. In the future, mdevctl may introduce a more elegant solution. Changes in v2: - rebase to latest git master Jonathon Jongsma (16): tests: remove extra trailing semicolon nodedev: introduce concept of 'active' node devices nodedev

[libvirt PATCH v2 14/16] virsh: add nodedev-undefine command

2020-08-18 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 34203c0e91..db56fbc5e9 100644

[libvirt PATCH v2 10/16] api: add virNodeDeviceDefineXML()

2020-08-18 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 v2 02/16] nodedev: introduce concept of 'active' node devices

2020-08-18 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 v2 12/16] api: add virNodeDeviceUndefine()

2020-08-18 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/driver-nodedev.h | 4 ++ src/libvirt-nodedev.c

[libvirt PATCH v2 15/16] api: add virNodeDeviceCreate()

2020-08-18 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 v2 03/16] nodedev: Add ability to filter by active state

2020-08-18 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

[libvirt PATCH v2 11/16] virsh: add nodedev-define command

2020-08-18 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 f078ce6516..45d6c7b493 100644

[libvirt PATCH v2 09/16] nodedev: add an mdevctl thread

2020-08-18 Thread Jonathon Jongsma
, but for now we resort to a bit of a workaround: monitoring the mdevctl config directories for changes to files. When a change is detected, we query mdevctl and update our device list. Signed-off-by: Jonathon Jongsma --- src/node_device/node_device_udev.c | 182 + 1

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

2020-08-18 Thread Jonathon Jongsma
, and other tests verify that we can parse the returned JSON and convert it to our own internal node device representations. Signed-off-by: Jonathon Jongsma --- src/node_device/node_device_driver.c | 156 ++ src/node_device/node_device_driver.h | 13 ++ src/node_device

[libvirt PATCH v2 04/16] virsh: Add --active, --inactive, --all to nodedev-list

2020-08-18 Thread Jonathon Jongsma
Signed-off-by: Jonathon Jongsma --- tools/virsh-nodedev.c | 35 +++ 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index e576b3c847..e87761188f 100644 --- a/tools/virsh-nodedev.c +++ b/tools/virsh-nodedev.c

[libvirt PATCH v2 07/16] nodedev: add mdevctl devices to node device list

2020-08-18 Thread Jonathon Jongsma
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 | 76

[libvirt PATCH v2 08/16] nodedev: handle mdevs that disappear from mdevctl

2020-08-18 Thread Jonathon Jongsma
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 | 61 1 file changed, 61 insertions(+) diff --git a/src/n

Re: [libvirt PATCH 0/9] Remove some unused macros

2020-07-28 Thread Jonathon Jongsma
Reviewed-by: Jonathon Jongsma On Tue, 2020-07-28 at 13:54 +0200, Ján Tomko wrote: > I built with -Wunused-macros again after five years [0] > the good news is we don't really have that many - > most of them are VIR_FROM_THIS or macros we have included > for completeness. > >

Re: [libvirt PATCH 1/1] conf: move graphics validation checks out of *ParseXML function.

2020-07-24 Thread Jonathon Jongsma
VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST: > -break; > -} > - > if (def->type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS) { > if (address && addressCompat && STRNEQ(address, > addressCompat)) { > virReportError(VIR_ERR_CONFIG_UNSUPPORTED, >

Re: [PATCH] client: fix memory leak in client msg

2020-07-24 Thread Jonathon Jongsma
call); > virCondDestroy(>cond); > -VIR_FREE(call->msg); > +virNetMessageFree(call->msg); > VIR_FREE(call); > return true; > } > -- > 2.23.0 > > Reviewed-by: Jonathon Jongsma

Re: [PATCH 06/32] docs: formatdomain: Split out

2020-07-24 Thread Jonathon Jongsma
On Thu, 2020-07-23 at 15:21 +0200, Peter Krempa wrote: > Start splitting the massive document into smaller pieces using the > .. include:: directive. > > Signed-off-by: Peter Krempa > --- > docs/formatdomain-devices.rst | 5053 > > docs/formatdomain.rst

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

2020-07-17 Thread Jonathon Jongsma
On Fri, 2020-07-17 at 10:08 +0200, Erik Skultety wrote: > On Thu, Jul 16, 2020 at 05:21:30PM -0500, Jonathon Jongsma wrote: > > This patch series follows the previously-merged series which added > > support for > > transient mediated devices. This series expands mdev s

[libvirt PATCH 16/16] virsh: add "nodedev-start" command

2020-07-16 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 15/16] api: add virNodeDeviceCreate()

2020-07-16 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 09/16] nodedev: add an mdevctl thread

2020-07-16 Thread Jonathon Jongsma
, but for now we resort to a bit of a workaround: monitoring the mdevctl config directories for changes to files. When a change is detected, we query mdevctl and update our device list. Signed-off-by: Jonathon Jongsma --- src/node_device/node_device_udev.c | 182 + 1

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

2020-07-16 Thread Jonathon Jongsma
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 | 75

[libvirt PATCH 14/16] virsh: add nodedev-undefine command

2020-07-16 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 57f987a81e..2f984e8738 100644

[libvirt PATCH 11/16] virsh: add nodedev-define command

2020-07-16 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 75542530da..c02b79a349 100644

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

2020-07-16 Thread Jonathon Jongsma
, and other tests verify that we can parse the returned JSON and convert it to our own internal node device representations. Signed-off-by: Jonathon Jongsma --- src/node_device/node_device_driver.c | 154 ++ src/node_device/node_device_driver.h | 13 ++ src/node_device

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

2020-07-16 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

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

2020-07-16 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 b/tests

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

2020-07-16 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/driver-nodedev.h | 4 ++ src/libvirt-nodedev.c

[libvirt PATCH 13/16] virsh: Factor out function to find node device

2020-07-16 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 insertions

[libvirt PATCH 10/16] api: add virNodeDeviceDefineXML()

2020-07-16 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 04/16] virsh: Add --active, --inactive, --all to nodedev-list

2020-07-16 Thread Jonathon Jongsma
Signed-off-by: Jonathon Jongsma --- tools/virsh-nodedev.c | 35 +++ 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index 7f091d7cf8..2fb6be504b 100644 --- a/tools/virsh-nodedev.c +++ b/tools/virsh-nodedev.c

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

2020-07-16 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 08/16] nodedev: handle mdevs that disappear from mdevctl

2020-07-16 Thread Jonathon Jongsma
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 | 61 1 file changed, 61 insertions(+) diff --git a/src/n

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

2020-07-16 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 00/16] Add support for persistent mediated devices

2020-07-16 Thread Jonathon Jongsma
-query mdevctl when we detect changes within that directory. In the future, mdevctl may introduce a more elegant solution. Jonathon Jongsma (16): tests: remove extra trailing semicolon nodedev: introduce concept of 'active' node devices nodedev: Add ability to filter by active state virsh: Add

Re: [libvirt PATCH v2] ci: Use openSUSE image for code style checking

2020-06-25 Thread Jonathon Jongsma
On Mon, 2020-06-22 at 18:18 +0200, Andrea Bolognani wrote: > On Mon, 2020-06-22 at 09:43 -0500, Jonathon Jongsma wrote: > > CentOS does not have the cppi package, so some code style checks > > are > > skipped. Switch to a openSUSE image to do the code style checks. > >

[libvirt PATCH v3 0/2] Refuse PCI Address for ramfb device definition

2020-06-25 Thread Jonathon Jongsma
Changes in this version: - Add the test case input file - modify the test itself to properly fail when an input file is missing. Jonathon Jongsma (2): qemu: ramfb video device doesn't support PCI address tests: ensure failure if input file doesn't exist src/qemu/qemu_validate.c

[libvirt PATCH v3 1/2] qemu: ramfb video device doesn't support PCI address

2020-06-25 Thread Jonathon Jongsma
configurations were non-functional. https://bugzilla.redhat.com/show_bug.cgi?id=1847259 Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_validate.c | 8 + ...video-ramfb-display-device-pci-address.xml | 30 +++ tests/qemuxml2argvtest.c

[libvirt PATCH v3 2/2] tests: ensure failure if input file doesn't exist

2020-06-25 Thread Jonathon Jongsma
NULL for any parse failure, including a missing file. So we need to explicitly check whether the file exists first, and fail the test if it is missing. Signed-off-by: Jonathon Jongsma --- tests/qemuxml2argvtest.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tests/qemuxml2argvtest.c

Re: [libvirt PATCH v2] qemu: ramfb video device doesn't support PCI address

2020-06-25 Thread Jonathon Jongsma
On Thu, 2020-06-25 at 12:20 -0400, Laine Stump wrote: > On 6/25/20 10:34 AM, Jonathon Jongsma wrote: > > Although a ramfb video device is not a PCI device, we don't > > currently > > report an error for ramfb device definitions containing a PCI > > address. >

[libvirt PATCH v2] qemu: ramfb video device doesn't support PCI address

2020-06-25 Thread Jonathon Jongsma
configurations were non-functional. https://bugzilla.redhat.com/show_bug.cgi?id=1847259 Signed-off-by: Jonathon Jongsma --- changes in v2: - move validation to qemu-specific validation function as suggested by Laine src/qemu/qemu_validate.c | 8 tests/qemuxml2argvtest.c | 1 + 2 files

Re: [libvirt PATCH] qemu: ramfb video device doesn't support PCI address

2020-06-25 Thread Jonathon Jongsma
On Wed, 2020-06-24 at 23:21 -0400, Laine Stump wrote: > On 6/24/20 6:06 PM, Jonathon Jongsma wrote: > > Although a ramfb video device is not a PCI device, we don't > > currently > > report an error for ramfb device definitions containing a PCI > > address. >

[libvirt PATCH] qemu: ramfb video device doesn't support PCI address

2020-06-24 Thread Jonathon Jongsma
configurations were non-functional. https://bugzilla.redhat.com/show_bug.cgi?id=1847259 Signed-off-by: Jonathon Jongsma --- src/conf/domain_conf.c | 7 +++ tests/qemuxml2argvtest.c | 1 + 2 files changed, 8 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index

[libvirt PATCH v2] qemu: format 'ramfb' attribute for mediated devices

2020-06-23 Thread Jonathon Jongsma
://bugzilla.redhat.com/show_bug.cgi?id=1847791 Signed-off-by: Jonathon Jongsma --- Changes in v2: - drop unnecessary input xml file for test src/conf/domain_conf.c| 3 ++ ...stdev-mdev-display-ramfb.x86_64-latest.xml | 44 +++ tests/qemuxml2xmltest.c

[libvirt PATCH] qemu: format 'ramfb' attribute for mediated devices

2020-06-22 Thread Jonathon Jongsma
://bugzilla.redhat.com/show_bug.cgi?id=1847791 Signed-off-by: Jonathon Jongsma --- src/conf/domain_conf.c| 3 ++ ...stdev-mdev-display-ramfb.x86_64-latest.xml | 44 +++ .../hostdev-mdev-display-ramfb.xml| 33 ++ tests/qemuxml2xmltest.c

[libvirt PATCH v2] ci: Use openSUSE image for code style checking

2020-06-22 Thread Jonathon Jongsma
CentOS does not have the cppi package, so some code style checks are skipped. Switch to a openSUSE image to do the code style checks. Signed-off-by: Jonathon Jongsma --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index

Re: [libvirt PATCH 23/23] build: add syntax-check rules for undesirable terms

2020-06-19 Thread Jonathon Jongsma
On Fri, 2020-06-19 at 13:33 +0100, Daniel P. Berrangé wrote: > On Fri, Jun 19, 2020 at 02:11:09PM +0200, Ján Tomko wrote: > > On a Friday in 2020, Peter Krempa wrote: > > > On Fri, Jun 19, 2020 at 10:33:00 +0100, Daniel Berrange wrote: > > > > We don't check for "master", because there are too

Re: [libvirt PATCH v4 00/12] Add ability to create mediated devices in libvirt

2020-06-19 Thread Jonathon Jongsma
On Fri, 2020-06-19 at 12:06 +0100, Daniel P. Berrangé wrote: > On Fri, Jun 19, 2020 at 10:35:12AM +0200, Michal Privoznik wrote: > > On 6/19/20 9:22 AM, Erik Skultety wrote: > > > On Thu, Jun 18, 2020 at 04:05:53PM -0500, Jonathon Jongsma wrote: > > > > This is

[libvirt PATCH v4 06/12] nodedev: add mdev support to virNodeDeviceCreateXML()

2020-06-18 Thread Jonathon Jongsma
. In order to avoid creating and cleaning up temporary files, the JSON is instead fed to stdin and we pass the filename /dev/stdin to mdevctl. While this may not be portable, neither are mediated devices, so I don't believe it should cause any problems. Signed-off-by: Jonathon Jongsma

[libvirt PATCH v4 09/12] nodedev: add mdev support to virNodeDeviceDestroy()

2020-06-18 Thread Jonathon Jongsma
Add the ability to destroy mdev node devices via the mdevctl utility. Signed-off-by: Jonathon Jongsma --- src/node_device/node_device_driver.c | 33 src/node_device/node_device_driver.h | 2 ++ 2 files changed, 35 insertions(+) diff --git a/src/node_device

[libvirt PATCH v4 03/12] nodedev: add support for mdev attributes

2020-06-18 Thread Jonathon Jongsma
-by: Jonathon Jongsma --- docs/formatnode.html.in | 7 + docs/schemas/nodedev.rng| 6 + src/conf/node_device_conf.c | 53 ++--- src/conf/node_device_conf.h | 2 ++ src/libvirt_private.syms| 2 ++ src/util/virmdev.c | 12 + src/util

[libvirt PATCH v4 07/12] nodedev: Build a non-loadable driver lib

2020-06-18 Thread Jonathon Jongsma
In order to test the nodedev driver, we need to link against a non-loadable module. Similar to other loadable modules already in the repository, create an _impl library that can be linked against the unit tests and then create a loadable module from that. Signed-off-by: Jonathon Jongsma --- src

[libvirt PATCH v4 12/12] news: mediated devices can be created

2020-06-18 Thread Jonathon Jongsma
Signed-off-by: Jonathon Jongsma --- NEWS.rst | 7 +++ 1 file changed, 7 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 20964b94d7..42d159b233 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -21,6 +21,13 @@ v6.5.0 (unreleased) It's possible to either specify new value as a string

[libvirt PATCH v4 04/12] nodedev: refactor nodeDeviceFindNewDevice()

2020-06-18 Thread Jonathon Jongsma
. Signed-off-by: Jonathon Jongsma --- src/node_device/node_device_driver.c | 41 +--- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c index ba7ea50e5b..d6255a43c8 100644 --- a/src

[libvirt PATCH v4 08/12] nodedev: Add testing for 'mdevctl start'

2020-06-18 Thread Jonathon Jongsma
Test that we run 'mdevctl' with the proper arguments when creating new mediated devices with virNodeDeviceCreateXML(). Signed-off-by: Jonathon Jongsma --- build-aux/syntax-check.mk | 2 +- tests/Makefile.am | 15

<    3   4   5   6   7   8   9   10   11   >