[libvirt] [PATCH] qemu: fix detach of hostdev based network interface

Daniel P. Berrangé posted 1 patch 4 years, 7 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20190913124331.11001-1-berrange@redhat.com
src/qemu/qemu_hotplug.c | 1 +
1 file changed, 1 insertion(+)
[libvirt] [PATCH] qemu: fix detach of hostdev based network interface
Posted by Daniel P. Berrangé 4 years, 7 months ago
This fixes bug in

  commit bbe2aa627f621e6749af374b22856184d1f351dc
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Thu Jul 26 17:24:30 2018 +0100

    conf: simplify link from hostdev back to network device

    hostdevs have a link back to the original network device. This is fairly
    generic accepting any type of device, however, we don't intend to make
    use of this approach in future. It can thus be specialized to network
    devices.

    Reviewed-by: Cole Robinson <crobinso@redhat.com>
    Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

which mistakenly deleted the assignment to the 'net' variable,
which meant we never invoked the network driver release callback

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 src/qemu/qemu_hotplug.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index bd8868b0f7..16070f2a57 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -4561,6 +4561,7 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver,
     }
 
     if (hostdev->parentnet) {
+        net = hostdev->parentnet;
         for (i = 0; i < vm->def->nnets; i++) {
             if (vm->def->nets[i] == hostdev->parentnet) {
                 virDomainNetRemove(vm->def, i);
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: fix detach of hostdev based network interface
Posted by Michal Privoznik 4 years, 7 months ago
On 9/13/19 2:43 PM, Daniel P. Berrangé wrote:
> This fixes bug in
> 
>    commit bbe2aa627f621e6749af374b22856184d1f351dc
>    Author: Daniel P. Berrangé <berrange@redhat.com>
>    Date:   Thu Jul 26 17:24:30 2018 +0100
> 
>      conf: simplify link from hostdev back to network device
> 
>      hostdevs have a link back to the original network device. This is fairly
>      generic accepting any type of device, however, we don't intend to make
>      use of this approach in future. It can thus be specialized to network
>      devices.
> 
>      Reviewed-by: Cole Robinson <crobinso@redhat.com>
>      Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> 
> which mistakenly deleted the assignment to the 'net' variable,
> which meant we never invoked the network driver release callback
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   src/qemu/qemu_hotplug.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
> index bd8868b0f7..16070f2a57 100644
> --- a/src/qemu/qemu_hotplug.c
> +++ b/src/qemu/qemu_hotplug.c
> @@ -4561,6 +4561,7 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver,
>       }
>   
>       if (hostdev->parentnet) {
> +        net = hostdev->parentnet;
>           for (i = 0; i < vm->def->nnets; i++) {
>               if (vm->def->nets[i] == hostdev->parentnet) {
>                   virDomainNetRemove(vm->def, i);
> 

He he.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal

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