From patchwork Wed May 20 21:05:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Straub X-Patchwork-Id: 11561577 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 383AE739 for ; Wed, 20 May 2020 21:08:12 +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 0FE4D207E8 for ; Wed, 20 May 2020 21:08:12 +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="QsEb+/MF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0FE4D207E8 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]:40198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbVwh-0004MD-1l for patchwork-qemu-devel@patchwork.kernel.org; Wed, 20 May 2020 17:08:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46152) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbVuK-0002Dl-G3; Wed, 20 May 2020 17:05:44 -0400 Received: from mout.web.de ([212.227.15.3]:50145) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbVuJ-0002Rb-JI; Wed, 20 May 2020 17:05:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1590008737; bh=L7G8XxjG0NoxcFNUSt93wnRY5ibTk3fXbfaaNKPJnxY=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject; b=QsEb+/MFft/hTnhd5G6zHDCYje4LViM0a8BBZpGKNO0NS7kqlMq34wt4skft0bySJ Yp+F1gzwyUiBwVSuAqcOFMjFWyZRMjHKO5ZxQ6BVvB0JKvqVVuNMEjNKff9IGgnT7f F/SvQStnfmrgSkxEi7av7rL9tiS3f3pO5gqGAhN0= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from luklap ([88.130.61.105]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M8A09-1iokqG0akT-00vdOw; Wed, 20 May 2020 23:05:37 +0200 Date: Wed, 20 May 2020 23:05:27 +0200 From: Lukas Straub To: qemu-devel Subject: [PATCH v2 0/4] Introduce 'yank' oob qmp command to recover from hanging qemu Message-ID: MIME-Version: 1.0 X-Provags-ID: V03:K1:bYgdb7ZpTnsgkBtJz+VfMjSUetbTv35S4/8i1F/8LZyROcbMErv 6MXdQFZB3MpaTKmO8AB0DdKqaJ1ZuVpDpl1qNJGkMbh6xFZwkGr+PD8liMhkVEcAWnMUVed cHbCPzlZLST6hbLrzPUhhiuCzPZqRTd5TEOWVkRb6cXZ4S2+j94XujLR49kdV7bx/bC7Al8 zpE9AafAFb5f2B1ZgxSHQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:Xqcc79j3tXg=:59Oc/m3fiUetJGuBH8OovJ 6cPVhatDnyS4+0cID/bToppV6qZqyuxgM5sS46GrlUO23RaANrMUAP7J7kVBTwTFDsGGjvQ08 YUYlA2BKRFhqpVjGyIAWH5NSmpRdz47Ag7lq0yyoH6svwc0EkZKLKqIAvrtUK/yXDNTtOltOf rR0Yaw/4RD95vrO0ZbFNsso1YERv5FZV5wjZJAFPpFlfuptv8DaWrhYh15eLmXU1ljZtqJ1of 6f/Vb8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straub2@web.de; helo=mout.web.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/20 16:42:20 X-ACL-Warn: Detected OS = Linux 3.11 and newer 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 v2: -don't touch io/ code anymore -always register yank functions -'yank' now takes a list of instances to yank -'query-yank' returns a list of yankable instances Lukas Straub (4): Introduce yank feature block/nbd.c: Add yank feature chardev/char-socket.c: Add yank feature migration: Add yank feature Makefile.objs | 1 + block/nbd.c | 101 ++++++++++++-------- chardev/char-socket.c | 24 +++++ migration/migration.c | 9 ++ migration/qemu-file-channel.c | 6 ++ migration/socket.c | 11 +++ qapi/misc.json | 45 +++++++++ softmmu/vl.c | 2 + yank.c | 174 ++++++++++++++++++++++++++++++++++ yank.h | 69 ++++++++++++++ 10 files changed, 405 insertions(+), 37 deletions(-) create mode 100644 yank.c create mode 100644 yank.h --- 2.20.1