From patchwork Mon Dec 28 14:58:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukas Straub X-Patchwork-Id: 1420892 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=web.de Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=web.de header.i=@web.de header.a=rsa-sha256 header.s=dbaedf251592 header.b=SU+sOdTQ; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4D4LQv4NJFz9sWR for ; Tue, 29 Dec 2020 02:03:35 +1100 (AEDT) Received: from localhost ([::1]:34518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ktu3Z-0006eO-2D for incoming@patchwork.ozlabs.org; Mon, 28 Dec 2020 10:03:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kttzC-00034W-BM; Mon, 28 Dec 2020 09:59:03 -0500 Received: from mout.web.de ([212.227.15.14]:37419) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kttzA-0006b5-N3; Mon, 28 Dec 2020 09:59:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1609167535; bh=QI3mrNzj10vI74Bk2dsysQrsN0HaknZHWM9x8Uj2gFQ=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=SU+sOdTQ+YOmRiMuVdSjXnLpc186keWvf3HsjDTxMB6HF6XWaREUI4Ple45u6apja c/tBOlDv0zoXU9SwQyjnWcqDA2GusGuwUw0ZfSbp4Cm54D00HfBgW4mG2Qi0Gl3Eb/ NgCrBNwxW4TN73GoQ8cTc1FudlwR0wcRfBohnll8= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from gecko.fritz.box ([94.134.180.94]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MJFhX-1kaJjI0e2l-00KXg3; Mon, 28 Dec 2020 15:58:55 +0100 Date: Mon, 28 Dec 2020 15:58:53 +0100 From: Lukas Straub To: qemu-devel Subject: [PATCH v13 6/7] io: Document qmp oob suitability of qio_channel_shutdown and io_shutdown Message-ID: <4bb8a3f8653353f03cbc796b96871ca3c1925a8d.1609166587.git.lukasstraub2@web.de> In-Reply-To: References: MIME-Version: 1.0 X-Provags-ID: V03:K1:BkGuW1TGI1SKPefLGGhR51hSelAGPd72ry/Iq/SD+JnPoyRKeAo WR6S6/ZMl8inQ859TiD1lRU1et/7/KSUPCrpNQZH7Hatk35aVEhSRBtEC7E00yY2PbeZqvg jk8PoievXn0qcQu7+lNbv/r08mrJac+Ug7+5ror0zb6bXL66HpLK9EtcNe2Kt0oTlxJy1Hj 8WSntlyjukZ8GD64jqQUg== X-UI-Out-Filterresults: notjunk:1;V03:K0:7FUe3J/NMhI=:aPpOCjoU5QNM3H7vlJz5fh JAFkEU5KRn2wzmI3wn+zsgX0ZETvHmpIEHm3MOaTz3Z0d4Hc4hq2yDtprMR3rtvZui00Gbg3w iAwr78yMhLq51hTIVxhghF2WePGQxwCwH9PBT7xTFaVWpg5+mOsu+NsIQdPCeV2Gv8g0dT9XL u6MWA+KwzmNjK4jYHB8zmoc/iAg7XIJX8ztrgGPSRs5t+ig/z8JznmbK1vIB56MnmFXkrqcDe K9VvEoJsRM5LXh8kF+8qEqpYLk8UkQHFnJbDI0zpbCSnj9OB4j2+bClC6x2WzFlSXQB/jdnGo uIiKw+e4SWo1DH1FOcW/V7Jogcj0bxrzOPYHtLv38lMEmYS7tfM+lOVkwLm6Acjmb3sfxhqyU qjcoulbVUWtrze/Z4is6tq0g7GxvLatzCZC35eewuaNlMNgWdsRqQCwnw6oYjIZoayIXr3T20 eL7ViYIJcX7TCJlZVrdsF3RKCBSLYTeoA2vy7j3bf2yJgGx+NZ53H2I/FlIgsPEdMiW/JYUiq 4erKdpmNtTcfdk1baQMuApsQg8YKX0Rbpu9CaHjAv6NKq9/Nm80sJ7KKpAjzzbLhLPNd2A0tp eBD0cFIf1+ckV5H42g2tHlcihU1OgNgIXAec609aGG95bYBu7HJOxpXfUNeC9JFETmuP6+BTh k6e6AL6NrQIebQok6N+/F5+MrDHEggt6Kcz1RLBjB2vmLCoEEKQwldpjtdl4Zr5L+w1ODjH+v NTAZwpQquypHIPYnCZ45Mwv/SieK+JPRfgR7Ah4ZaIgYK47jK2TdB2PX+3xS0ETDCbrCfZxdU QsMJuJsBANmgzjrJW7aJznh5TMRWi5JOqg+9/uK/lDnAYgBDqYdkOyHA31FUYYfWBLgPnRheH PLqfgdN2jIrY5lnn3tS4XMGMezmWbt8KTF3zR6K0k= Received-SPF: pass client-ip=212.227.15.14; envelope-from=lukasstraub2@web.de; helo=mout.web.de X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no 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 , "Daniel P. =?utf-8?q?Berrang=C3=A9=5C?= " , qemu-block , Juan Quintela , Markus Armbruster , "Dr. David Alan Gilbert" , Max Reitz , =?utf-8?q?Marc-Andr=C3=A9?= Lureau , Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9?= Lureau Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Migration and yank code assume that qio_channel_shutdown is thread -safe and can be called from qmp oob handler. Document this after checking the code. Signed-off-by: Lukas Straub Acked-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrangé --- include/io/channel.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.29.2 diff --git a/include/io/channel.h b/include/io/channel.h index 4d6fe45f63..ab9ea77959 100644 --- a/include/io/channel.h +++ b/include/io/channel.h @@ -92,7 +92,8 @@ struct QIOChannel { * provide additional optional features. * * Consult the corresponding public API docs for a description - * of the semantics of each callback + * of the semantics of each callback. io_shutdown in particular + * must be thread-safe, terminate quickly and must not block. */ struct QIOChannelClass { ObjectClass parent; @@ -510,6 +511,8 @@ int qio_channel_close(QIOChannel *ioc, * QIO_CHANNEL_FEATURE_SHUTDOWN prior to calling * this method. * + * This function is thread-safe, terminates quickly and does not block. + * * Returns: 0 on success, -1 on error */ int qio_channel_shutdown(QIOChannel *ioc,