Re: [libvirt PATCH v4 25/25] nodedev: fix hang when destroying an mdev in use

2021-02-21 Thread Erik Skultety
On Wed, Feb 03, 2021 at 11:39:09AM -0600, Jonathon Jongsma wrote: > Calling `mdevctl stop` for a mediated device that is in use by an active > domain will block until that vm exits (or the vm closes the device). > Since the nodedev driver cannot query the hypervisor driver to see > whether any acti

Re: [libvirt PATCH v4 24/25] nodedev: add ability to specify UUID for new mdevs

2021-02-21 Thread Erik Skultety
On Wed, Feb 03, 2021 at 11:39:08AM -0600, Jonathon Jongsma wrote: > 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 | 18 +++--- > ...019_36ea_4111_8f0

Re: [libvirt PATCH v4 23/25] nodedev: add element to mdev caps

2021-02-21 Thread Erik Skultety
On Wed, Feb 03, 2021 at 11:39:07AM -0600, Jonathon Jongsma wrote: > 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

Re: [libvirt PATCH v4 21/25] api: add virNodeDeviceCreate()

2021-02-21 Thread Erik Skultety
On Wed, Feb 03, 2021 at 11:39:05AM -0600, Jonathon Jongsma wrote: > 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 > --- ...

Re: [libvirt PATCH v4 22/25] virsh: add "nodedev-start" command

2021-02-21 Thread Erik Skultety
On Wed, Feb 03, 2021 at 11:39:06AM -0600, Jonathon Jongsma wrote: > 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 > ---

Re: [libvirt PATCH v4 20/25] virsh: add nodedev-undefine command

2021-02-21 Thread Erik Skultety
On Wed, Feb 03, 2021 at 11:39:04AM -0600, Jonathon Jongsma wrote: > Add a virsh command that maps to virNodeDeviceUndefine(). > > Signed-off-by: Jonathon Jongsma Reviewed-by: Erik Skultety

Re: [libvirt PATCH v4 15/25] virsh: Add --inactive, --all to nodedev-list

2021-02-21 Thread Erik Skultety
On Wed, Feb 03, 2021 at 11:38:59AM -0600, Jonathon Jongsma wrote: > 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 --cap mdev >

Re: [PATCH RESEND 20/20] virhostdev.c: remove missing PCI devs from hostdev manager

2021-02-21 Thread Laine Stump
On 1/18/21 2:53 PM, Daniel Henrique Barboza wrote: virHostdevReAttachPCIDevices() is called when we want to re-attach a list of hostdevs back to the host, either on the shutdown path or via a 'virsh detach-device' call. This function always count on the existence of the device in the host to wor

Re: [PATCH RESEND 17/20] virpci.c: use virPCIDeviceAddressPtr in virPCIDeviceListFind()

2021-02-21 Thread Laine Stump
On 1/18/21 2:53 PM, Daniel Henrique Barboza wrote: Signed-off-by: Daniel Henrique Barboza --- src/hypervisor/virhostdev.c | 12 src/util/virpci.c | 16 src/util/virpci.h | 2 +- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git

Re: [PATCH RESEND 18/20] virpci.c: use virPCIDeviceAddressPtr in virPCIDeviceListSteal()

2021-02-21 Thread Laine Stump
On 1/18/21 2:53 PM, Daniel Henrique Barboza wrote: Signed-off-by: Daniel Henrique Barboza Reviewed-by: Laine Stump

Re: [PATCH RESEND 19/20] virpci.c: use virPCIDeviceAddressPtr in virPCIDeviceListDel()

2021-02-21 Thread Laine Stump
On 1/18/21 2:53 PM, Daniel Henrique Barboza wrote: This change will allow us to remove PCI devices from a list without the need of a PCI Device object, which will be need in the next patch. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Laine Stump

Re: [PATCH RESEND 16/20] virpci.c: use virPCIDeviceAddressPtr in virPCIDeviceListFindIndex()

2021-02-21 Thread Laine Stump
On 1/18/21 2:53 PM, Daniel Henrique Barboza wrote: We're going to need a way to remove a PCI Device from a list without having a valid virPCIDevicePtr, because the device is missing from the host. This means that virPCIDevicesListDel() must operate with a PCI Device address instead. Turns out th

Re: [PATCH RESEND 15/20] qemu_cgroup.c: skip absent PCI devices in qemuTeardownHostdevCgroup()

2021-02-21 Thread Laine Stump
On 1/18/21 2:53 PM, Daniel Henrique Barboza wrote: There is no need to bother with cgroup tearing down for absent PCI devices, given that their entries in the sysfs are already gone. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_cgroup.c | 10 ++ 1 file changed, 10 inserti

Re: [PATCH RESEND 14/20] virhostdev.c: add virHostdevIsPCIDevice() helper

2021-02-21 Thread Laine Stump
On 1/18/21 2:53 PM, Daniel Henrique Barboza wrote: Add a helper to quickly determine if a hostdev is a PCI device, instead of doing a tedius 'if' check with hostdev mode and s/tedius/tedious/ subsys type. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Laine Stump

Re: [PATCH RESEND 13/20] virsh-domain.c: modernize cmdDetachDevice()

2021-02-21 Thread Laine Stump
On 1/18/21 2:53 PM, Daniel Henrique Barboza wrote: Use g_auto* pointers to avoid the need of a cleanup label. The type of the pointer 'virDomainPtr dom' was changed to its alias 'virshDomainPtr' to allow the use of g_autoptr(). Signed-off-by: Daniel Henrique Barboza Reviewed-by: Laine Stump

Re: [PATCH RESEND 11/20] qemu_driver.c: modernize qemuNodeDeviceReAttach()

2021-02-21 Thread Laine Stump
On 1/18/21 2:53 PM, Daniel Henrique Barboza wrote: Add virObjectUnref an autoptr cleanup func for virNodeDevice, then remove all unref and free calls from qemuNodeDeviceReAttach(). Signed-off-by: Daniel Henrique Barboza --- src/datatypes.h| 2 ++ src/qemu/qemu_driver.c | 32

Re: [PATCH RESEND 10/20] libvirt-nodedev.c: remove return value from virNodeDeviceFree()

2021-02-21 Thread Laine Stump
On 1/18/21 2:53 PM, Daniel Henrique Barboza wrote: The function returns -1 on error, but no caller is actually checking the return value. Making it 'void' makes more sense with its current use. Signed-off-by: Daniel Henrique Barboza NAK - you can't change a public function. --- include/li

Re: [PATCH RESEND 09/20] dac, selinux: skip setting/restoring label for absent PCI devices

2021-02-21 Thread Laine Stump
On 1/18/21 2:53 PM, Daniel Henrique Barboza wrote: If the underlying PCI device of a hostdev does not exist in the host (e.g. a SR-IOV VF that was removed while the domain was running), skip security label handling for it. This will avoid errors that happens during qemuProcessStop() time, where

Re: [PATCH RESEND 06/20] virhostdev.c: virHostdevGetPCIHostDevice() now reports missing device

2021-02-21 Thread Laine Stump
On 1/18/21 2:53 PM, Daniel Henrique Barboza wrote: Gitlab issue #72 [1] reports that removing SR-IOVs VFs before removing the devices from the running domains can have strange consequences. QEMU might be able to hotunplug the device inside the guest, but Libvirt will not be aware of that, and the