Re: [PATCH] qemu: fix race in signal interrupt during QEMU startup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/29/20 8:03 PM, Daniel P. Berrangé wrote:
If a Ctrl-C arrives while we are in the middle of executing the
virDomainCreateXML call, we will have no "virDomainPtr" object
available, but QEMU may none the less be running.

This means we'll never try to stop the QEMU process before we
honour the Ctrl-C and exit.

To deal with this race we need to postpone quit of the event
loop if it is requested while in the middle of domain startup.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
  src/qemu/qemu_shim.c | 77 +++++++++++++++++++++++++++++++++++++++++---
  1 file changed, 72 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_shim.c b/src/qemu/qemu_shim.c
index 7e87b8fb96..bbcf9dc886 100644
--- a/src/qemu/qemu_shim.c
+++ b/src/qemu/qemu_shim.c
@@ -30,19 +30,61 @@
#define VIR_FROM_THIS VIR_FROM_QEMU +static GMutex eventLock;
+static bool eventNoQuitFlag;

This is not very mnemonic name. How about "eventPreventQuitFlag"?

Reviewed-by: Michal Privoznik <mprivozn@xxxxxxxxxx>

Michal




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux