From patchwork Fri May 15 09:19:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 282676 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 544A7C433DF for ; Fri, 15 May 2020 09:20:56 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 1C61F206F1 for ; Fri, 15 May 2020 09:20:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="F+nnXDrO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1C61F206F1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZWWV-0007HE-7D for qemu-devel@archiver.kernel.org; Fri, 15 May 2020 05:20:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZWVK-0005RL-BE for qemu-devel@nongnu.org; Fri, 15 May 2020 05:19:42 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:28383 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jZWVJ-0005Y5-Li for qemu-devel@nongnu.org; Fri, 15 May 2020 05:19:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589534380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rWEDFkY5Rmel12C/HQ1l0LLLTQtkfAgXAPazusvQxAw=; b=F+nnXDrOv0BSa5c8yTVAvNIyscxMIvtn07rBU6mQYf1fMpALwJMeBhNTw/spnx4KfiWvd7 9rbVym/0XxKFGHJleUcG7MNdz0/Mso+QyZk4JdxH1Y31U25jSNdP7v2KFx7HQO9eUtqYCC BgCUmy1c6ckxfAzVCQgCw15TMWAMUdQ= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-235-kW0_d00dMJSwwZmcukx7LQ-1; Fri, 15 May 2020 05:19:37 -0400 X-MC-Unique: kW0_d00dMJSwwZmcukx7LQ-1 Received: by mail-wr1-f71.google.com with SMTP id 30so870609wrq.15 for ; Fri, 15 May 2020 02:19:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rWEDFkY5Rmel12C/HQ1l0LLLTQtkfAgXAPazusvQxAw=; b=KqzwIIhJceYqcN6Oev8sizElbO5c9vQ4hO7SbuH70qe6/O2TS7Ynpye5Q0+Y1o6jur f/UmZGX6xMTIoj1mLCnETkG2Fb0W+1ehqmNUjqrzDDcwDVgvwxvJ0yfeV7EEi2HJfpZq Uc6mQ50lywGJqki8w0P7V1pgJ3a04Gn5TGcqmD2zqMTOAXtJZzdDvaepqqGuCOXYHU6g PwLcI4L8f9mcXdfTIQnzkkjMq7PSZ0F3DQ+HOPyiJCnRNwq0abIYZIti0rlKYriUvb06 UlyIaIe5DYhNjLVDVp0NwUw8O6oRb9Hp9BrWqJnSQBcQ6RJNO58KTNqXGcUFTu2bPtgO gfVg== X-Gm-Message-State: AOAM53070zdHT379mKcmrRkeejBQqXcQ5A1O9d9Ef4aGJ381dHGsaIBx AKpH6O35scLc/rC05V0yyZnkF0NIIyO49Dw0aXhW2+q//VcLJAcOv5mROClqvGfpZx1yKoQ/Tw3 715zQQpn9fZbbmco= X-Received: by 2002:a1c:e4c1:: with SMTP id b184mr3079994wmh.4.1589534375721; Fri, 15 May 2020 02:19:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeS3ClRqfcuLfcXZ5mQOeVo3yT2q6D1UXw2xHzRmoHzwp0bdezUQLxOhJssxPeukKl8CaYNQ== X-Received: by 2002:a1c:e4c1:: with SMTP id b184mr3079974wmh.4.1589534375505; Fri, 15 May 2020 02:19:35 -0700 (PDT) Received: from x1w.redhat.com (17.red-88-21-202.staticip.rima-tde.net. [88.21.202.17]) by smtp.gmail.com with ESMTPSA id 8sm1476820wmb.15.2020.05.15.02.19.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:19:35 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 2/5] qemu/bitmap: Document bitmap_new() returned pointer Date: Fri, 15 May 2020 11:19:21 +0200 Message-Id: <20200515091924.14380-3-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200515091924.14380-1-philmd@redhat.com> References: <20200515091924.14380-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/14 22:56:02 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/bitmap.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/qemu/bitmap.h b/include/qemu/bitmap.h index 82a1d2f41f..0b390ff576 100644 --- a/include/qemu/bitmap.h +++ b/include/qemu/bitmap.h @@ -90,12 +90,14 @@ int slow_bitmap_intersects(const unsigned long *bitmap1, const unsigned long *bitmap2, long bits); long slow_bitmap_count_one(const unsigned long *bitmap, long nbits); +/* callers must free the returned pointer with g_free() */ static inline unsigned long *bitmap_try_new(long nbits) { long len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); return g_try_malloc0(len); } +/* callers must free the returned pointer with g_free() */ static inline unsigned long *bitmap_new(long nbits) { unsigned long *ptr = bitmap_try_new(nbits); From patchwork Fri May 15 09:19:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 282675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98454C433E0 for ; Fri, 15 May 2020 09:21:58 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5FE16206F1 for ; Fri, 15 May 2020 09:21:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MnQIbDX8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5FE16206F1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:44610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZWXV-0001EW-HW for qemu-devel@archiver.kernel.org; Fri, 15 May 2020 05:21:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZWVN-0005Xi-An for qemu-devel@nongnu.org; Fri, 15 May 2020 05:19:45 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:51650 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jZWVL-0005Yq-Vc for qemu-devel@nongnu.org; Fri, 15 May 2020 05:19:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589534383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LF0tsEpR65YIc+luskV1kHZ6WOfSSsruPgdBzkTKH7s=; b=MnQIbDX81PCjg6ilJaph4w6u5ADP6mCGZzp2PuR0ZNZrOsZb+V4IgFrhkJDmVcJNrPPivs uZve6E1vk5gNSMxsKCh0WKcxWmd/xDQtDNFLjyhc3m/vW0q2ox0GRKFRjsuS719K77hbbU E+8rY4l1JQI8kacqDGC2sz5jTpSVMHc= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-206-l4vp5rK7P5myWIo4t_8TTg-1; Fri, 15 May 2020 05:19:41 -0400 X-MC-Unique: l4vp5rK7P5myWIo4t_8TTg-1 Received: by mail-wr1-f70.google.com with SMTP id z5so866293wrt.17 for ; Fri, 15 May 2020 02:19:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LF0tsEpR65YIc+luskV1kHZ6WOfSSsruPgdBzkTKH7s=; b=uNlPXZIMhYhkY2CT+xG0Kbz4ZNNQLFYisODPQABtUk6WvX1hC0aUWmjQ4vQqSKhd3/ LTWDVhR8B1x9a4XX1fYsiWG7bafi01Iwkn+BLYczegNenCOMkPZTriEeEN0gCaZNJZoW x1+Z+LK3EiBpN4CGxp83kU7f1TvY3IIZ5FxCmpnool4tP9rSCov6dqIiH+qzjgCCRYcQ UQqW5e5cGRCZqZ0QPaW5DWPsAIJyYJlOh1X2ataPNZtSsitt3O+NCgV/b6tG2NkW40aN LsJXppG5SuSKpNL7xjma7+Js4/IVX+rdeR6PfH9O1/fwxS8YY9qKDL51I722blvVjA8p Gp1Q== X-Gm-Message-State: AOAM532WjZUGK5xq2N7b+2TAfq6cT56k27GkiLe3vlEb9QGnLoM+2Kkc R5btnX0xKPO7ga9bK7i/ysUeIhnBBk7PimfcS363rZowPUm1XoFBIPlpKMLsRarbcNwW/tDn7K6 VKmARj08QLvpFbAw= X-Received: by 2002:a7b:cc84:: with SMTP id p4mr3150553wma.159.1589534380547; Fri, 15 May 2020 02:19:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLiq76g2NxXRpxdMzXZb6yLUfop6/o/xxODFq+49OENhv5SbJdjhDEoy93rEc+QuOAJ16e9A== X-Received: by 2002:a7b:cc84:: with SMTP id p4mr3150539wma.159.1589534380389; Fri, 15 May 2020 02:19:40 -0700 (PDT) Received: from x1w.redhat.com (17.red-88-21-202.staticip.rima-tde.net. [88.21.202.17]) by smtp.gmail.com with ESMTPSA id b14sm2689293wmb.18.2020.05.15.02.19.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:19:39 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 3/5] block/block: Document BlockSizes fields Date: Fri, 15 May 2020 11:19:22 +0200 Message-Id: <20200515091924.14380-4-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200515091924.14380-1-philmd@redhat.com> References: <20200515091924.14380-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=205.139.110.61; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/15 00:07:24 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" As it is not obvious for a block neophyte what means the 'log' value, document it. Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé --- include/block/block.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/block/block.h b/include/block/block.h index 480e6b6837..6836876da1 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -86,8 +86,8 @@ typedef enum { } BdrvRequestFlags; typedef struct BlockSizes { - uint32_t phys; - uint32_t log; + uint32_t phys; /* physical block size */ + uint32_t log; /* logical block size */ } BlockSizes; typedef struct HDGeometry { From patchwork Fri May 15 09:19:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 282674 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77D51C433E0 for ; Fri, 15 May 2020 09:23:24 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 40B8D206F1 for ; Fri, 15 May 2020 09:23:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MKhme/IY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40B8D206F1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZWYt-0003Lg-DC for qemu-devel@archiver.kernel.org; Fri, 15 May 2020 05:23:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34996) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZWVX-0005qo-CO for qemu-devel@nongnu.org; Fri, 15 May 2020 05:19:55 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:49565 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jZWVV-0005ar-VT for qemu-devel@nongnu.org; Fri, 15 May 2020 05:19:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589534393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oppWO9uqXABY1yc2ERvzqgw+FDGJGsndHoPWBL1+Ex8=; b=MKhme/IYJzqhm6CbMEBibXuygnQB0oVVgp/i9Zeo4hXTnCAg4Si5+JvrBruetuO6ejy6AH SuIQ8YHfnvqQ5I2vIchV9kJ2oEM/9ucUf2CCmP4HB4Q+spjEAnQsw9sQ7/JoFXUtl36KG8 YE0Dr1IzSPFEI7+Ku2GZ9YbRZ/AyK9w= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-419-IlwiMWMMM1-Pup1enXH0Qw-1; Fri, 15 May 2020 05:19:51 -0400 X-MC-Unique: IlwiMWMMM1-Pup1enXH0Qw-1 Received: by mail-wr1-f71.google.com with SMTP id y7so872753wrd.12 for ; Fri, 15 May 2020 02:19:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oppWO9uqXABY1yc2ERvzqgw+FDGJGsndHoPWBL1+Ex8=; b=W6khaIwoAnNKjMU+xeWBaBtUx7NOwRafX9pZ2Owb9sdjeC8EN2d3FJGpPreouJV+vq Zfpvcj1jBVcrZ67V6rMgn/ZjNivGAhJX9mn//zIvWG8zmXNdu/dgsne42gotHMbzb1J7 H5DMeKVqU3YsnYHrC1fL7jsIpTvhe5ETu/7ZzAhjgtVUHuWPzyQFFKH5cmK7UIUUTt2k J759Ss7l2d2RUSwRtihXuLFamH7SeuhYsuhRGrBsrREYOGkd0bHpIHm31c45UIO6CRH7 +hn1vBx/ihfmXGPM4j38sSJH/PYUpiBCEHe7VESsh6gMwAS0/bQgPzAaGrQ+fA2vPygz 3pug== X-Gm-Message-State: AOAM532cDgQCuMWwqmhH60IRKqJYTKwzW880Q0gr50H1pUI6wkxkJPPF IKR3WDWOnaF87QYxouNY5CYadnVZyRlXo58YQVZ4MwxUUOZl2ltgUdOMloSykKiivy1xDrsnxvr KrVpTDxlmif0GLuA= X-Received: by 2002:a1c:9e51:: with SMTP id h78mr3154202wme.177.1589534390435; Fri, 15 May 2020 02:19:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLco0pWeL3yIn0rtov5zBpzlfd/V0HoMnf9mibAcSjvFtUAMgTeaXr/WMl87/cxoCkqVs56Q== X-Received: by 2002:a1c:9e51:: with SMTP id h78mr3154179wme.177.1589534390221; Fri, 15 May 2020 02:19:50 -0700 (PDT) Received: from x1w.redhat.com (17.red-88-21-202.staticip.rima-tde.net. [88.21.202.17]) by smtp.gmail.com with ESMTPSA id n7sm2643021wro.94.2020.05.15.02.19.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:19:49 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 4/5] sysemu/block-backend: Document blk_read()/blk_pwrite() Date: Fri, 15 May 2020 11:19:23 +0200 Message-Id: <20200515091924.14380-5-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200515091924.14380-1-philmd@redhat.com> References: <20200515091924.14380-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/14 22:56:02 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The blk_read()/blk_pwrite() return value is not obvious, document it. Signed-off-by: Philippe Mathieu-Daudé --- v2: 's/ - /: /' (stefanha) --- include/sysemu/block-backend.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index 7996cb61bb..b693dfb8f0 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -155,7 +155,31 @@ BlockAIOCB *blk_aio_pwrite_zeroes(BlockBackend *blk, int64_t offset, int bytes, BdrvRequestFlags flags, BlockCompletionFunc *cb, void *opaque); int blk_make_zero(BlockBackend *blk, BdrvRequestFlags flags); + +/** + * blk_pread: + * + * @blk: the block backend where the buffer content is going to be read from + * @offset: position in bytes to read at + * @buf: the data buffer + * @bytes: number of bytes to read + * + * Returns: the number of bytes read on success, or a negative errno otherwise. + */ int blk_pread(BlockBackend *blk, int64_t offset, void *buf, int bytes); + +/** + * blk_pwrite: + * + * @blk: the block backend where the buffer content is going to be written to + * @offset: position in bytes to write at + * @buf: the data buffer + * @bytes: number of bytes of @buf to write + * @flags: request flags + * + * Returns: the number of bytes consumed on success, + * or a negative errno otherwise. + */ int blk_pwrite(BlockBackend *blk, int64_t offset, const void *buf, int bytes, BdrvRequestFlags flags); int64_t blk_getlength(BlockBackend *blk); From patchwork Fri May 15 09:19:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 282673 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C20C9C433DF for ; Fri, 15 May 2020 09:24:58 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8C5E82073E for ; Fri, 15 May 2020 09:24:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gqQnlZiC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8C5E82073E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:55500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZWaP-0005zR-Qw for qemu-devel@archiver.kernel.org; Fri, 15 May 2020 05:24:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZWVd-0005wJ-HY for qemu-devel@nongnu.org; Fri, 15 May 2020 05:20:02 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:51488 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jZWVb-0005bd-Ec for qemu-devel@nongnu.org; Fri, 15 May 2020 05:20:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589534398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vb8q8zQaBSYsdnfCJN6XZiKEXfcSXXKGGn1WabOTPgg=; b=gqQnlZiCWmOOKH2ep5linOLWFPGhLwNVGHZWJnpbFVWkBSeCSAXccGFbl+O3+mR3zGKedu qPQW05Xi/ZMA0DF+xrx5KRVYsvDaX1yrCNm/YS6xJPo2M3n8q7TeaXQrcLKD2eUIObyvxQ 0n1j9qW4tqdluLEOphy7FZ28oQfua1g= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-344-lUs7a7QGN4O0cSuFdicydQ-1; Fri, 15 May 2020 05:19:56 -0400 X-MC-Unique: lUs7a7QGN4O0cSuFdicydQ-1 Received: by mail-wr1-f72.google.com with SMTP id 37so886842wrc.4 for ; Fri, 15 May 2020 02:19:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vb8q8zQaBSYsdnfCJN6XZiKEXfcSXXKGGn1WabOTPgg=; b=LF+uJncCbsChCZrDZC58qjd4flsazTA5OEX45tyQMY23D8Snoy70erUU9pygFhXpb0 Y5oWtoY6zJeOVsYI/CgWgu6LYu1+XfURoJv9FOufqKUOPblrXg4fXsYX+vLJQd6Ddf04 jZIEvThSOxYUodrowaydRUEPDLP3Nm2OP3yINPtg0qcXQzb0j+xL6jcAt2jFFUh8FIFf y+orCb0MZn/Cw5YmDONh6QiTrxj8OjEJHWpE7PhJX2CkFsKyMVH1blMce70ba8WScac5 n4ajyzwMHy5OaSAR8R3ujy/0hYDPGzWFewZ/y4eMsaVgl6jtPpONLrnIA2sTjQPrvy06 tzDg== X-Gm-Message-State: AOAM532n/qu7OZ97ToWCNJ+J+qrGno+0XVNGlIGeaW1/cEm9Yj5gGezi JdrXAgN26vOiRnOHpXQ9xqscNlZsmeiMHcb1pffLKgnzYPE6uNVdPlVDN45eZ8TFNwrZz8U32Ir QJl5u3F0UvJ/EMG8= X-Received: by 2002:adf:e449:: with SMTP id t9mr3213542wrm.108.1589534395521; Fri, 15 May 2020 02:19:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/KRuEOOdAykHM+bwA5nWSjKrb13F5jW566HzDaVXU9gp+2KPshci5KrauElkZXtDX3ST4Fw== X-Received: by 2002:adf:e449:: with SMTP id t9mr3213525wrm.108.1589534395300; Fri, 15 May 2020 02:19:55 -0700 (PDT) Received: from x1w.redhat.com (17.red-88-21-202.staticip.rima-tde.net. [88.21.202.17]) by smtp.gmail.com with ESMTPSA id u10sm2648032wmc.31.2020.05.15.02.19.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:19:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 5/5] sysemu/block-backend: Document blk_get_max_iov() returned value Date: Fri, 15 May 2020 11:19:24 +0200 Message-Id: <20200515091924.14380-6-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200515091924.14380-1-philmd@redhat.com> References: <20200515091924.14380-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=205.139.110.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/14 23:27:07 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/block-backend.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index b693dfb8f0..7b12563c65 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -227,6 +227,7 @@ void blk_eject(BlockBackend *blk, bool eject_flag); int blk_get_flags(BlockBackend *blk); uint32_t blk_get_request_alignment(BlockBackend *blk); uint32_t blk_get_max_transfer(BlockBackend *blk); +/* Returns the maximum number of iovec elements */ int blk_get_max_iov(BlockBackend *blk); void blk_set_guest_block_size(BlockBackend *blk, int align); /* callers must free the returned pointer with qemu_vfree() */