Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 98543C433EF for ; Mon, 30 May 2022 10:42:27 +0000 (UTC) Received: from localhost ([::1]:48426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nvcqw-0005bi-Jz for qemu-devel@archiver.kernel.org; Mon, 30 May 2022 06:42:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvcon-0003yR-OB; Mon, 30 May 2022 06:40:14 -0400 Received: from relay.virtuozzo.com ([130.117.225.111]:55852) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvcom-0006kf-8W; Mon, 30 May 2022 06:40:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=MIME-Version:Message-Id:Date:Subject:From: Content-Type; bh=Pw1i4JHXQHsyKUpkFB9CPCw0yKaVrTyMoxAFsUxZR8s=; b=KgBLpKXx0dfX eCbWazTZkcMKyKq962SpIRTr2aUkWooWk5qJkeyKMG9G/p7VpG8nb6uSb/W3tW5+u2GMXvzxg7Nyh SBHzBKaWto3DKjJQMCJhwfeh4jkdF7GjlZ3OF3vfwBeIgoNUyKrCq+o/lJeZYyzTo2yizSrp1UquQ sd09Q=; Received: from [192.168.16.212] (helo=iris.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.94.2) (envelope-from ) id 1nvcn0-000aVc-SS; Mon, 30 May 2022 12:39:39 +0200 From: "Denis V. Lunev" To: qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: "Denis V. Lunev" , John Snow , Vladimir Sementsov-Ogievskiy , Kevin Wolf , Hanna Reitz , Eric Blake Subject: [PATCH 1/1] block: use 'unsigned' for in_flight field on driver state Date: Mon, 30 May 2022 12:39:57 +0200 Message-Id: <20220530103957.629398-1-den@openvz.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=130.117.225.111; envelope-from=den@openvz.org; helo=relay.virtuozzo.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This patch makes in_flight field 'unsigned' for BDRVNBDState and MirrorBlockJob. This matches the definition of this field on BDS and is generically correct - we should never get negative value here. Signed-off-by: Denis V. Lunev CC: John Snow CC: Vladimir Sementsov-Ogievskiy CC: Kevin Wolf CC: Hanna Reitz CC: Eric Blake --- block/mirror.c | 2 +- block/nbd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index d8ecb9efa2..3c4ab1159d 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -73,7 +73,7 @@ typedef struct MirrorBlockJob { uint64_t last_pause_ns; unsigned long *in_flight_bitmap; - int in_flight; + unsigned in_flight; int64_t bytes_in_flight; QTAILQ_HEAD(, MirrorOp) ops_in_flight; int ret; diff --git a/block/nbd.c b/block/nbd.c index 6085ab1d2c..512a53bf73 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -77,7 +77,7 @@ typedef struct BDRVNBDState { QemuMutex requests_lock; NBDClientState state; CoQueue free_sema; - int in_flight; + unsigned in_flight; NBDClientRequest requests[MAX_NBD_REQUESTS]; QEMUTimer *reconnect_delay_timer; -- 2.32.0