]> xenbits.xensource.com Git - libvirt.git/commitdiff
daemon stream: Convert @tx in daemonClientStream to bool
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 4 Apr 2016 10:49:48 +0000 (12:49 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 21 Apr 2016 14:29:41 +0000 (16:29 +0200)
This structure item is used as pure boolean. There's no need to
hold whole integer for it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
daemon/stream.c

index 2a9e6e42dd67d3bee6227b86fd47f7d8e00a2793..a2a370c14d21d15803229c29145bb758de025d09 100644 (file)
@@ -50,7 +50,7 @@ struct daemonClientStream {
     int filterID;
 
     virNetMessagePtr rx;
-    int tx;
+    bool tx;
 
     daemonClientStreamPtr next;
 };
@@ -99,7 +99,7 @@ daemonStreamMessageFinished(virNetMessagePtr msg,
     VIR_DEBUG("stream=%p proc=%d serial=%u",
               stream, msg->header.proc, msg->header.serial);
 
-    stream->tx = 1;
+    stream->tx = true;
     daemonStreamUpdateEvents(stream);
 
     daemonFreeClientStream(NULL, stream);
@@ -197,7 +197,7 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque)
         (events & VIR_STREAM_EVENT_HANGUP)) {
         virNetMessagePtr msg;
         events &= ~(VIR_STREAM_EVENT_HANGUP);
-        stream->tx = 0;
+        stream->tx = false;
         stream->recvEOF = true;
         if (!(msg = virNetMessageNew(false))) {
             daemonRemoveClientStream(client, stream);
@@ -422,7 +422,7 @@ int daemonAddClientStream(virNetServerClientPtr client,
     }
 
     if (transmit)
-        stream->tx = 1;
+        stream->tx = true;
 
     virMutexLock(&priv->lock);
     stream->next = priv->streams;
@@ -753,7 +753,7 @@ daemonStreamHandleRead(virNetServerClientPtr client,
                                                      stream->serial);
     } else {
         virNetMessagePtr msg;
-        stream->tx = 0;
+        stream->tx = false;
         if (ret == 0)
             stream->recvEOF = true;
         if (!(msg = virNetMessageNew(false)))