<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Aug 14, 2018 at 12:13 PM Bjoern Walk <<a href="mailto:bwalk@linux.ibm.com">bwalk@linux.ibm.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Christian Ehrhardt <<a href="mailto:christian.ehrhardt@canonical.com" target="_blank">christian.ehrhardt@canonical.com</a>> [2018-08-14, 11:27AM +0200]:<br>
> diff --git a/src/util/virprocess.c b/src/util/virprocess.c<br>
> index ecea27a2d4..46360cc051 100644<br>
> --- a/src/util/virprocess.c<br>
> +++ b/src/util/virprocess.c<br>
> @@ -341,15 +341,19 @@ int virProcessKill(pid_t pid, int sig)<br>
>   * Returns 0 if it was killed gracefully, 1 if it<br>
>   * was killed forcibly, -1 if it is still alive,<br>
>   * or another error occurred.<br>
> + *<br>
> + * Callers can proide an extra delay to wait longer<br>
> + * than the default.<br>
>   */<br>
>  int<br>
> -virProcessKillPainfully(pid_t pid, bool force)<br>
> +virProcessKillPainfullyDelay(pid_t pid, bool force, unsigned int extradelay)<br>
>  {<br>
>      size_t i;<br>
>      int ret = -1;<br>
> +    unsigned int delay = 75 + (extradelay*5);<br>
>      const char *signame = "TERM";<br>
>  <br>
> -    VIR_DEBUG("vpid=%lld force=%d", (long long)pid, force);<br>
> +    VIR_DEBUG("vpid=%lld force=%d delay=%u", (long long)pid, force, pid);<br>
                                                                       ^<br>
This probably should be delay, right?<br>
</blockquote></div><div><br></div>Absolutely correct, bad old copy-pasta from the beginning of this change.<div>Thanks for spotting it.</div><div><br></div><div>Example is with 12 Devices passed through and force, which means with both patches applied:</div><div>- raise base value to wait after kill by 30 seconds (force is set) - second patch</div><div>- request 12*2 seconds extra for the devices - this patch</div><div>That should be 200+(12*2*5)=320 and that matches what I see int he log:</div><div><br></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0)">2018-08-16 13:04:51.999+0000: 61243: debug : virProcessKillPainfullyDelay:359 : vpid=60939 force=1 delay=320</span><br></span></div><div><br></div><div>I'm not pushing a V2 just for the change, but I have it queued with the fixed variable.</div><div>Any other feedback on this or the sibling patch?</div><div>Especially since those aren't my usual apparmor changes I'd really want some more reviews/acks before considering a push.<br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="color:rgb(136,136,136);font-size:12.8px">Christian Ehrhardt</span><div style="color:rgb(136,136,136);font-size:12.8px">Software Engineer, Ubuntu Server</div><div style="color:rgb(136,136,136);font-size:12.8px">Canonical Ltd</div></div></div></div></div></div></div>