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

Re: [libvirt] [PATCH 09/11] Inhibit desktop shutdown while any virtual machines are running



> @@ -728,6 +830,12 @@ void
> virNetServerRemoveShutdownInhibition(virNetServerPtr srv)
>  {
>      virNetServerLock(srv);
>      srv->autoShutdownInhibitions--;
> +
> +    VIR_DEBUG("srv=%p inhibitions=%zu", srv,
> srv->autoShutdownInhibitions);
> +
> +    if (srv->autoShutdownInhibitions == 0)
> +        VIR_FORCE_CLOSE(srv->autoShutdownInhibitFd);
> +
>      virNetServerUnlock(srv);
>  }
>  
> @@ -1065,6 +1173,8 @@ void virNetServerDispose(void *obj)
>      virNetServerPtr srv = obj;
>      int i;
>  
> +    VIR_FORCE_CLOSE(srv->autoShutdownInhibitFd);
> +

Don't these have to check if autoShutdownInhibitFd != -1 before closing?


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