[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] migration: static variables will not be reset a
From: |
Gonglei (Arei) |
Subject: |
Re: [Qemu-devel] [PATCH] migration: static variables will not be reset at second migration |
Date: |
Tue, 24 Jun 2014 06:23:15 +0000 |
> -----Original Message-----
> From: Juan Quintela [mailto:address@hidden
> Sent: Friday, March 21, 2014 9:26 PM
> To: Gonglei (Arei)
> Cc: address@hidden; address@hidden; address@hidden;
> address@hidden; address@hidden; chenliang (T)
> Subject: Re: [PATCH] migration: static variables will not be reset at second
> migration
>
> <address@hidden> wrote:
> > From: ChenLiang <address@hidden>
> >
> > The static variables in migration_bitmap_sync will not be reset in
> > the case of a second attempted migration.
> >
> > Signed-off-by: ChenLiang <address@hidden>
> > Signed-off-by: Gonglei <address@hidden>
>
> Good catch. Applied..
>
Hi, Juan? Ping... please :)
Best regards,
-Gonglei
> > ---
> > arch_init.c | 15 ++++++++++++---
> > 1 file changed, 12 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch_init.c b/arch_init.c
> > index 60c975d..10516cb 100644
> > --- a/arch_init.c
> > +++ b/arch_init.c
> > @@ -468,15 +468,23 @@ static void
> migration_bitmap_sync_range(ram_addr_t start, ram_addr_t length)
> >
> >
> > /* Needs iothread lock! */
> > +/* Fix me: there are too many global variables used in migration process.
> > */
> > +static int64_t start_time;
> > +static int64_t bytes_xfer_prev;
> > +static int64_t num_dirty_pages_period;
> > +
> > +static void migration_bitmap_sync_init(void)
> > +{
> > + start_time = 0;
> > + bytes_xfer_prev = 0;
> > + num_dirty_pages_period = 0;
> > +}
> >
> > static void migration_bitmap_sync(void)
> > {
> > RAMBlock *block;
> > uint64_t num_dirty_pages_init = migration_dirty_pages;
> > MigrationState *s = migrate_get_current();
> > - static int64_t start_time;
> > - static int64_t bytes_xfer_prev;
> > - static int64_t num_dirty_pages_period;
> > int64_t end_time;
> > int64_t bytes_xfer_now;
> >
> > @@ -733,6 +741,7 @@ static int ram_save_setup(QEMUFile *f, void
> *opaque)
> > migration_dirty_pages = ram_pages;
> > mig_throttle_on = false;
> > dirty_rate_high_cnt = 0;
> > + migration_bitmap_sync_init();
> >
> > if (migrate_use_xbzrle()) {
> > qemu_mutex_lock_iothread();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH] migration: static variables will not be reset at second migration,
Gonglei (Arei) <=