From patchwork Thu Mar 19 15:43:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 452015 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D30F8140083 for ; Fri, 20 Mar 2015 02:47:39 +1100 (AEDT) Received: from localhost ([::1]:39792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYcfa-0000CR-2G for incoming@patchwork.ozlabs.org; Thu, 19 Mar 2015 11:47:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYcdO-0005FF-Cj for qemu-devel@nongnu.org; Thu, 19 Mar 2015 11:45:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYcdI-0000wU-Gn for qemu-devel@nongnu.org; Thu, 19 Mar 2015 11:45:22 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:32514 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYcdI-0000Fp-A2 for qemu-devel@nongnu.org; Thu, 19 Mar 2015 11:45:16 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq4GAODtClVbdWOb/2dsb2JhbABcgwaBLLMEAQEBAQEBBQF3gwSVDgKBR0wBAQEBAQF9hBABBXkQUTwbGYgzAc4LAQEBAQYCIIYKiX4HFoQXBZo2izSIdCKCAhyBUjwxgkMBAQE X-IPAS-Result: Aq4GAODtClVbdWOb/2dsb2JhbABcgwaBLLMEAQEBAQEBBQF3gwSVDgKBR0wBAQEBAQF9hBABBXkQUTwbGYgzAc4LAQEBAQYCIIYKiX4HFoQXBZo2izSIdCKCAhyBUjwxgkMBAQE X-IronPort-AV: E=Sophos;i="5.11,430,1422918000"; d="scan'208";a="337433291" Received: from fanzine.igalia.com ([91.117.99.155]) by smtp4.mundo-r.com with ESMTP; 19 Mar 2015 16:44:33 +0100 Received: from maestria.local.igalia.com ([192.168.10.14] helo=mail.igalia.com) by fanzine.igalia.com with esmtps (Cipher TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim) id 1YYccb-00011K-Le; Thu, 19 Mar 2015 16:44:33 +0100 Received: from fanzine.local.igalia.com ([192.168.10.13] helo=perseus.local) by mail.igalia.com with esmtps (Cipher TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim) id 1YYccR-0000JR-Mw; Thu, 19 Mar 2015 16:44:24 +0100 Received: from berto by perseus.local with local (Exim 4.84) (envelope-from ) id 1YYccQ-0006bk-7O; Thu, 19 Mar 2015 17:44:22 +0200 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Thu, 19 Mar 2015 17:43:42 +0200 Message-Id: <9d3f0e0ee6fcfc6300e165f79b46a4af0ffdc37d.1426779661.git.berto@igalia.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.51.32.191 Cc: Kevin Wolf , Alberto Garcia , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 3/3] block: allow BLOCK_IMAGE_CORRUPTED to have a node name 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 Since this event can occur in nodes that don't have a device name associated, use the node name as fallback in those cases. Signed-off-by: Alberto Garcia --- block/qcow2.c | 5 +++-- docs/qmp/qmp-events.txt | 2 +- qapi/block-core.json | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 168006b..d808c70 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -2832,8 +2832,9 @@ void qcow2_signal_corruption(BlockDriverState *bs, bool fatal, int64_t offset, "corruption events will be suppressed\n", message); } - qapi_event_send_block_image_corrupted(bdrv_get_device_name(bs), message, - offset >= 0, offset, size >= 0, size, + qapi_event_send_block_image_corrupted(bdrv_get_device_or_node_name(bs), + message, offset >= 0, offset, + size >= 0, size, fatal, &error_abort); g_free(message); diff --git a/docs/qmp/qmp-events.txt b/docs/qmp/qmp-events.txt index d759d19..75f3e68 100644 --- a/docs/qmp/qmp-events.txt +++ b/docs/qmp/qmp-events.txt @@ -35,7 +35,7 @@ Emitted when a disk image is being marked corrupt. Data: -- "device": Device name (json-string) +- "device": Device name, or node name if not present (json-string) - "msg": Informative message (e.g., reason for the corruption) (json-string) - "offset": If the corruption resulted from an image access, this is the access offset into the image (json-int) diff --git a/qapi/block-core.json b/qapi/block-core.json index 42c8850..3b51c68 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1751,7 +1751,7 @@ # # Emitted when a corruption has been detected in a disk image # -# @device: device name +# @device: device name, or node name if not present # # @msg: informative message for human consumption, such as the kind of # corruption being detected. It should not be parsed by machine as it is