[libvirt] [PATCH] Use virNetServerClientImmediateClose() rather than virNetServerClientClose()

LanceLiu posted 1 patch 1 week ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/1574680987-96776-1-git-send-email-liu.lance.89@gmail.com
src/remote/remote_daemon_stream.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

[libvirt] [PATCH] Use virNetServerClientImmediateClose() rather than virNetServerClientClose()

Posted by LanceLiu 1 week ago
---
 src/remote/remote_daemon_stream.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/remote/remote_daemon_stream.c b/src/remote/remote_daemon_stream.c
index de0dca3..d206d12 100644
--- a/src/remote/remote_daemon_stream.c
+++ b/src/remote/remote_daemon_stream.c
@@ -141,7 +141,7 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque)
         (events & VIR_STREAM_EVENT_WRITABLE)) {
         if (daemonStreamHandleWrite(client, stream) < 0) {
             daemonRemoveClientStream(client, stream);
-            virNetServerClientClose(client);
+            virNetServerClientImmediateClose(client);
             goto cleanup;
         }
     }
@@ -151,7 +151,7 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque)
         events = events & ~(VIR_STREAM_EVENT_READABLE);
         if (daemonStreamHandleRead(client, stream) < 0) {
             daemonRemoveClientStream(client, stream);
-            virNetServerClientClose(client);
+            virNetServerClientImmediateClose(client);
             goto cleanup;
         }
         /* If we detected EOF during read processing,
@@ -176,7 +176,7 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque)
             if (daemonStreamHandleFinish(client, stream, msg) < 0) {
                 virNetMessageFree(msg);
                 daemonRemoveClientStream(client, stream);
-                virNetServerClientClose(client);
+                virNetServerClientImmediateClose(client);
                 goto cleanup;
             }
             break;
@@ -186,7 +186,7 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque)
             if (daemonStreamHandleAbort(client, stream, msg) < 0) {
                 virNetMessageFree(msg);
                 daemonRemoveClientStream(client, stream);
-                virNetServerClientClose(client);
+                virNetServerClientImmediateClose(client);
                 goto cleanup;
             }
             break;
@@ -205,7 +205,7 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque)
         stream->recvEOF = true;
         if (!(msg = virNetMessageNew(false))) {
             daemonRemoveClientStream(client, stream);
-            virNetServerClientClose(client);
+            virNetServerClientImmediateClose(client);
             goto cleanup;
         }
         msg->cb = daemonStreamMessageFinished;
@@ -219,7 +219,7 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque)
                                               "", 0) < 0) {
             virNetMessageFree(msg);
             daemonRemoveClientStream(client, stream);
-            virNetServerClientClose(client);
+            virNetServerClientImmediateClose(client);
             goto cleanup;
         }
     }
@@ -262,7 +262,7 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque)
         }
         daemonRemoveClientStream(client, stream);
         if (ret < 0)
-            virNetServerClientClose(client);
+        	virNetServerClientImmediateClose(client);
         goto cleanup;
     }
 
-- 
1.8.3.1


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] Use virNetServerClientImmediateClose() rather than virNetServerClientClose()

Posted by Ján Tomko 1 week ago
On Mon, Nov 25, 2019 at 07:23:07PM +0800, LanceLiu wrote:

Please include a description why this change is needed in the commit
message, to give the people looking at the git history some
understanding of it without having to go through the mailing list
archives.

See the following blog post for some commit message guidelines:
https://www.berrange.com/posts/2012/06/27/thoughts-on-improving-openstack-git-commit-practicehistory/

>---
> src/remote/remote_daemon_stream.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>

>@@ -262,7 +262,7 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque)
>         }
>         daemonRemoveClientStream(client, stream);
>         if (ret < 0)
>-            virNetServerClientClose(client);
>+        	virNetServerClientImmediateClose(client);

Looks like the indentation is off here.

Jano

>         goto cleanup;
>     }
>
>-- 
>1.8.3.1
>
>
>--
>libvir-list mailing list
>libvir-list@redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] Use virNetServerClientImmediateClose() rather than virNetServerClientClose()

Posted by Lance Liu 1 week ago
As I mentioned, I think add this patch will solve the problem you worried
about

LanceLiu <liu.lance.89@gmail.com> 于2019年11月25日周一 下午7:23写道:

> ---
>  src/remote/remote_daemon_stream.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/src/remote/remote_daemon_stream.c
> b/src/remote/remote_daemon_stream.c
> index de0dca3..d206d12 100644
> --- a/src/remote/remote_daemon_stream.c
> +++ b/src/remote/remote_daemon_stream.c
> @@ -141,7 +141,7 @@ daemonStreamEvent(virStreamPtr st, int events, void
> *opaque)
>          (events & VIR_STREAM_EVENT_WRITABLE)) {
>          if (daemonStreamHandleWrite(client, stream) < 0) {
>              daemonRemoveClientStream(client, stream);
> -            virNetServerClientClose(client);
> +            virNetServerClientImmediateClose(client);
>              goto cleanup;
>          }
>      }
> @@ -151,7 +151,7 @@ daemonStreamEvent(virStreamPtr st, int events, void
> *opaque)
>          events = events & ~(VIR_STREAM_EVENT_READABLE);
>          if (daemonStreamHandleRead(client, stream) < 0) {
>              daemonRemoveClientStream(client, stream);
> -            virNetServerClientClose(client);
> +            virNetServerClientImmediateClose(client);
>              goto cleanup;
>          }
>          /* If we detected EOF during read processing,
> @@ -176,7 +176,7 @@ daemonStreamEvent(virStreamPtr st, int events, void
> *opaque)
>              if (daemonStreamHandleFinish(client, stream, msg) < 0) {
>                  virNetMessageFree(msg);
>                  daemonRemoveClientStream(client, stream);
> -                virNetServerClientClose(client);
> +                virNetServerClientImmediateClose(client);
>                  goto cleanup;
>              }
>              break;
> @@ -186,7 +186,7 @@ daemonStreamEvent(virStreamPtr st, int events, void
> *opaque)
>              if (daemonStreamHandleAbort(client, stream, msg) < 0) {
>                  virNetMessageFree(msg);
>                  daemonRemoveClientStream(client, stream);
> -                virNetServerClientClose(client);
> +                virNetServerClientImmediateClose(client);
>                  goto cleanup;
>              }
>              break;
> @@ -205,7 +205,7 @@ daemonStreamEvent(virStreamPtr st, int events, void
> *opaque)
>          stream->recvEOF = true;
>          if (!(msg = virNetMessageNew(false))) {
>              daemonRemoveClientStream(client, stream);
> -            virNetServerClientClose(client);
> +            virNetServerClientImmediateClose(client);
>              goto cleanup;
>          }
>          msg->cb = daemonStreamMessageFinished;
> @@ -219,7 +219,7 @@ daemonStreamEvent(virStreamPtr st, int events, void
> *opaque)
>                                                "", 0) < 0) {
>              virNetMessageFree(msg);
>              daemonRemoveClientStream(client, stream);
> -            virNetServerClientClose(client);
> +            virNetServerClientImmediateClose(client);
>              goto cleanup;
>          }
>      }
> @@ -262,7 +262,7 @@ daemonStreamEvent(virStreamPtr st, int events, void
> *opaque)
>          }
>          daemonRemoveClientStream(client, stream);
>          if (ret < 0)
> -            virNetServerClientClose(client);
> +               virNetServerClientImmediateClose(client);
>          goto cleanup;
>      }
>
> --
> 1.8.3.1
>
>
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list