[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 09/11] migration: cleanup stats update into func
From: |
Peter Xu |
Subject: |
Re: [Qemu-devel] [PATCH 09/11] migration: cleanup stats update into function |
Date: |
Wed, 3 Jan 2018 18:58:54 +0800 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Wed, Jan 03, 2018 at 06:55:29PM +0800, Peter Xu wrote:
> On Wed, Jan 03, 2018 at 11:08:49AM +0100, Juan Quintela wrote:
> > Peter Xu <address@hidden> wrote:
> > > We have quite a few lines in migration_thread() that calculates some
> > > statistics for the migration interations. Isolate it into a single
> > > function to improve readability.
> > >
> > > Signed-off-by: Peter Xu <address@hidden>
> >
> >
> >
> > > +static void migration_update_statistics(MigrationState *s,
> >
> >
> > migration_update_counters()?
>
> Sure, or...
>
> >
> > statistics for me mean that they are only used for informative
> > purposes. Here we *act* on that values.
> >
> >
> > >
> > > - qemu_file_reset_rate_limit(s->to_dst_file);
> > > - initial_time = current_time;
> > > - initial_bytes = qemu_ftell(s->to_dst_file);
> > > - }
> > > + /* Conditionally update statistics */
> >
> > No need for the comment. If we think it is needed just rename the
> > function to:
> > conditionally_update_statistics()?
> >
> > I still preffer the:
> > migration_update_counters.
>
> ... migration_update_counters_conditionally()?
Forget that... It's too long to be liked.
I'll use migration_update_counters. Thanks,
--
Peter Xu