From patchwork Mon May 11 11:14:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Straub X-Patchwork-Id: 11540245 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F4BE15AB for ; Mon, 11 May 2020 11:17:34 +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 969C52082E for ; Mon, 11 May 2020 11:17:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=web.de header.i=@web.de header.b="pInkQOOT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 969C52082E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=web.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:59138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jY6RA-0002du-2g for patchwork-qemu-devel@patchwork.kernel.org; Mon, 11 May 2020 07:17:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jY6OS-0000LJ-D7; Mon, 11 May 2020 07:14:44 -0400 Received: from mout.web.de ([212.227.15.4]:55247) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jY6OR-0006pA-Hm; Mon, 11 May 2020 07:14:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1589195675; bh=humdI/22fGDkxx2xF+0v4LcfHfCCcq0p3L3ORQdAD7g=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject; b=pInkQOOTMVzmBpxt0ZNcMjV6lPnjiQZZ3QrnzEJHsiBbw/jj7qdBKjMyagLVC6NAL fnT4frnhhgv+FNFCqDzgLqT86nePBiaz1mIIPpWgJk4TBgDOyGYO1vVeuJBqd+LKGQ 6+zw+XWVJN1oy6ZBp58KeKszQenFf+4fR5PSH4Qs= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from luklap ([89.247.255.192]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Mg1Nl-1jmBIM1olp-00NTI9; Mon, 11 May 2020 13:14:35 +0200 Date: Mon, 11 May 2020 13:14:34 +0200 From: Lukas Straub To: qemu-devel Subject: [PATCH 0/5] Introduce 'yank' oob qmp command to recover from hanging qemu Message-ID: MIME-Version: 1.0 X-Provags-ID: V03:K1:6elkNXNr4kWfEFTrZ3gagqstdgKNhVOyO0SqbBkIjdy4hgrq4p+ mdUaHHD8Bt+nHFAoZNPKFoRsWGklP2I7hnZ/lWGGnD5y7R6z+LKXG85pJPdB0gAV+7B2vBU x+Q3Sb9ndhvZYSqI4ArrcDbKPYa7NJkiUy50Lhhb9SGxKbKEvCNxQW1NaNOhzyLxaAyJc64 eNpHrbgS6zoavmkQZ/xUw== X-UI-Out-Filterresults: notjunk:1;V03:K0:aF49x4xSdsw=:jye6um4kS5q8sE6+LkjlzF jw5+fCTMCTePzp686y3DsAeL6Ac7bHN0K7h673T9djzGoslatbPmYylJJc8x0aVPQUi0ZE7S5 5JYO+RYS9WWNNcAtrbf/MD5Qx53xERlgEcCRMHy0hldkehpwlOvJx+nYbKNusPHkJLCqwc5NJ 0rmyQ3wmxEbPr3/ezEiGljQvxog2izilSc9PkSxm89fYSHcYuUU3pUu8DgzuLm7EtnstSvjJ6 x9MepwdhzTct1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@web.de; helo=mout.web.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/11 07:14:42 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=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 , "Daniel P. =?utf-8?b?QmVycmFuZ8Op?= " , qemu-block , Juan Quintela , "Dr. David Alan Gilbert" , Max Reitz , Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9?= Lureau Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Hello Everyone, In many cases, if qemu has a network connection (qmp, migration, chardev, etc.) to some other server and that server dies or hangs, qemu hangs too. These patches introduce the new 'yank' out-of-band qmp command to recover from these kinds of hangs. The different subsystems register callbacks which get executed with the yank command. For example the callback can shutdown() a socket. This is intended for the colo use-case, but it can be used for other things too of course. Regards, Lukas Straub Lukas Straub (5): Introduce yank feature io/channel.c,io/channel-socket.c: Add yank feature block/nbd.c: Add yank feature chardev/char-socket.c: Add yank feature migration: Add yank feature Makefile.objs | 2 + block/nbd.c | 68 ++++++++++++++++++++++++--------- chardev/char-socket.c | 8 ++++ chardev/char.c | 3 ++ include/io/channel-socket.h | 1 + include/io/channel.h | 12 ++++++ io/channel-socket.c | 29 ++++++++++++++ io/channel.c | 9 +++++ migration/channel.c | 2 + migration/migration.c | 11 ++++++ qapi/block-core.json | 5 ++- qapi/char.json | 5 ++- qapi/migration.json | 17 +++++++-- qapi/misc.json | 15 ++++++++ softmmu/vl.c | 2 + yank.c | 75 +++++++++++++++++++++++++++++++++++++ yank.h | 12 ++++++ 17 files changed, 254 insertions(+), 22 deletions(-) create mode 100644 yank.c create mode 100644 yank.h