From patchwork Sun May 17 15:43:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 24322 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 n4HFhjQm013021 for ; Sun, 17 May 2009 15:43:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754726AbZEQPnl (ORCPT ); Sun, 17 May 2009 11:43:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754721AbZEQPnj (ORCPT ); Sun, 17 May 2009 11:43:39 -0400 Received: from e7.ny.us.ibm.com ([32.97.182.137]:44902 "EHLO e7.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754674AbZEQPng (ORCPT ); Sun, 17 May 2009 11:43:36 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e7.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n4HFWOf9023663 for ; Sun, 17 May 2009 11:32:24 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4HFhbqX074668 for ; Sun, 17 May 2009 11:43:37 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n4HFfbiO030438 for ; Sun, 17 May 2009 11:41:37 -0400 Received: from localhost.localdomain (sig-9-65-8-189.mts.ibm.com [9.65.8.189]) by d01av02.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n4HFfPcV030035; Sun, 17 May 2009 11:41:36 -0400 From: Anthony Liguori To: kvm@vger.kernel.org Cc: Glauber Costa , Glauber Costa , Avi Kivity , Anthony Liguori Subject: [PATCH 09/17] Propagate errors on failed migration. Date: Sun, 17 May 2009 10:43:10 -0500 Message-Id: <1242574999-20887-10-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.6.0.6 In-Reply-To: <1242574999-20887-1-git-send-email-aliguori@us.ibm.com> References: <1242574999-20887-1-git-send-email-aliguori@us.ibm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Glauber Costa 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 Signed-off-by: Avi Kivity Signed-off-by: Anthony Liguori diff --git a/vl.c b/vl.c index 5d02e10..dd2ae4c 100644 --- a/vl.c +++ b/vl.c @@ -3195,8 +3195,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;