From patchwork Mon Apr 6 13:57:54 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 16539 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n36DvxjS006408 for ; Mon, 6 Apr 2009 13:57:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754610AbZDFN56 (ORCPT ); Mon, 6 Apr 2009 09:57:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754456AbZDFN56 (ORCPT ); Mon, 6 Apr 2009 09:57:58 -0400 Received: from mx2.redhat.com ([66.187.237.31]:42744 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754355AbZDFN56 (ORCPT ); Mon, 6 Apr 2009 09:57:58 -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 n36DvvjF003083 for ; Mon, 6 Apr 2009 09:57:57 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n36DvvgG010481; Mon, 6 Apr 2009 09:57:58 -0400 Received: from localhost.localdomain (virtlab1.virt.bos.redhat.com [10.16.72.21]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n36DvuPo001683; Mon, 6 Apr 2009 09:57:56 -0400 From: Glauber Costa To: kvm@vger.kernel.org Cc: avi@redhat.com Subject: [PATCH] propagate errors on failed migration. Date: Mon, 6 Apr 2009 09:57:54 -0400 Message-Id: <1239026274-13358-1-git-send-email-glommer@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org We're currently ignoring any errors if dirty logging fails. Set error on migration file if we're unable to put dirty logging on. Signed-off-by: Glauber Costa --- qemu/vl.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/qemu/vl.c b/qemu/vl.c index 8aa9ebc..4da73b8 100644 --- a/qemu/vl.c +++ b/qemu/vl.c @@ -3226,8 +3226,15 @@ 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; + r = 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 ch;