[Spice-devel] [PATCH spice 06/11] server/red_channel: support network monitoring

Christophe Fergeau cfergeau at redhat.com
Tue Apr 10 06:03:11 PDT 2012


On Tue, Apr 10, 2012 at 03:53:17PM +0300, Yonit Halperin wrote:
> On 04/10/2012 03:34 PM, Christophe Fergeau wrote:
> >On Sun, Apr 08, 2012 at 06:43:15PM +0300, Yonit Halperin wrote:
> >>+static void red_channel_client_net_monitor_qos_timer(void *opaque)
> >>+{
> >>+    RedChannelClient *rcc = opaque;
> >>+    int *qos_state =&rcc->net_monitor.qos.state;
> >>+
> >>+    spice_assert(*qos_state != NET_MONITOR_STATE_INVALID);
> >>+
> >>+    if (*qos_state == NET_MONITOR_STATE_COMPLETE) {
> >>+        *qos_state = NET_MONITOR_STATE_PENDING;
> >>+        rcc->net_monitor.qos.size_th = NET_MONITOR_QOS_QUERY_SIZE;
> >
> >size_th ? what does that mean?
> >
> th=threshold. The minimal size we require for sending QOS_QUERY

I'd use the full name then, same in one of the followup patches.

> >>+    } else {
> >>+        spice_assert(*qos_state == NET_MONITOR_STATE_PENDING);
> >>+        rcc->net_monitor.qos.size_th = MAX(NET_MONITOR_QOS_QUERY_SIZE_MIN,
> >>+                                           (rcc->net_monitor.qos.size_th - 10000));
> >
> >Why the - 10000?
> >
> Since the timeout reached, and we no message reached the size limit,
> I chose to decrease the limit (for example, if the resolution is
> very small, we will never reach the threshold). 10000 was arbitrary
> choice.
> >>+        rcc->channel->core->timer_start(rcc->net_monitor.qos.timer, NET_MONITOR_TIMEOUT_MS / 2);
> >
> >Why half the timeout?
> >
> In order not to wait too much time.


I'd add a comment explaining these 2 things then since they are arbitrary
choices, and things would probably work without these changes.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20120410/18418e6c/attachment.pgp>


More information about the Spice-devel mailing list