From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Merging KVM live migration upstream Date: Fri, 01 May 2009 11:12:18 +0200 Message-ID: <49FABCF2.70909@web.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigAB8063F57888B72AA521310C" Cc: Anthony Liguori , kvm-devel To: Avi Kivity , Uri Lublin Return-path: Received: from fmmailgate01.web.de ([217.72.192.221]:37074 "EHLO fmmailgate01.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753936AbZEAJM7 (ORCPT ); Fri, 1 May 2009 05:12:59 -0400 Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigAB8063F57888B72AA521310C Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Avi or Uri, could you explain the first and third hunk? Why are they needed in qemu-kvm, and will we also need something comparable upstream? They do not look very beautiful. The second hunk, I guess, should become a kvm hook to cpu_physical_memory_get_dirty - or is this too costly for other users of this inline function? And does anyone knows further migration-related hunks that are missing upstream (except for the KVM hook in cpu_physical_memory_set_dirty_tracking)? Jan --- qemu/vl.c +++ qemu-kvm/vl.c @@ -3097,6 +3204,8 @@ static int ram_load_v1(QEMUFile *f, void if (qemu_get_be32(f) !=3D last_ram_offset) return -EINVAL; for(i =3D 0; i < last_ram_offset; i+=3D TARGET_PAGE_SIZE) { + if (kvm_enabled() && (i>=3D0xa0000) && (i<0xc0000)) /* do not ac= cess video-addresses */ + continue; ret =3D ram_get_page(f, qemu_get_ram_ptr(i), TARGET_PAGE_SIZE); if (ret) return ret; @@ -3183,6 +3292,15 @@ static int ram_save_block(QEMUFile *f) int found =3D 0; while (addr < last_ram_offset) { + if (kvm_enabled() && current_addr =3D=3D 0) { + int r; + r =3D kvm_update_dirty_pages_log(); + if (r) { + fprintf(stderr, "%s: update dirty pages log failed %d\n"= , __FUNCTION__, r); + qemu_file_set_error(f); + return 0; + } + } if (cpu_physical_memory_get_dirty(current_addr, MIGRATION_DIRTY_= FLAG)) { uint8_t *p; @@ -3273,6 +3391,8 @@ static int ram_load_dead(QEMUFile *f, vo if (ram_decompress_open(s, f) < 0) return -EINVAL; for(i =3D 0; i < last_ram_offset; i+=3D BDRV_HASH_BLOCK_SIZE) { + if (kvm_enabled() && (i>=3D0xa0000) && (i<0xc0000)) /* do not ac= cess video-addresses */ + continue; if (ram_decompress_buf(s, buf, 1) < 0) { fprintf(stderr, "Error while reading ram block header\n"); goto error; --------------enigAB8063F57888B72AA521310C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkn6vPcACgkQniDOoMHTA+kK+gCfYmK9tNrcQTMZQRbxpdveogh4 w8AAnRvb3KN80iHQddDc9OyJ1IBlGOvh =VKx+ -----END PGP SIGNATURE----- --------------enigAB8063F57888B72AA521310C--