[libvirt] [PATCH] qemu: hotplug: Fix asynchronous unplug of 'shmem'

Peter Krempa posted 1 patch 5 years, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/69c20e1090059d8b359fdd435e8ba50db7269be1.1534490081.git.pkrempa@redhat.com
Test syntax-check passed
src/qemu/qemu_hotplug.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
[libvirt] [PATCH] qemu: hotplug: Fix asynchronous unplug of 'shmem'
Posted by Peter Krempa 5 years, 8 months ago
commit 5c81c342a7 forgot to skip the detaching of the shmem backend
when async unplug is requested which meant that we've tried to unplug
the backend prior to delivery of the DEVICE_DELETED event.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1618622

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_hotplug.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 5b52fe9edc..fa490c53e1 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -5479,11 +5479,16 @@ qemuDomainDetachShmemDevice(virQEMUDriverPtr driver,
     if (qemuDomainObjExitMonitor(driver, vm) < 0)
         goto cleanup;

-    if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
-        ret = qemuDomainRemoveShmemDevice(driver, vm, shmem);
+    if (async) {
+        ret = 0;
+    } else {
+        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
+            ret = qemuDomainRemoveShmemDevice(driver, vm, shmem);
+    }

  cleanup:
-    qemuDomainResetDeviceRemoval(vm);
+    if (!async)
+        qemuDomainResetDeviceRemoval(vm);
     return ret;
 }

-- 
2.16.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: hotplug: Fix asynchronous unplug of 'shmem'
Posted by Michal Privoznik 5 years, 8 months ago
On 08/17/2018 09:14 AM, Peter Krempa wrote:
> commit 5c81c342a7 forgot to skip the detaching of the shmem backend
> when async unplug is requested which meant that we've tried to unplug
> the backend prior to delivery of the DEVICE_DELETED event.
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1618622
> 
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  src/qemu/qemu_hotplug.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)

Ooops. ACK.

Michal

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