[PATCH 15/20] stream: Access stream->prog instead of a hard-coded global variable

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

 



Use stream->prog instead of a hard-coded
virNetServerProgram. Especially since these functions are intended as
generic helpers for streams.

Signed-off-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxxxxxxx>
Reviewed-by: Bjoern Walk <bwalk@xxxxxxxxxxxxxxxxxx>
Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxxxxxxx>
---
 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 4dd3af9e0d59..21f0ecd53844 100644
--- a/src/remote/remote_daemon_stream.c
+++ b/src/remote/remote_daemon_stream.c
@@ -213,7 +213,7 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque)
         msg->cb = daemonStreamMessageFinished;
         msg->opaque = stream;
         stream->refs++;
-        if (virNetServerProgramSendStreamData(remoteProgram,
+        if (virNetServerProgramSendStreamData(stream->prog,
                                               client,
                                               msg,
                                               stream->procedure,
@@ -253,7 +253,7 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque)
         if (!msg) {
             ret = -1;
         } else {
-            ret = virNetServerProgramSendStreamError(remoteProgram,
+            ret = virNetServerProgramSendStreamError(stream->prog,
                                                      client,
                                                      msg,
                                                      &rerr,
@@ -644,7 +644,7 @@ daemonStreamHandleAbort(virNetServerClientPtr client,
     if (raise_error) {
         virNetMessageError rerr;
         memset(&rerr, 0, sizeof(rerr));
-        return virNetServerProgramSendReplyError(remoteProgram,
+        return virNetServerProgramSendReplyError(stream->prog,
                                                  client,
                                                  msg,
                                                  &rerr,
@@ -839,7 +839,7 @@ daemonStreamHandleRead(virNetServerClientPtr client,
         VIR_DEBUG("rv=%d inData=%d length=%lld", rv, inData, length);
 
         if (rv < 0) {
-            if (virNetServerProgramSendStreamError(remoteProgram,
+            if (virNetServerProgramSendStreamError(stream->prog,
                                                    client,
                                                    msg,
                                                    &rerr,
@@ -856,7 +856,7 @@ daemonStreamHandleRead(virNetServerClientPtr client,
                 msg->cb = daemonStreamMessageFinished;
                 msg->opaque = stream;
                 stream->refs++;
-                if (virNetServerProgramSendStreamHole(remoteProgram,
+                if (virNetServerProgramSendStreamHole(stream->prog,
                                                       client,
                                                       msg,
                                                       stream->procedure,
@@ -887,7 +887,7 @@ daemonStreamHandleRead(virNetServerClientPtr client,
         /* Should never get this, since we're only called when we know
          * we're readable, but hey things change... */
     } else if (rv < 0) {
-        if (virNetServerProgramSendStreamError(remoteProgram,
+        if (virNetServerProgramSendStreamError(stream->prog,
                                                client,
                                                msg,
                                                &rerr,
@@ -906,7 +906,7 @@ daemonStreamHandleRead(virNetServerClientPtr client,
         msg->cb = daemonStreamMessageFinished;
         msg->opaque = stream;
         stream->refs++;
-        if (virNetServerProgramSendStreamData(remoteProgram,
+        if (virNetServerProgramSendStreamData(stream->prog,
                                               client,
                                               msg,
                                               stream->procedure,
-- 
2.13.4

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux