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

Re: [win-pv-devel] [PATCH 6/6] Add option to not spawn child process.



> -----Original Message-----
> From: win-pv-devel [mailto:win-pv-devel-bounces@xxxxxxxxxxxxxxxxxxxx] On
> Behalf Of owen.smith@xxxxxxxxxx
> Sent: 24 July 2017 14:36
> To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Owen Smith <owen.smith@xxxxxxxxxx>
> Subject: [win-pv-devel] [PATCH 6/6] Add option to not spawn child process.
> 
> From: Owen Smith <owen.smith@xxxxxxxxxx>
> 
> If the "Executable" registry parameter is not found, do not spawn
> a child process instead of failing.
> 
> Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>

Reviewed-by: Paul Durrant <paul.durrant@xxxxxxxxxx>

> ---
>  src/monitor/monitor.c | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
> index 6e1e85f..57513ff 100644
> --- a/src/monitor/monitor.c
> +++ b/src/monitor/monitor.c
> @@ -597,6 +597,10 @@ MonitorThread(
> 
>      Log("====>");
> 
> +    // If there is no executable, this thread can finish now.
> +    if (Context->Executable == NULL)
> +        goto done;
> +
>  again:
>      ZeroMemory(&ProcessInfo, sizeof (ProcessInfo));
>      ZeroMemory(&StartupInfo, sizeof (StartupInfo));
> @@ -649,6 +653,7 @@ again:
> 
>  //#undef WAIT_OBJECT_1
> 
> +done:
>      Log("<====");
> 
>      return 0;
> @@ -1272,7 +1277,7 @@ MonitorMain(
> 
>      Success = GetExecutable(&Context->Executable);
>      if (!Success)
> -        goto fail7;
> +        Context->Executable = NULL;
> 
>      Context->Device = INVALID_HANDLE_VALUE;
> 
> @@ -1286,7 +1291,7 @@ MonitorMain(
>                                     &Interface,
>                                     DEVICE_NOTIFY_SERVICE_HANDLE);
>      if (Context->InterfaceNotification == NULL)
> -        goto fail8;
> +        goto fail7;
> 
>      // The device may already by present
>      SetEvent(Context->AddEvent);
> @@ -1338,7 +1343,8 @@ done:
> 
>      UnregisterDeviceNotification(Context->InterfaceNotification);
> 
> -    free(Context->Executable);
> +    if (Context->Executable)
> +        free(Context->Executable);
> 
>      CloseHandle(Context->RemoveEvent);
> 
> @@ -1356,11 +1362,6 @@ done:
> 
>      return;
> 
> -fail8:
> -    Log("fail8");
> -
> -    free(Context->Executable);
> -
>  fail7:
>      Log("fail7");
> 
> --
> 2.8.3
> 
> 
> _______________________________________________
> win-pv-devel mailing list
> win-pv-devel@xxxxxxxxxxxxxxxxxxxx
> https://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.