From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] qemu: fix physical memory migration Date: Wed, 25 Mar 2009 14:05:41 +0200 Message-ID: <49CA1E15.8040402@redhat.com> References: <49C947B4.5030503@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Yaniv Kamay Return-path: Received: from mx2.redhat.com ([66.187.237.31]:51289 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759913AbZCYMFp (ORCPT ); Wed, 25 Mar 2009 08:05:45 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n2PC5hdq003320 for ; Wed, 25 Mar 2009 08:05:43 -0400 In-Reply-To: <49C947B4.5030503@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Yaniv Kamay wrote: > Hi, > > Attaching patch that: > > 1. Fix physical memory live migration. > - Stop dirty memory tracking after completion of memory transfer. > - In stage 3, updating dirty memory bits before collecting > remaining dirty blocks > in order to prevent missing dirty blokes in the range of > current_addr to phys_ram_size while > no dirty blocks exist in the range 0 - (current_addr - 1) > 2. Improve migration error handling Please split into three separate patches. > > +void qemu_file_set_has_error(QEMUFile *f); Better named qemu_file_set_error()? > diff --git a/qemu/vl.c b/qemu/vl.c > index 7ae266e..405212f 100644 > --- a/qemu/vl.c > +++ b/qemu/vl.c > @@ -3221,8 +3221,14 @@ static int ram_save_block(QEMUFile *f) > int found = 0; > > while (addr < phys_ram_size) { > - if (kvm_enabled() && current_addr == 0) > - kvm_update_dirty_pages_log(); /* FIXME: propagate errors */ > + if (kvm_enabled() && current_addr == 0) { > + int r; > + if ((r = kvm_update_dirty_pages_log())) { Compare against negative; it could return positive numbers in the future even on no error. > + printf("%s: update dirty pages log failed %d\n", > __FUNCTION__, r); qemu_log (in qemu-log.h) -- error compiling committee.c: too many arguments to function