All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] qemu_file_rate_limit
@ 2017-04-06  8:13 ali saeedi
  2017-04-06  8:44 ` Peter Xu
  0 siblings, 1 reply; 2+ messages in thread
From: ali saeedi @ 2017-04-06  8:13 UTC (permalink / raw)
  To: qemu-devel

Hi
what does 'qemu_file_rate_limit' function do?
thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] qemu_file_rate_limit
  2017-04-06  8:13 [Qemu-devel] qemu_file_rate_limit ali saeedi
@ 2017-04-06  8:44 ` Peter Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Xu @ 2017-04-06  8:44 UTC (permalink / raw)
  To: ali saeedi; +Cc: qemu-devel

On Thu, Apr 06, 2017 at 12:43:16PM +0430, ali saeedi wrote:
> Hi
> what does 'qemu_file_rate_limit' function do?
> thanks

It returns 1 if the stream is not full (so that we can continue send
something), otherwise 0.

Generally, it's used like:

  if (qemu_file_rate_limit(f)) {
      /* we can still send something to the stream since it's not full */
  } else {
      /*
       * either the stream is broken, or we have already sent enough
       * data, so that it's reaching the limit we set via
       * qemu_file_set_rate_limit(). We should not send anything now.
       */
  }

And I would suggest avoid sending the same topic in two days. :)

-- peterx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-06  8:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06  8:13 [Qemu-devel] qemu_file_rate_limit ali saeedi
2017-04-06  8:44 ` Peter Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.