From patchwork Wed Oct 10 13:35:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 190640 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 781EB2C008D for ; Thu, 11 Oct 2012 00:36:17 +1100 (EST) Received: from localhost ([::1]:50160 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLwSN-0000gj-KS for incoming@patchwork.ozlabs.org; Wed, 10 Oct 2012 09:36:15 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLwS6-0000fZ-21 for qemu-devel@nongnu.org; Wed, 10 Oct 2012 09:36:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TLwRv-0000mz-Mf for qemu-devel@nongnu.org; Wed, 10 Oct 2012 09:35:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12129) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLwRv-0000ma-7p for qemu-devel@nongnu.org; Wed, 10 Oct 2012 09:35:47 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9ADZjSY006498 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 10 Oct 2012 09:35:46 -0400 Received: from trasno.mitica (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q9ADZiOw021016; Wed, 10 Oct 2012 09:35:44 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 10 Oct 2012 15:35:43 +0200 Message-Id: <1349876143-13610-1-git-send-email-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v3 00/41] Migration cleanups, refactorings, stats, and more X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Hi v3: 20121010: - Add a reviwed-by: Paolo - fix whitespace on comment by Eric Anthony, please pull. Thanks, Juan. The following changes since commit b4ae3cfa57b8c1bdbbd7b7d420971e9171203ade: ssi: Add slave autoconnect helper (2012-10-10 11:13:32 +1000) are available in the git repository at: http://repo.or.cz/r/qemu/quintela.git migration-next-20121010 for you to fetch changes up to 630b8ac75a9baf981aa8dbd2d1275e8717b5a776: cpus: create qemu_in_vcpu_thread() (2012-10-10 15:29:56 +0200) v2: (20121001) - fix qemu_in_vcpu_thread: marcelo - fix "fix migration sync on setup" - addressed all marcelo comments Please, review. v1: (20120921) This is the mergable part of migration thread work that I am doing. What it does: - cleanups left and right - 2nd patch is a (fix migration sync) should be applied to stable IMHO Othrewise, we "could" be sending zero pages 2 times. - It introduces the stats discused previously * expected_downtime * downtime * dirty_pages_rate All Eric & Luiz comments have been addressed - buffered file has been basically unfolded. It was used only once, with one user. So we de-abstracted it. Notice that with migration patches, it makes no sense anymore - migration bitmap Now the bitmap is 1bit per page. Notice that this only affects to migration. For the rest (aka TCG & VGA), we still use the old bitmap. - remove qemu_file* functions that were not used or used only once - last_error: we have made that almost all error paths return one error instead of zero, so we use much, much less the error on the qemu_file. Some of the last remmants are: * still there due to callbacks (can be removed when the thread is integrated) * are on the read path (I haven't touched a lot of those yet) - qemu_cpu_is_vcpu() We used to test if we were _not_ an vcpu testing if we were the iothread. With the migration thread that is not true anymore. So create a function that does the right thing. Please review. Thanks, Juan. *** BLURB HERE *** Juan Quintela (40): buffered_file: g_realloc() can't fail fix migration sync migration: store end_time in a local variable migration: print total downtime for final phase of migration migration: rename expected_time to expected_downtime migration: export migrate_get_current() migration: print expected downtime in info migrate savevm: Factorize ram globals reset in its own function ram: introduce migration_bitmap_set_dirty() ram: Introduce migration_bitmap_test_and_reset_dirty() ram: Export last_ram_offset() ram: introduce migration_bitmap_sync() ram: create trace event for migration sync bitmap Separate migration bitmap migration: Add dirty_pages_rate to query migrate output buffered_file: rename opaque to migration_state buffered_file: opaque is MigrationState buffered_file: unfold migrate_fd_put_buffer buffered_file: unfold migrate_fd_put_ready buffered_file: unfold migrate_fd_wait_for_unfreeze buffered_file: unfold migrate_fd_close buffered_file: We can access directly to bandwidth_limit buffered_file: callers of buffered_flush() already check for errors buffered_file: make buffered_flush return the error code migration: make migrate_fd_wait_for_unfreeze() return errors savevm: unexport qemu_fflush virtio-net: use qemu_get_buffer() in a temp buffer savevm: Remove qemu_fseek() savevm: make qemu_fflush() return an error code savevm: unfold qemu_fclose_internal() savevm: unexport qemu_ftell() savevm: make qemu_fill_buffer() be consistent savevm: Only qemu_fflush() can generate errors buffered_file: buffered_put_buffer() don't need to set last_error block-migration: make flush_blks() return errors block-migration: Switch meaning of return value block-migration: handle errors with the return codes correctly savevm: un-export qemu_file_set_error() savevm: make qemu_file_put_notify() return errors cpus: create qemu_in_vcpu_thread() Paolo Bonzini (1): BufferedFile: append, then flush arch_init.c | 141 +++++++++++++++++++++++++++++++++++++++++------------- block-migration.c | 56 +++++++++++----------- buffered_file.c | 129 ++++++++++++++++++------------------------------- buffered_file.h | 12 +---- cpu-all.h | 3 +- cpus.c | 9 +++- exec-obsolete.h | 10 ---- exec.c | 2 +- hmp.c | 12 +++++ hw/virtio-net.c | 4 +- migration.c | 46 +++++++++--------- migration.h | 10 ++++ qapi-schema.json | 20 ++++++-- qemu-file.h | 8 +--- qmp-commands.hx | 9 ++++ savevm.c | 117 +++++++++++++++++--------------------------- trace-events | 4 ++ 17 files changed, 320 insertions(+), 272 deletions(-)