* Sanidhya Kashyap (sanidhya.ii...@gmail.com) wrote:

<snip>
One more I forgot:

> +    while (b->current_epoch <= b->total_epochs) {
> +        if (!runstate_check(RUN_STATE_DUMP_BITMAP) ||
> +            b->state != LOG_BITMAP_STATE_ACTIVE) {
> +            goto log_thread_end;
> +        }
> +        bitmap_zero(logging_bitmap, ram_bitmap_pages);
> +        logging_lock();
> +        dirty_bitmap_sync();
> +        logging_unlock();
> +
> +        ret = qemu_write_full(fd, logging_bitmap, bitmap_size);
> +        if (ret < bitmap_size) {
> +            b->state = LOG_BITMAP_STATE_ERROR;
> +            goto log_thread_end;
> +        }
> +
> +        ret = qemu_write_full(fd, &marker, sizeof(char));
> +        if (ret < sizeof(char)) {
> +            b->state = LOG_BITMAP_STATE_ERROR;
> +            goto log_thread_end;
> +        }
> +        g_usleep(b->current_frequency * 1000);

Be careful; lets say that was set to 20ms, you wouldn't
get 50 dumps a second, since you *add* that delay to the
rest of the time in the loop.

Dave
--
Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK

Reply via email to