From patchwork Fri Mar 16 19:26:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 147247 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 4E22CB6EF1 for ; Sat, 17 Mar 2012 06:26:50 +1100 (EST) Received: from localhost ([::1]:53809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8cnY-0004Ob-2x for incoming@patchwork.ozlabs.org; Fri, 16 Mar 2012 15:26:48 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8cnB-0004GE-TF for qemu-devel@nongnu.org; Fri, 16 Mar 2012 15:26:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8cn9-0003g8-5n for qemu-devel@nongnu.org; Fri, 16 Mar 2012 15:26:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8cn8-0003ew-VM for qemu-devel@nongnu.org; Fri, 16 Mar 2012 15:26:23 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2GJQL6S032134 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 Mar 2012 15:26:21 -0400 Received: from localhost (ovpn-113-27.phx2.redhat.com [10.3.113.27]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q2GJQKq1026039; Fri, 16 Mar 2012 15:26:21 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Fri, 16 Mar 2012 16:26:18 -0300 Message-Id: <1331925981-19914-2-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1331925981-19914-1-git-send-email-lcapitulino@redhat.com> References: <1331925981-19914-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: aliguori@us.ibm.com Subject: [Qemu-devel] [PATCH 1/4] QError: Introduce new errors for the migration command 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 The new errors are QERR_MIGRATION_ACTIVE and QERR_MIGRATION_NOT_SUPPORTED, which are going to be used by the QAPI converted migration command. Signed-off-by: Luiz Capitulino --- qerror.c | 8 ++++++++ qerror.h | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/qerror.c b/qerror.c index f55d435..41c729a 100644 --- a/qerror.c +++ b/qerror.c @@ -193,6 +193,14 @@ static const QErrorStringTable qerror_table[] = { .desc = "Using KVM without %(capability), %(feature) unavailable", }, { + .error_fmt = QERR_MIGRATION_ACTIVE, + .desc = "There's a migration process in progress", + }, + { + .error_fmt = QERR_MIGRATION_NOT_SUPPORTED, + .desc = "State blocked by non-migratable device '%(device)'", + }, + { .error_fmt = QERR_MIGRATION_EXPECTED, .desc = "An incoming migration is expected before this command can be executed", }, diff --git a/qerror.h b/qerror.h index e26c635..e16f9c2 100644 --- a/qerror.h +++ b/qerror.h @@ -166,6 +166,12 @@ QError *qobject_to_qerror(const QObject *obj); #define QERR_KVM_MISSING_CAP \ "{ 'class': 'KVMMissingCap', 'data': { 'capability': %s, 'feature': %s } }" +#define QERR_MIGRATION_ACTIVE \ + "{ 'class': 'MigrationActive', 'data': {} }" + +#define QERR_MIGRATION_NOT_SUPPORTED \ + "{ 'class': 'MigrationNotSupported', 'data': {'device': %s} }" + #define QERR_MIGRATION_EXPECTED \ "{ 'class': 'MigrationExpected', 'data': {} }"