[libvirt] [PATCH v2 06/39] qemu_cgroup: Teardown Cgroup for more host device types

Michal Privoznik posted 39 patches 6 years, 4 months ago
There is a newer version of this series
[libvirt] [PATCH v2 06/39] qemu_cgroup: Teardown Cgroup for more host device types
Posted by Michal Privoznik 6 years, 4 months ago
Since its introduction in v1.0.5-rc1-19-g6e13860cb4 the
qemuTeardownHostdevCgroup() does nothing unless the passed
hostdev is a PCI device with VFIO backend. This seems
unnecessary.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/qemu/qemu_cgroup.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index 318157dab0..4d6f0c33cd 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -405,16 +405,10 @@ qemuTeardownHostdevCgroup(virDomainObjPtr vm,
     size_t i, npaths = 0;
     int rv, ret = -1;
 
-    /* currently this only does something for PCI devices using vfio
-     * for device assignment, but it is called for *all* hostdev
-     * devices.
-     */
-
     if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_DEVICES))
         return 0;
 
-    if (virHostdevIsVFIODevice(dev) &&
-        qemuDomainGetHostdevPath(vm->def, dev, true,
+    if (qemuDomainGetHostdevPath(vm->def, dev, true,
                                  &npaths, &path, NULL) < 0)
         goto cleanup;
 
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 06/39] qemu_cgroup: Teardown Cgroup for more host device types
Posted by Cole Robinson 6 years, 3 months ago
On 9/26/19 12:12 PM, Michal Privoznik wrote:
> Since its introduction in v1.0.5-rc1-19-g6e13860cb4 the
> qemuTeardownHostdevCgroup() does nothing unless the passed
> hostdev is a PCI device with VFIO backend. This seems
> unnecessary.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  src/qemu/qemu_cgroup.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
> index 318157dab0..4d6f0c33cd 100644
> --- a/src/qemu/qemu_cgroup.c
> +++ b/src/qemu/qemu_cgroup.c
> @@ -405,16 +405,10 @@ qemuTeardownHostdevCgroup(virDomainObjPtr vm,
>      size_t i, npaths = 0;
>      int rv, ret = -1;
>  
> -    /* currently this only does something for PCI devices using vfio
> -     * for device assignment, but it is called for *all* hostdev
> -     * devices.
> -     */
> -
>      if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_DEVICES))
>          return 0;
>  
> -    if (virHostdevIsVFIODevice(dev) &&
> -        qemuDomainGetHostdevPath(vm->def, dev, true,
> +    if (qemuDomainGetHostdevPath(vm->def, dev, true,
>                                   &npaths, &path, NULL) < 0)
>          goto cleanup;
>  
> 

Agreed, seems sensible to reflect qemuSetupHostdevCgroup

Reviewed-by: Cole Robinson <crobinso@redhat.com>

- Cole

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list