From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=42333 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OorUd-00057R-PF for qemu-devel@nongnu.org; Fri, 27 Aug 2010 01:28:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OorUc-000152-KD for qemu-devel@nongnu.org; Fri, 27 Aug 2010 01:28:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45561) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OorUc-00014w-C9 for qemu-devel@nongnu.org; Fri, 27 Aug 2010 01:28:46 -0400 From: Amit Shah Date: Fri, 27 Aug 2010 10:57:10 +0530 Message-Id: <51ec99ce2db02aeb34ec6683a76895b4a127057d.1282886503.git.amit.shah@redhat.com> In-Reply-To: References: In-Reply-To: References: Subject: [Qemu-devel] [PATCH v3 2/3] qerror: Add a new MACHINE_STOPPED error message List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu list Cc: Luiz Capitulino , agl@us.ibm.com, Amit Shah , Paolo Bonzini This error message denotes some command was not successful in completing as the guest was unresponsive. Use it in the virtio-balloon code when showing older, cached data. Signed-off-by: Amit Shah --- hw/virtio-balloon.c | 1 + qerror.c | 4 ++++ qerror.h | 3 +++ 3 files changed, 8 insertions(+), 0 deletions(-) diff --git a/hw/virtio-balloon.c b/hw/virtio-balloon.c index d6c66cf..309c343 100644 --- a/hw/virtio-balloon.c +++ b/hw/virtio-balloon.c @@ -140,6 +140,7 @@ static void complete_stats_request(VirtIOBalloon *vb) static void show_old_stats(void *opaque) { + qerror_report(QERR_MACHINE_STOPPED); complete_stats_request(opaque); } diff --git a/qerror.c b/qerror.c index 0af3ab3..b7a9f7f 100644 --- a/qerror.c +++ b/qerror.c @@ -141,6 +141,10 @@ static const QErrorStringTable qerror_table[] = { .desc = "Using KVM without %(capability), %(feature) unavailable", }, { + .error_fmt = QERR_MACHINE_STOPPED, + .desc = "The machine is stopped or the guest is taking too long to respond", + }, + { .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 62802ea..470577a 100644 --- a/qerror.h +++ b/qerror.h @@ -121,6 +121,9 @@ QError *qobject_to_qerror(const QObject *obj); #define QERR_KVM_MISSING_CAP \ "{ 'class': 'KVMMissingCap', 'data': { 'capability': %s, 'feature': %s } }" +#define QERR_MACHINE_STOPPED \ + "{ 'class': 'MachineStopped', 'data': {} }" + #define QERR_MIGRATION_EXPECTED \ "{ 'class': 'MigrationExpected', 'data': {} }" -- 1.7.2.2