From patchwork Thu Dec 13 15:40:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Hrdina X-Patchwork-Id: 206165 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 A78A52C00A5 for ; Fri, 14 Dec 2012 03:48:51 +1100 (EST) Received: from localhost ([::1]:49021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjAus-0002eF-IQ for incoming@patchwork.ozlabs.org; Thu, 13 Dec 2012 10:41:42 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjAuG-0001Aj-Db for qemu-devel@nongnu.org; Thu, 13 Dec 2012 10:41:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjAuF-0005tV-47 for qemu-devel@nongnu.org; Thu, 13 Dec 2012 10:41:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjAuE-0005tO-S0 for qemu-devel@nongnu.org; Thu, 13 Dec 2012 10:41:03 -0500 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 qBDFf2GX012594 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 13 Dec 2012 10:41:02 -0500 Received: from localhost.localdomain.com (dhcp-27-184.brq.redhat.com [10.34.27.184]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qBDFeqvL030229; Thu, 13 Dec 2012 10:41:01 -0500 From: Pavel Hrdina To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2012 16:40:42 +0100 Message-Id: <70bb440d178e3ebcaefa27f5817ea4f096e8e259.1355404685.git.phrdina@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: phrdina@redhat.com Subject: [Qemu-devel] [PATCH v2 08/17] savevm: add error parameter to qemu_savevm_state_begin() 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 Signed-off-by: Pavel Hrdina --- migration.c | 2 +- savevm.c | 7 +++++-- sysemu.h | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/migration.c b/migration.c index 73ce170..bf51a07 100644 --- a/migration.c +++ b/migration.c @@ -451,7 +451,7 @@ void migrate_fd_connect(MigrationState *s) s->file = qemu_fopen_ops_buffered(s); DPRINTF("beginning savevm\n"); - ret = qemu_savevm_state_begin(s->file, &s->params); + ret = qemu_savevm_state_begin(s->file, &s->params, NULL); if (ret < 0) { DPRINTF("failed, %d\n", ret); migrate_fd_error(s); diff --git a/savevm.c b/savevm.c index 3ee7da5..633a697 100644 --- a/savevm.c +++ b/savevm.c @@ -1601,7 +1601,8 @@ bool qemu_savevm_state_blocked(Error **errp) } int qemu_savevm_state_begin(QEMUFile *f, - const MigrationParams *params) + const MigrationParams *params, + Error **errp) { SaveStateEntry *se; int ret; @@ -1641,12 +1642,14 @@ int qemu_savevm_state_begin(QEMUFile *f, ret = se->ops->save_live_setup(f, se->opaque); if (ret < 0) { + error_setg(errp, "Failed to begin vmstate save."); qemu_savevm_state_cancel(f); return ret; } } ret = qemu_file_get_error(f); if (ret != 0) { + error_setg(errp, "%s", strerror(errno)); qemu_savevm_state_cancel(f); } @@ -1783,7 +1786,7 @@ static int qemu_savevm_state(QEMUFile *f) goto out; } - ret = qemu_savevm_state_begin(f, ¶ms); + ret = qemu_savevm_state_begin(f, ¶ms, NULL); if (ret < 0) goto out; diff --git a/sysemu.h b/sysemu.h index 1b6add2..07c5322 100644 --- a/sysemu.h +++ b/sysemu.h @@ -74,7 +74,8 @@ void qemu_announce_self(void); bool qemu_savevm_state_blocked(Error **errp); int qemu_savevm_state_begin(QEMUFile *f, - const MigrationParams *params); + const MigrationParams *params, + Error **errp); int qemu_savevm_state_iterate(QEMUFile *f); int qemu_savevm_state_complete(QEMUFile *f); void qemu_savevm_state_cancel(QEMUFile *f);