Re: [PATCH 1/4] qemu_shim: Don't hang if failed to start domain

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

 



On Mon, 2021-03-01 at 12:49 +0100, Michal Privoznik wrote:
> +++ b/src/qemu/qemu_shim.c
> @@ -45,9 +45,12 @@ qemuShimEventLoop(void *opaque G_GNUC_UNUSED)
>      while (!quit) {
>          g_mutex_lock(&eventLock);
>          if (eventQuitFlag && !eventPreventQuitFlag) {
> +            quit = true;
>              if (dom) {
>                  virDomainDestroy(dom);
> -                quit = true;
> +            } else {
> +                g_mutex_unlock(&eventLock);
> +                break;
>              }
>          }
>          g_mutex_unlock(&eventLock);

I'm probably missing something obvious, but I thought this could be
simply

  while (!quit) {
      g_mutex_lock(&eventLock);
      if (eventQuitFlag && !eventPreventQuitFlag) {
          quit = true;
          if (dom) {
              virDomainDestroy(dom);
          }
      }
      g_mutex_unlock(&eventLock);
      virEventRunDefaultImpl();
  }

Do we specifically want to avoid call virEventRunDefaultImpl() one
last time if the domain has failed to start?

-- 
Andrea Bolognani / Red Hat / Virtualization




[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