qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] qemu_file_rate_limit


From: Peter Xu
Subject: Re: [Qemu-devel] qemu_file_rate_limit
Date: Thu, 6 Apr 2017 16:44:03 +0800
User-agent: Mutt/1.5.24 (2015-08-30)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]