From nobody Tue Nov 4 15:26:27 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1530216524453757.4383980734164; Thu, 28 Jun 2018 13:08:44 -0700 (PDT) Received: from localhost ([::1]:38292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYdDf-0001Gb-Kd for importer@patchew.org; Thu, 28 Jun 2018 16:08:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYdAO-00073O-5D for qemu-devel@nongnu.org; Thu, 28 Jun 2018 16:05:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYdAN-0008UK-4S for qemu-devel@nongnu.org; Thu, 28 Jun 2018 16:05:20 -0400 Received: from mail-wr0-x231.google.com ([2a00:1450:400c:c0c::231]:46757) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYdAM-0008R8-MZ for qemu-devel@nongnu.org; Thu, 28 Jun 2018 16:05:19 -0400 Received: by mail-wr0-x231.google.com with SMTP id t6-v6so6664887wrq.13 for ; Thu, 28 Jun 2018 13:05:18 -0700 (PDT) Received: from 640k.lan ([82.84.124.111]) by smtp.gmail.com with ESMTPSA id 127-v6sm6211110wmd.18.2018.06.28.13.05.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 13:05:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4zBDUnudCImQV0crNK+0EvzSB+zVFH0eZEvdtpweepI=; b=tLmeJR5TfKvZGaqy3sASSul3Zv9ZGPql/FTfGMetM4sry1JtldqVFXvA8k96G5/ElG Nu/NGwuviHS6xGuoP+gU7EfmkhqymAvzpPASxqHzuV/UZnS9Kh6bIrocEN0Z3Wi8WxkH 5/VSuhxgNqIWfnD2YYIdEiCzle8uVAlRSFe5diFk6tgOtLlng9mDkO2cUxWbaTEvOsic JHVYSgGkLg+v+GQkPBuUqY6aRtK9IflmwbA5cB4YcM+G7/xic+QHRnJHimLYs47VnT+y UONMDcABn72hLId69nCUREEJI4OmQy5ypNF43+yf6WcONPTCpJfOaB1Agv8Yfj+04TdT LTaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=4zBDUnudCImQV0crNK+0EvzSB+zVFH0eZEvdtpweepI=; b=fFl5NmKcaHNK+7QsZ0+uNvE8ZP8eTZGyy/138zN/eBa64ZSEH4gw1bbHPXvXC0zo3o 1hbD1cA9Lifs2bgTCgd9BuBqshUTmrRq8fZpEumoBnFNyx8UDWduBP2LAf4B3DsOZBlm Bk9ML9wG7jTQ3mK2wbEHZEn3REgmT4yhnrkB8pfwqzaj1S5ua79MIoXJdUeki3ZkgdHx c/m5u9c/iLL3zMwfvzAKjcRg2dlMnzvDeMthwND/REqukXeNrddVi/KW5mEzqeN1sJ0D b7P08fCmJNC4QsM+J65I/ujRgjPDut1nrbkVmK9sZpgaHTPXLVOM1OhQ4MucN5Hf0Qx/ 1MSg== X-Gm-Message-State: APt69E0WgkhORp40fOVA7rt7R2W64swr5j6Ji9mqwziWKPhq4szxBE3G ATJOa0hcB+wgBj7nrkCLUO6k+9Rr X-Google-Smtp-Source: AAOMgpdpo7beaya0Lt7nLzf1WyifPjQclvWq2iylT6H525QXLrbyvrjW6goctDWFABKW++ENk8QGPA== X-Received: by 2002:adf:c301:: with SMTP id n1-v6mr10278300wrf.270.1530216317360; Thu, 28 Jun 2018 13:05:17 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 28 Jun 2018 22:04:14 +0200 Message-Id: <1530216310-52873-5-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1530216310-52873-1-git-send-email-pbonzini@redhat.com> References: <1530216310-52873-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::231 Subject: [Qemu-devel] [PULL 04/60] main-loop: document IOCanReadHandler X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Stefan Hajnoczi Signed-off-by: Stefan Hajnoczi Message-Id: <20180602085259.17853-1-stefanha@redhat.com> Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/qemu/main-loop.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/qemu/main-loop.h b/include/qemu/main-loop.h index 6b4b60b..721aa24 100644 --- a/include/qemu/main-loop.h +++ b/include/qemu/main-loop.h @@ -168,6 +168,20 @@ void qemu_del_wait_object(HANDLE handle, WaitObjectFun= c *func, void *opaque); /* async I/O support */ =20 typedef void IOReadHandler(void *opaque, const uint8_t *buf, int size); + +/** + * IOCanReadHandler: Return the number of bytes that #IOReadHandler can ac= cept + * + * This function reports how many bytes #IOReadHandler is prepared to acce= pt. + * #IOReadHandler may be invoked with up to this number of bytes. If this + * function returns 0 then #IOReadHandler is not invoked. + * + * This function is typically called from an event loop. If the number of + * bytes changes outside the event loop (e.g. because a vcpu thread draine= d the + * buffer), then it is necessary to kick the event loop so that this funct= ion + * is called again. aio_notify() or qemu_notify_event() can be used to ki= ck + * the event loop. + */ typedef int IOCanReadHandler(void *opaque); =20 /** --=20 1.8.3.1