From patchwork Mon Nov 3 11:50:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 40016 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D10EC20560 for ; Mon, 3 Nov 2014 12:01:25 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id h11sf2648289wiw.3 for ; Mon, 03 Nov 2014 04:01:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=iWSIBWrY9fvh/d2FPZxiqTBxvpJ8e9y632WMewwKnBw=; b=DrWg6f2I9Q6XYweRmFw3q/EY7PwpFFuizOEB5wQGvg7RWoTA9WMTTOnyN2WdZY7h3O fbZY7o7OwO5qnNH3fhdLzqIHtQh+8w1Mba4/PMBIR9GZpitvdXVnE1uokpb8BVzNIjWd EY7MiHBdMjHfrakyhieIWnbQMFnk1FXM9ge8fTCDjwvjm5+tTl14+owYSkbfjLGsnMq0 KonzRMgqtUmf83VvPJ87NfTcEXXAibjPYp8RCNv9++iVzKviI321xtOfNp/ElrT13Op7 xbfUN/P/WHMCyPOBdoW+cwq+6qSUruz8EY9YWpmIe2P2C1Cj7vLBuZDhjgpxgo5X8igW wRsQ== X-Gm-Message-State: ALoCoQkGWS48oz62E3oWvxhiKsoYKUsSrD3+VHdM/9Yf5RhCczvT5VespfU/PZoROOAX2AQuVZ/d X-Received: by 10.112.16.35 with SMTP id c3mr378242lbd.13.1415016084997; Mon, 03 Nov 2014 04:01:24 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.129 with SMTP id t1ls789334lag.53.gmail; Mon, 03 Nov 2014 04:01:24 -0800 (PST) X-Received: by 10.152.27.1 with SMTP id p1mr44205884lag.55.1415016084795; Mon, 03 Nov 2014 04:01:24 -0800 (PST) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id qi2si32188442lbb.47.2014.11.03.04.01.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Nov 2014 04:01:24 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by mail-lb0-f169.google.com with SMTP id p9so3473672lbv.14 for ; Mon, 03 Nov 2014 04:01:24 -0800 (PST) X-Received: by 10.112.77.74 with SMTP id q10mr49836658lbw.66.1415016084619; Mon, 03 Nov 2014 04:01:24 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp222630lbz; Mon, 3 Nov 2014 04:01:23 -0800 (PST) X-Received: by 10.140.19.227 with SMTP id 90mr5379114qgh.12.1415016083029; Mon, 03 Nov 2014 04:01:23 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l7si29076919qge.108.2014.11.03.04.01.22 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 03 Nov 2014 04:01:23 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:33836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlGK1-0003o8-T1 for patch@linaro.org; Mon, 03 Nov 2014 07:01:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlGAi-0004Id-6T for qemu-devel@nongnu.org; Mon, 03 Nov 2014 06:51:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlGAd-0000B3-6e for qemu-devel@nongnu.org; Mon, 03 Nov 2014 06:51:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlGAc-0000Ah-Us for qemu-devel@nongnu.org; Mon, 03 Nov 2014 06:51:39 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sA3BpaUG006826 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 3 Nov 2014 06:51:36 -0500 Received: from localhost (ovpn-112-50.ams2.redhat.com [10.36.112.50]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sA3BpZ5B031656; Mon, 3 Nov 2014 06:51:36 -0500 From: Stefan Hajnoczi To: Date: Mon, 3 Nov 2014 11:50:18 +0000 Message-Id: <1415015456-25086-16-git-send-email-stefanha@redhat.com> In-Reply-To: <1415015456-25086-1-git-send-email-stefanha@redhat.com> References: <1415015456-25086-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , Stefan Hajnoczi Subject: [Qemu-devel] [PULL 15/53] block.c: Fix type of IoOperationType variable in send_qmp_error_event() 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Peter Maydell The local variable 'ac' in send_qmp_error_event() is declared with the wrong type, which causes clang to complain when it is initialized and again when it is used: block.c:3655:20: warning: implicit conversion from enumeration type 'enum IoOperationType' to different enumeration type 'BlockErrorAction' (aka 'enum BlockErrorAction') [-Wenum-conversion] ac = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE; ~ ^~~~~~~~~~~~~~~~~~~~~~ block.c:3655:45: warning: implicit conversion from enumeration type 'enum IoOperationType' to different enumeration type 'BlockErrorAction' (aka 'enum BlockErrorAction') [-Wenum-conversion] ac = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE; ~ ^~~~~~~~~~~~~~~~~~~~~~~ block.c:3656:62: warning: implicit conversion from enumeration type 'BlockErrorAction' (aka 'enum BlockErrorAction') to different enumeration type 'IoOperationType' (aka 'enum IoOperationType') [-Wenum-conversion] qapi_event_send_block_io_error(bdrv_get_device_name(bs), ac, action, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~ Correct the type to IoOperationType, and rename the variable to 'optype' to match its correct type. Signed-off-by: Peter Maydell Reviewed-by: Eric Blake Reviewed-by: Luiz Capitulino Message-id: 1412969583-21045-1-git-send-email-peter.maydell@linaro.org Signed-off-by: Stefan Hajnoczi --- block.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block.c b/block.c index 4179341..13a9e51 100644 --- a/block.c +++ b/block.c @@ -3544,10 +3544,10 @@ static void send_qmp_error_event(BlockDriverState *bs, BlockErrorAction action, bool is_read, int error) { - BlockErrorAction ac; + IoOperationType optype; - ac = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE; - qapi_event_send_block_io_error(bdrv_get_device_name(bs), ac, action, + optype = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE; + qapi_event_send_block_io_error(bdrv_get_device_name(bs), optype, action, bdrv_iostatus_is_enabled(bs), error == ENOSPC, strerror(error), &error_abort);