From patchwork Fri Jun 17 16:37:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Supriya Kannery X-Patchwork-Id: 100837 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 522A5B6FC8 for ; Sat, 18 Jun 2011 03:29:11 +1000 (EST) Received: from localhost ([::1]:57792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXcqy-0008A1-1D for incoming@patchwork.ozlabs.org; Fri, 17 Jun 2011 13:29:08 -0400 Received: from eggs.gnu.org ([140.186.70.92]:51348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXbrt-0000RS-9a for qemu-devel@nongnu.org; Fri, 17 Jun 2011 12:26:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QXbrq-00083W-Cv for qemu-devel@nongnu.org; Fri, 17 Jun 2011 12:25:59 -0400 Received: from e5.ny.us.ibm.com ([32.97.182.145]:57197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXbrp-00083I-Vj for qemu-devel@nongnu.org; Fri, 17 Jun 2011 12:25:58 -0400 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by e5.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p5HFw2ba002801 for ; Fri, 17 Jun 2011 11:58:02 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p5HGPuOK166060 for ; Fri, 17 Jun 2011 12:25:56 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p5HGPtNw022161 for ; Fri, 17 Jun 2011 12:25:56 -0400 Received: from [127.0.0.1] ([9.79.233.226]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p5HGPlXu021453; Fri, 17 Jun 2011 12:25:53 -0400 From: Supriya Kannery To: qemu-devel@nongnu.org Date: Fri, 17 Jun 2011 22:07:48 +0530 Message-Id: <20110617163748.2933.72478.sendpatchset@skannery> In-Reply-To: <20110617163710.2933.89020.sendpatchset@skannery> References: <20110617163710.2933.89020.sendpatchset@skannery> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 32.97.182.145 Cc: Kevin Wolf , Supriya Kannery , Christoph Hellwig Subject: [Qemu-devel] [V3 2/3] Error classes for file reopen and device insertion 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 New error classes defined for cases where device not inserted and file reopen failed. Signed-off-by: Supriya Kannery --- qerror.c | 8 ++++++++ qerror.h | 6 ++++++ 2 files changed, 14 insertions(+) Index: qemu/qerror.c =================================================================== --- qemu.orig/qerror.c +++ qemu/qerror.c @@ -96,6 +96,14 @@ static const QErrorStringTable qerror_ta .error_fmt = QERR_DEVICE_NOT_REMOVABLE, .desc = "Device '%(device)' is not removable", }, + { + .error_fmt = QERR_DEVICE_NOT_INSERTED, + .desc = "Device '%(device)' has not been inserted", + }, + { + .error_fmt = QERR_REOPEN_FILE_FAILED, + .desc = "Could not reopen '%(filename)'", + }, { .error_fmt = QERR_DEVICE_NO_BUS, .desc = "Device '%(device)' has no child bus", Index: qemu/qerror.h =================================================================== --- qemu.orig/qerror.h +++ qemu/qerror.h @@ -85,6 +85,9 @@ QError *qobject_to_qerror(const QObject #define QERR_DEVICE_NOT_FOUND \ "{ 'class': 'DeviceNotFound', 'data': { 'device': %s } }" +#define QERR_DEVICE_NOT_INSERTED \ + "{ 'class': 'DeviceNotInserted', 'data': { 'device': %s } }" + #define QERR_DEVICE_NOT_REMOVABLE \ "{ 'class': 'DeviceNotRemovable', 'data': { 'device': %s } }" @@ -139,6 +142,9 @@ QError *qobject_to_qerror(const QObject #define QERR_OPEN_FILE_FAILED \ "{ 'class': 'OpenFileFailed', 'data': { 'filename': %s } }" +#define QERR_REOPEN_FILE_FAILED \ + "{ 'class': 'ReopenFileFailed', 'data': { 'filename': %s } }" + #define QERR_PROPERTY_NOT_FOUND \ "{ 'class': 'PropertyNotFound', 'data': { 'device': %s, 'property': %s } }"