From patchwork Tue Jun 23 14:42:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukas Straub X-Patchwork-Id: 11620877 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 D807D14E3 for ; Tue, 23 Jun 2020 14:46:38 +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 9984420720 for ; Tue, 23 Jun 2020 14:46:38 +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="bXzkphMr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9984420720 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]:59778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnkC4-0007TI-8v for patchwork-qemu-devel@patchwork.kernel.org; Tue, 23 Jun 2020 10:46:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58348) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnk8R-0003qd-Cu; Tue, 23 Jun 2020 10:42:51 -0400 Received: from mout.web.de ([212.227.15.3]:37811) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnk8P-0002QF-5k; Tue, 23 Jun 2020 10:42:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1592923363; bh=WQjew8LLrt3aWMP88f9M+wX6YZ9r9PowMOGkCX0pAyU=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=bXzkphMr3sOhsFlI0T1MxqGd2GMlQc+s/fDx2qT2MDn7it6yAWv3Mo1R905z0F0Oh RJ5eCmhsDzQYzEFuG1R2vxteXmZtBHqaosYex1xg7yn+GR6yoFwBGytUoaeSBprXQS HfRAEYyYIr1qCI9BUsyihgpEvoL0zAwoRVjq3YXw= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from luklap ([88.130.61.8]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MSry9-1jOoqt3mBJ-00RsRu; Tue, 23 Jun 2020 16:42:42 +0200 Date: Tue, 23 Jun 2020 16:42:41 +0200 From: Lukas Straub To: qemu-devel Subject: [PATCH v5 1/7] Introduce yank feature Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Provags-ID: V03:K1:Vl4nklLUS5lBfyNzs5mFRO9b1G9jdX6WmxcaAlcE4KCLRBrX4mS gabCHwIdj9jRQekwqo4C0359rxzj5WpQ2xq1RSVFi8e/JmcjeBp+w7JOgJAL4jaDlQNN0U/ UYfImkDEIiWCqMAVgPAx0RnuDa9VC8H7tdhiTj3hoyt3FKsd6SEBuWUlO+Tns/Clvsi2V7e rJVTerGgXUa2Eh1ANbNXw== X-UI-Out-Filterresults: notjunk:1;V03:K0:i2CJ/5jf+Z4=:sJ9SsnjGso6svbpBfx4Tfn W/H4N2ogGxRl+MWpGGcx1ubP9PtDJnx3Z7y7mi6MFIcjFkkkAMLUVJSanK9iaPZ+ZgnlA0uo7 uwVyInhXnW+Q8Bae/sDitzkU5LQwOiujU2xvrR4k2uJUFquwd02xPNOLlnbq25jQZLkP/O7jJ ZDsbQttzF2g56hAlUjblYL7LqB0kzx7jszNDtWHtbGI2UerNa/e3+Z1uvVnr9i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.227.15.3; envelope-from=lukasstraub2@web.de; helo=mout.web.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/23 10:42:47 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 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.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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" The yank feature allows to recover from hanging qemu by "yanking" at various parts. Other qemu systems can register themselves and multiple yank functions. Then all yank functions for selected instances can be called by the 'yank' out-of-band qmp command. Available instances can be queried by a 'query-yank' oob command. Signed-off-by: Lukas Straub Reviewed-by: Daniel P. Berrangé --- include/qemu/yank.h | 79 +++++++++++++++++++ qapi/misc.json | 45 +++++++++++ util/Makefile.objs | 1 + util/yank.c | 179 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 304 insertions(+) create mode 100644 include/qemu/yank.h create mode 100644 util/yank.c -- 2.20.1 diff --git a/include/qemu/yank.h b/include/qemu/yank.h new file mode 100644 index 0000000000..294094ba74 --- /dev/null +++ b/include/qemu/yank.h @@ -0,0 +1,79 @@ +/* + * QEMU yank feature + * + * Copyright (c) Lukas Straub + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef YANK_H +#define YANK_H + +typedef void (YankFn) (void *opaque); + +/** + * yank_register_instance: Register a new instance. + * + * This registers a new instance for yanking. Must be called before any yank + * function is registered for this instance. + * + * This function is thread-safe. + * + * @instance_name: The globally unique name of the instance. + */ +void yank_register_instance(const char *instance_name); + +/** + * yank_unregister_instance: Unregister a instance. + * + * This unregisters a instance. Must be called only after every yank function + * of the instance has been unregistered. + * + * This function is thread-safe. + * + * @instance_name: The name of the instance. + */ +void yank_unregister_instance(const char *instance_name); + +/** + * yank_register_function: Register a yank function + * + * This registers a yank function. All limitations of qmp oob commands apply + * to the yank function as well. + * + * This function is thread-safe. + * + * @instance_name: The name of the instance + * @func: The yank function + * @opaque: Will be passed to the yank function + */ +void yank_register_function(const char *instance_name, + YankFn *func, + void *opaque); + +/** + * yank_unregister_function: Unregister a yank function + * + * This unregisters a yank function. + * + * This function is thread-safe. + * + * @instance_name: The name of the instance + * @func: func that was passed to yank_register_function + * @opaque: opaque that was passed to yank_register_function + */ +void yank_unregister_function(const char *instance_name, + YankFn *func, + void *opaque); + +/** + * yank_unregister_function: Generic yank function for iochannel + * + * This is a generic yank function which will call qio_channel_shutdown on the + * provided QIOChannel. + * + * @opaque: QIOChannel to shutdown + */ +void yank_generic_iochannel(void *opaque); +#endif diff --git a/qapi/misc.json b/qapi/misc.json index a5a0beb902..794d0afd5d 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -1552,3 +1552,48 @@ ## { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' } +## +# @YankInstances: +# +# @instances: List of yank instances. +# +# Yank instances are named after the following schema: +# "blockdev:", "chardev:" and "migration" +# +# Since: 5.1 +## +{ 'struct': 'YankInstances', 'data': {'instances': ['str'] } } + +## +# @yank: +# +# Recover from hanging qemu by yanking the specified instances. +# +# Takes @YankInstances as argument. +# +# Returns: nothing. +# +# Example: +# +# -> { "execute": "yank", "arguments": { "instances": ["blockdev:nbd0"] } } +# <- { "return": {} } +# +# Since: 5.1 +## +{ 'command': 'yank', 'data': 'YankInstances', 'allow-oob': true } + +## +# @query-yank: +# +# Query yank instances. +# +# Returns: @YankInstances +# +# Example: +# +# -> { "execute": "query-yank" } +# <- { "return": { "instances": ["blockdev:nbd0"] } } +# +# Since: 5.1 +## +{ 'command': 'query-yank', 'returns': 'YankInstances', 'allow-oob': true } diff --git a/util/Makefile.objs b/util/Makefile.objs index cc5e37177a..13faa98425 100644 --- a/util/Makefile.objs +++ b/util/Makefile.objs @@ -45,6 +45,7 @@ util-obj-$(CONFIG_GIO) += dbus.o dbus.o-cflags = $(GIO_CFLAGS) dbus.o-libs = $(GIO_LIBS) util-obj-$(CONFIG_USER_ONLY) += selfmap.o +util-obj-y += yank.o ####################################################################### # code used by both qemu system emulation and qemu-img diff --git a/util/yank.c b/util/yank.c new file mode 100644 index 0000000000..4e66d5a2c2 --- /dev/null +++ b/util/yank.c @@ -0,0 +1,179 @@ +/* + * QEMU yank feature + * + * Copyright (c) Lukas Straub + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "qemu/thread.h" +#include "qemu/queue.h" +#include "qapi/qapi-commands-misc.h" +#include "io/channel.h" +#include "qemu/yank.h" + +struct YankFuncAndParam { + YankFn *func; + void *opaque; + QLIST_ENTRY(YankFuncAndParam) next; +}; + +struct YankInstance { + char *name; + QLIST_HEAD(, YankFuncAndParam) yankfns; + QLIST_ENTRY(YankInstance) next; +}; + +static QemuMutex lock; +static QLIST_HEAD(yankinst_list, YankInstance) head + = QLIST_HEAD_INITIALIZER(head); + +static struct YankInstance *yank_find_instance(const char *name) +{ + struct YankInstance *tmp, *instance; + instance = NULL; + QLIST_FOREACH(tmp, &head, next) { + if (!strcmp(tmp->name, name)) { + instance = tmp; + } + } + return instance; +} + +void yank_register_instance(const char *instance_name) +{ + struct YankInstance *instance; + + qemu_mutex_lock(&lock); + assert(!yank_find_instance(instance_name)); + + instance = g_slice_new(struct YankInstance); + instance->name = g_strdup(instance_name); + QLIST_INIT(&instance->yankfns); + QLIST_INSERT_HEAD(&head, instance, next); + + qemu_mutex_unlock(&lock); +} + +void yank_unregister_instance(const char *instance_name) +{ + struct YankInstance *instance; + + qemu_mutex_lock(&lock); + instance = yank_find_instance(instance_name); + assert(instance); + + assert(QLIST_EMPTY(&instance->yankfns)); + QLIST_REMOVE(instance, next); + g_free(instance->name); + g_slice_free(struct YankInstance, instance); + + qemu_mutex_unlock(&lock); +} + +void yank_register_function(const char *instance_name, + YankFn *func, + void *opaque) +{ + struct YankInstance *instance; + struct YankFuncAndParam *entry; + + qemu_mutex_lock(&lock); + instance = yank_find_instance(instance_name); + assert(instance); + + entry = g_slice_new(struct YankFuncAndParam); + entry->func = func; + entry->opaque = opaque; + + QLIST_INSERT_HEAD(&instance->yankfns, entry, next); + qemu_mutex_unlock(&lock); +} + +void yank_unregister_function(const char *instance_name, + YankFn *func, + void *opaque) +{ + struct YankInstance *instance; + struct YankFuncAndParam *entry; + + qemu_mutex_lock(&lock); + instance = yank_find_instance(instance_name); + assert(instance); + + QLIST_FOREACH(entry, &instance->yankfns, next) { + if (entry->func == func && entry->opaque == opaque) { + QLIST_REMOVE(entry, next); + g_slice_free(struct YankFuncAndParam, entry); + qemu_mutex_unlock(&lock); + return; + } + } + + abort(); +} + +void yank_generic_iochannel(void *opaque) +{ + QIOChannel *ioc = QIO_CHANNEL(opaque); + + qio_channel_shutdown(ioc, QIO_CHANNEL_SHUTDOWN_BOTH, NULL); +} + +void qmp_yank(strList *instances, + Error **errp) +{ + strList *tmp; + struct YankInstance *instance; + struct YankFuncAndParam *entry; + + qemu_mutex_lock(&lock); + tmp = instances; + for (; tmp; tmp = tmp->next) { + instance = yank_find_instance(tmp->value); + if (!instance) { + error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND, + "Instance '%s' not found", tmp->value); + qemu_mutex_unlock(&lock); + return; + } + } + tmp = instances; + for (; tmp; tmp = tmp->next) { + instance = yank_find_instance(tmp->value); + assert(instance); + QLIST_FOREACH(entry, &instance->yankfns, next) { + entry->func(entry->opaque); + } + } + qemu_mutex_unlock(&lock); +} + +YankInstances *qmp_query_yank(Error **errp) +{ + struct YankInstance *instance; + YankInstances *ret; + + ret = g_new0(YankInstances, 1); + ret->instances = NULL; + + qemu_mutex_lock(&lock); + QLIST_FOREACH(instance, &head, next) { + strList *entry; + entry = g_new0(strList, 1); + entry->value = g_strdup(instance->name); + entry->next = ret->instances; + ret->instances = entry; + } + qemu_mutex_unlock(&lock); + + return ret; +} + +static void __attribute__((__constructor__)) yank_init(void) +{ + qemu_mutex_init(&lock); +} From patchwork Tue Jun 23 14:42:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukas Straub X-Patchwork-Id: 11620875 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 9C2A814E3 for ; Tue, 23 Jun 2020 14:45:52 +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 6200920720 for ; Tue, 23 Jun 2020 14:45:52 +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="Fman6Gtg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6200920720 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]:58718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnkBL-00071C-Dn for patchwork-qemu-devel@patchwork.kernel.org; Tue, 23 Jun 2020 10:45:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnk8U-0003uH-W7; Tue, 23 Jun 2020 10:42:55 -0400 Received: from mout.web.de ([212.227.17.11]:56981) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnk8S-0002Te-Ny; Tue, 23 Jun 2020 10:42:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1592923366; bh=G19cw0JrVxhybvc/d/f5ihO0pHrqVaiFtWVFAQXcyis=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=Fman6Gtgtnht9Y+m3YzgUhM1krKIS83SktneKJNqzpmfYtmKBkabNce9DQ6TOEuiO 7pAIufh5/HaMRYd7nqgmgA/nQzb0k49nJB+pZ59m12pyLvql5VEXMOteuO4lwMsMC/ TPqgY5V6JKu6aQcXepgaGG2LylZFLSkdGEj2A+LY= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from luklap ([88.130.61.8]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MC0PP-1jiYf52OWT-00COur; Tue, 23 Jun 2020 16:42:46 +0200 Date: Tue, 23 Jun 2020 16:42:45 +0200 From: Lukas Straub To: qemu-devel Subject: [PATCH v5 2/7] block/nbd.c: Add yank feature Message-ID: <3971e5cdc40d18e16c499560e2bf3ac8e5e42e26.1592923201.git.lukasstraub2@web.de> In-Reply-To: References: MIME-Version: 1.0 X-Provags-ID: V03:K1:31atETboUbG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khFS4rsdpG8AWcF7B2rloTRJSro1rpc0FXRoNowRWcZsvl1Voko0gBbilaOqlUi iCTB/EeYNRxH1awMZusOVUF2cfqfBLmXjNaG2ng1GLnml7XvScPoqZ6GzsAzLfDN6jM7az5YN hhlKABhE72OgBGNoNFUaB898W3rO0N+G3Vvum31ytGJ7P9RLHT0dtc2vgEAk1F4cGsEy83dH1 bF8rGGvSVXtjkZ385NMoDaKjcdfCzxVgSFRqAbsjCkJt6yfeaj+zn/OQQmjtSrfAQycfC0HEj jkvXRJ+9vnuReFt7pZdGsc0urA1SQHJmxpJVRHXHL1WxziXb8mRm1oSGO28CchP2eoAnvJ6D5 OcW7GtUOrgILLoD8mF9wOUXxcPVVfLtWwhBnGib6uJ8G3MB5Dq9/ZYass2KinnNW8fyZNIjta yWwdOjSFvWYW7UhhA Received-SPF: pass client-ip=212.227.17.11; envelope-from=lukasstraub2@web.de; helo=mout.web.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/23 10:42:51 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 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.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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" Register a yank function which shuts down the socket and sets s->state = NBD_CLIENT_QUIT. This is the same behaviour as if an error occured. Signed-off-by: Lukas Straub Reviewed-by: Daniel P. Berrangé --- block/nbd.c | 101 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 64 insertions(+), 37 deletions(-) -- 2.20.1 diff --git a/block/nbd.c b/block/nbd.c index eed160c5cd..6134a82d2d 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -35,6 +35,7 @@ #include "qemu/option.h" #include "qemu/cutils.h" #include "qemu/main-loop.h" +#include "qemu/atomic.h" #include "qapi/qapi-visit-sockets.h" #include "qapi/qmp/qstring.h" @@ -43,6 +44,8 @@ #include "block/nbd.h" #include "block/block_int.h" +#include "qemu/yank.h" + #define EN_OPTSTR ":exportname=" #define MAX_NBD_REQUESTS 16 @@ -84,6 +87,8 @@ typedef struct BDRVNBDState { NBDReply reply; BlockDriverState *bs; + char *yank_name; + /* Connection parameters */ uint32_t reconnect_delay; SocketAddress *saddr; @@ -94,6 +99,7 @@ typedef struct BDRVNBDState { } BDRVNBDState; static int nbd_client_connect(BlockDriverState *bs, Error **errp); +static void nbd_yank(void *opaque); static void nbd_clear_bdrvstate(BDRVNBDState *s) { @@ -106,17 +112,19 @@ static void nbd_clear_bdrvstate(BDRVNBDState *s) s->tlscredsid = NULL; g_free(s->x_dirty_bitmap); s->x_dirty_bitmap = NULL; + g_free(s->yank_name); + s->yank_name = NULL; } static void nbd_channel_error(BDRVNBDState *s, int ret) { if (ret == -EIO) { - if (s->state == NBD_CLIENT_CONNECTED) { + if (atomic_load_acquire(&s->state) == NBD_CLIENT_CONNECTED) { s->state = s->reconnect_delay ? NBD_CLIENT_CONNECTING_WAIT : NBD_CLIENT_CONNECTING_NOWAIT; } } else { - if (s->state == NBD_CLIENT_CONNECTED) { + if (atomic_load_acquire(&s->state) == NBD_CLIENT_CONNECTED) { qio_channel_shutdown(s->ioc, QIO_CHANNEL_SHUTDOWN_BOTH, NULL); } s->state = NBD_CLIENT_QUIT; @@ -167,7 +175,7 @@ static void nbd_client_attach_aio_context(BlockDriverState *bs, * s->connection_co is either yielded from nbd_receive_reply or from * nbd_co_reconnect_loop() */ - if (s->state == NBD_CLIENT_CONNECTED) { + if (atomic_load_acquire(&s->state) == NBD_CLIENT_CONNECTED) { qio_channel_attach_aio_context(QIO_CHANNEL(s->ioc), new_context); } @@ -206,7 +214,7 @@ static void nbd_teardown_connection(BlockDriverState *bs) { BDRVNBDState *s = (BDRVNBDState *)bs->opaque; - if (s->state == NBD_CLIENT_CONNECTED) { + if (atomic_load_acquire(&s->state) == NBD_CLIENT_CONNECTED) { /* finish any pending coroutines */ assert(s->ioc); qio_channel_shutdown(s->ioc, QIO_CHANNEL_SHUTDOWN_BOTH, NULL); @@ -230,13 +238,14 @@ static void nbd_teardown_connection(BlockDriverState *bs) static bool nbd_client_connecting(BDRVNBDState *s) { - return s->state == NBD_CLIENT_CONNECTING_WAIT || - s->state == NBD_CLIENT_CONNECTING_NOWAIT; + NBDClientState state = atomic_load_acquire(&s->state); + return state == NBD_CLIENT_CONNECTING_WAIT || + state == NBD_CLIENT_CONNECTING_NOWAIT; } static bool nbd_client_connecting_wait(BDRVNBDState *s) { - return s->state == NBD_CLIENT_CONNECTING_WAIT; + return atomic_load_acquire(&s->state) == NBD_CLIENT_CONNECTING_WAIT; } static coroutine_fn void nbd_reconnect_attempt(BDRVNBDState *s) @@ -274,6 +283,7 @@ static coroutine_fn void nbd_reconnect_attempt(BDRVNBDState *s) /* Finalize previous connection if any */ if (s->ioc) { nbd_client_detach_aio_context(s->bs); + yank_unregister_function(s->yank_name, nbd_yank, s->bs); object_unref(OBJECT(s->sioc)); s->sioc = NULL; object_unref(OBJECT(s->ioc)); @@ -305,7 +315,7 @@ static coroutine_fn void nbd_co_reconnect_loop(BDRVNBDState *s) nbd_reconnect_attempt(s); while (nbd_client_connecting(s)) { - if (s->state == NBD_CLIENT_CONNECTING_WAIT && + if (atomic_load_acquire(&s->state) == NBD_CLIENT_CONNECTING_WAIT && qemu_clock_get_ns(QEMU_CLOCK_REALTIME) - start_time_ns > delay_ns) { s->state = NBD_CLIENT_CONNECTING_NOWAIT; @@ -341,7 +351,7 @@ static coroutine_fn void nbd_connection_entry(void *opaque) int ret = 0; Error *local_err = NULL; - while (s->state != NBD_CLIENT_QUIT) { + while (atomic_load_acquire(&s->state) != NBD_CLIENT_QUIT) { /* * The NBD client can only really be considered idle when it has * yielded from qio_channel_readv_all_eof(), waiting for data. This is @@ -356,7 +366,7 @@ static coroutine_fn void nbd_connection_entry(void *opaque) nbd_co_reconnect_loop(s); } - if (s->state != NBD_CLIENT_CONNECTED) { + if (atomic_load_acquire(&s->state) != NBD_CLIENT_CONNECTED) { continue; } @@ -411,6 +421,7 @@ static coroutine_fn void nbd_connection_entry(void *opaque) s->connection_co = NULL; if (s->ioc) { nbd_client_detach_aio_context(s->bs); + yank_unregister_function(s->yank_name, nbd_yank, s->bs); object_unref(OBJECT(s->sioc)); s->sioc = NULL; object_unref(OBJECT(s->ioc)); @@ -435,7 +446,7 @@ static int nbd_co_send_request(BlockDriverState *bs, qemu_co_queue_wait(&s->free_sema, &s->send_mutex); } - if (s->state != NBD_CLIENT_CONNECTED) { + if (atomic_load_acquire(&s->state) != NBD_CLIENT_CONNECTED) { rc = -EIO; goto err; } @@ -462,7 +473,7 @@ static int nbd_co_send_request(BlockDriverState *bs, if (qiov) { qio_channel_set_cork(s->ioc, true); rc = nbd_send_request(s->ioc, request); - if (rc >= 0 && s->state == NBD_CLIENT_CONNECTED) { + if (rc >= 0 && atomic_load_acquire(&s->state) == NBD_CLIENT_CONNECTED) { if (qio_channel_writev_all(s->ioc, qiov->iov, qiov->niov, NULL) < 0) { rc = -EIO; @@ -777,7 +788,7 @@ static coroutine_fn int nbd_co_do_receive_one_chunk( s->requests[i].receiving = true; qemu_coroutine_yield(); s->requests[i].receiving = false; - if (s->state != NBD_CLIENT_CONNECTED) { + if (atomic_load_acquire(&s->state) != NBD_CLIENT_CONNECTED) { error_setg(errp, "Connection closed"); return -EIO; } @@ -936,7 +947,7 @@ static bool nbd_reply_chunk_iter_receive(BDRVNBDState *s, NBDReply local_reply; NBDStructuredReplyChunk *chunk; Error *local_err = NULL; - if (s->state != NBD_CLIENT_CONNECTED) { + if (atomic_load_acquire(&s->state) != NBD_CLIENT_CONNECTED) { error_setg(&local_err, "Connection closed"); nbd_iter_channel_error(iter, -EIO, &local_err); goto break_loop; @@ -961,7 +972,8 @@ static bool nbd_reply_chunk_iter_receive(BDRVNBDState *s, } /* Do not execute the body of NBD_FOREACH_REPLY_CHUNK for simple reply. */ - if (nbd_reply_is_simple(reply) || s->state != NBD_CLIENT_CONNECTED) { + if (nbd_reply_is_simple(reply) || + atomic_load_acquire(&s->state) != NBD_CLIENT_CONNECTED) { goto break_loop; } @@ -1393,6 +1405,15 @@ static int nbd_client_reopen_prepare(BDRVReopenState *state, return 0; } +static void nbd_yank(void *opaque) +{ + BlockDriverState *bs = opaque; + BDRVNBDState *s = (BDRVNBDState *)bs->opaque; + + atomic_store_release(&s->state, NBD_CLIENT_QUIT); + qio_channel_shutdown(QIO_CHANNEL(s->sioc), QIO_CHANNEL_SHUTDOWN_BOTH, NULL); +} + static void nbd_client_close(BlockDriverState *bs) { BDRVNBDState *s = (BDRVNBDState *)bs->opaque; @@ -1405,25 +1426,29 @@ static void nbd_client_close(BlockDriverState *bs) nbd_teardown_connection(bs); } -static QIOChannelSocket *nbd_establish_connection(SocketAddress *saddr, - Error **errp) +static int nbd_establish_connection(BlockDriverState *bs, + SocketAddress *saddr, + Error **errp) { - QIOChannelSocket *sioc; + BDRVNBDState *s = (BDRVNBDState *)bs->opaque; Error *local_err = NULL; - sioc = qio_channel_socket_new(); - qio_channel_set_name(QIO_CHANNEL(sioc), "nbd-client"); + s->sioc = qio_channel_socket_new(); + qio_channel_set_name(QIO_CHANNEL(s->sioc), "nbd-client"); + yank_register_function(s->yank_name, nbd_yank, bs); - qio_channel_socket_connect_sync(sioc, saddr, &local_err); + qio_channel_socket_connect_sync(s->sioc, saddr, &local_err); if (local_err) { - object_unref(OBJECT(sioc)); + yank_unregister_function(s->yank_name, nbd_yank, bs); + object_unref(OBJECT(s->sioc)); + s->sioc = NULL; error_propagate(errp, local_err); - return NULL; + return -1; } - qio_channel_set_delay(QIO_CHANNEL(sioc), false); + qio_channel_set_delay(QIO_CHANNEL(s->sioc), false); - return sioc; + return 0; } static int nbd_client_connect(BlockDriverState *bs, Error **errp) @@ -1436,28 +1461,27 @@ static int nbd_client_connect(BlockDriverState *bs, Error **errp) * establish TCP connection, return error if it fails * TODO: Configurable retry-until-timeout behaviour. */ - QIOChannelSocket *sioc = nbd_establish_connection(s->saddr, errp); - - if (!sioc) { + if (nbd_establish_connection(bs, s->saddr, errp) < 0) { return -ECONNREFUSED; } /* NBD handshake */ trace_nbd_client_connect(s->export); - qio_channel_set_blocking(QIO_CHANNEL(sioc), false, NULL); - qio_channel_attach_aio_context(QIO_CHANNEL(sioc), aio_context); + qio_channel_set_blocking(QIO_CHANNEL(s->sioc), false, NULL); + qio_channel_attach_aio_context(QIO_CHANNEL(s->sioc), aio_context); s->info.request_sizes = true; s->info.structured_reply = true; s->info.base_allocation = true; s->info.x_dirty_bitmap = g_strdup(s->x_dirty_bitmap); s->info.name = g_strdup(s->export ?: ""); - ret = nbd_receive_negotiate(aio_context, QIO_CHANNEL(sioc), s->tlscreds, + ret = nbd_receive_negotiate(aio_context, QIO_CHANNEL(s->sioc), s->tlscreds, s->hostname, &s->ioc, &s->info, errp); g_free(s->info.x_dirty_bitmap); g_free(s->info.name); if (ret < 0) { - object_unref(OBJECT(sioc)); + yank_unregister_function(s->yank_name, nbd_yank, bs); + object_unref(OBJECT(s->sioc)); return ret; } if (s->x_dirty_bitmap && !s->info.base_allocation) { @@ -1483,10 +1507,8 @@ static int nbd_client_connect(BlockDriverState *bs, Error **errp) } } - s->sioc = sioc; - if (!s->ioc) { - s->ioc = QIO_CHANNEL(sioc); + s->ioc = QIO_CHANNEL(s->sioc); object_ref(OBJECT(s->ioc)); } @@ -1502,9 +1524,10 @@ static int nbd_client_connect(BlockDriverState *bs, Error **errp) { NBDRequest request = { .type = NBD_CMD_DISC }; - nbd_send_request(s->ioc ?: QIO_CHANNEL(sioc), &request); + nbd_send_request(s->ioc ?: QIO_CHANNEL(s->sioc), &request); - object_unref(OBJECT(sioc)); + yank_unregister_function(s->yank_name, nbd_yank, bs); + object_unref(OBJECT(s->sioc)); return ret; } @@ -1911,6 +1934,9 @@ static int nbd_open(BlockDriverState *bs, QDict *options, int flags, qemu_co_mutex_init(&s->send_mutex); qemu_co_queue_init(&s->free_sema); + s->yank_name = g_strconcat("blockdev:", bs->node_name, NULL); + yank_register_instance(s->yank_name); + ret = nbd_client_connect(bs, errp); if (ret < 0) { nbd_clear_bdrvstate(s); @@ -1970,6 +1996,7 @@ static void nbd_close(BlockDriverState *bs) BDRVNBDState *s = bs->opaque; nbd_client_close(bs); + yank_unregister_instance(s->yank_name); nbd_clear_bdrvstate(s); } From patchwork Tue Jun 23 14:42:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukas Straub X-Patchwork-Id: 11620883 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 CBCE590 for ; Tue, 23 Jun 2020 14:51:57 +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 A2BF420723 for ; Tue, 23 Jun 2020 14:51:57 +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="s41cefNB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A2BF420723 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]:43422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnkHE-0004go-KO for patchwork-qemu-devel@patchwork.kernel.org; Tue, 23 Jun 2020 10:51:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnk8X-0003xF-LU; Tue, 23 Jun 2020 10:42:57 -0400 Received: from mout.web.de ([212.227.15.4]:52705) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnk8V-0002Up-Qm; Tue, 23 Jun 2020 10:42:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1592923370; bh=966MeEmCdBmXq5ZMscyj1lFFlNZ/TNvAh5y+/Tq5lgw=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=s41cefNBPUc66kxALDo0Un4ry6SmtHq6HYikAkGo75s4WLKirege0MxzNQX19z6KF vIpJ3nQyqCmNhwfaVDI/WpdJXUn0I6jbrEB+NsHIXg5fJjDRk9F4MnVbr1Qt3Zk//1 DFNavwI66gbiSDVv0P3fFjanw+ecsFlEg78bd9Xk= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from luklap ([88.130.61.8]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MAMY6-1jgdeK1Rmc-00Bb35; Tue, 23 Jun 2020 16:42:50 +0200 Date: Tue, 23 Jun 2020 16:42:48 +0200 From: Lukas Straub To: qemu-devel Subject: [PATCH v5 3/7] chardev/char-socket.c: Add yank feature Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Provags-ID: V03:K1:JA0cV2yz/2bFiWBBpktQ57hqUazevxdqvYvJfOtkF4JGPd76AwL NV1xu+hp/dVNtxaeO0IKFPj2QBzogpB4Z6OojZrLBiV8p0eO9mvYvhsJGP2gZYhQBWylcbp 0g5Cg+rD4jNMgDdgDR2HsAEgWE8nM4Ggb8qrBgvkCpaShOU5uckTarZrIviu4kJ5iAzchp3 mEIX8pTslfEYrtRT4jpug== X-UI-Out-Filterresults: notjunk:1;V03:K0:UsbjXQ65B/s=:nC/6YIdDm6mDm9GTvJEH6j ntNovQ91SUazUgIwmzmhrxaj0QISP1F/RowYMfyavs6hmTGSKqffh9HBSHebOBcZwxBPY51kk sPGWc5PZozCb2f5OMTWQzamSDYKitJDKzZnLLxzeUTmrBhLK5EMClmJ2YoG1pipj/t3Y1YG3E PAlOxzcZWaSHjFuNewZZ9GIIAqLLd4+rZ9ymw4t4OnldcuBS85uTRFsq/dYhw6H5W35cAFeVH 5SExSkpQbXF7VoYJkhroolPnD5aqYkzuKBae0hIBVly2U8i3qqi9IDvG3zjBPh9pjGOWYsj4I QKi8H4aef2fimqo9KjZ1p3S7D2Dy/B4fBdWSlZz85vuiaQiSAy04I4iRMu0jNAxt7l2Vsq9H+ ycQJ8HBvVl8h/UXWzz7/5RDQELSVxBWP0CWr4j7bRs30oWLaX1gIJvfFdo/rFwJ2cz3rt745X YHHQ9HL4QOte/anXvTQEYBcCKtk0v96lLW3814QjfIljqVkn5/V8Is3JoHuNpyfM/k+I8UVGI 9tX3z6G10X0i/2shW7jnQSZLY7ylq6/FXicGGssQgGR3qCC1PoOdM31MehS7qipI3/w7s4alP ffvkQVQjrvYPRYqMVzHz18pJXi2cszht8YZsYlTQZpFN/dLBc17FkdrSPY/t2Iibs79enlPcI +oTjH9a1WXHWc7zna+feQz8LL8xUjEJGLPArpwrPSXBA36YwEJY273bOoyTDsWtSR72W18g0Q 1vu0oYOhSVcj9JQdM6AmCRjZbLpRLvTdFSgz0LApkAPHxRMTKw02MnZNE6cAw+QdN41eV49oV +6dV8pyVA1eOgfgC549f8bLire5/OTQ29q6840MkwhqI7bRbtT+eoeWkvzRjlT+WvVPCWdgxl qpF8L6h3eo8Gk/O4J4btOijLAZof5I5/ahn96EmeFveQECEA4uCFRtId5qmCBTn+F6nljcFKb U2vd4JGvdwq17HxjzDrgvVjjuEsMIp2iMyDIHfgrsXaJ8Q2TibzfIkyCod0o1goKFMelwCcJ/ la7QYZ4Oq7D00GWNzmEnZgCP2aVOQZLpmBqd7Rv5g3iEdcf7L3XX13+gksn7EO1+3u3ZRinxD TTfIaQSlAD+chy7sH7uRm2NZsmfOTnW7DXGpYJfHXRk4eWYUlE08R2zHVDPCCZRKFU38TZAF2 CwptDMhLobDPYk6CVsnUcUMuBUe5ZxmrHfjQEvM+0nXvjtyK++XLW2rkJa1qGAhlfRLTPFprZ rQoxv1OKsEWAcTLAk Received-SPF: pass client-ip=212.227.15.4; envelope-from=lukasstraub2@web.de; helo=mout.web.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/23 09:48:08 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 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.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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" Register a yank function to shutdown the socket on yank. Signed-off-by: Lukas Straub Reviewed-by: Daniel P. Berrangé --- chardev/char-socket.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) -- 2.20.1 diff --git a/chardev/char-socket.c b/chardev/char-socket.c index afebeec5c3..4e7a7e9ae4 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -34,6 +34,7 @@ #include "qapi/error.h" #include "qapi/clone-visitor.h" #include "qapi/qapi-visit-sockets.h" +#include "qemu/yank.h" #include "chardev/char-io.h" @@ -69,6 +70,7 @@ typedef struct { size_t read_msgfds_num; int *write_msgfds; size_t write_msgfds_num; + char *yank_name; SocketAddress *addr; bool is_listen; @@ -411,6 +413,11 @@ static void tcp_chr_free_connection(Chardev *chr) tcp_set_msgfds(chr, NULL, 0); remove_fd_in_watch(chr); + if (s->state == TCP_CHARDEV_STATE_CONNECTING + || s->state == TCP_CHARDEV_STATE_CONNECTED) { + yank_unregister_function(s->yank_name, yank_generic_iochannel, + QIO_CHANNEL(s->sioc)); + } object_unref(OBJECT(s->sioc)); s->sioc = NULL; object_unref(OBJECT(s->ioc)); @@ -916,6 +923,8 @@ static int tcp_chr_add_client(Chardev *chr, int fd) } tcp_chr_change_state(s, TCP_CHARDEV_STATE_CONNECTING); tcp_chr_set_client_ioc_name(chr, sioc); + yank_register_function(s->yank_name, yank_generic_iochannel, + QIO_CHANNEL(sioc)); ret = tcp_chr_new_client(chr, sioc); object_unref(OBJECT(sioc)); return ret; @@ -930,6 +939,8 @@ static void tcp_chr_accept(QIONetListener *listener, tcp_chr_change_state(s, TCP_CHARDEV_STATE_CONNECTING); tcp_chr_set_client_ioc_name(chr, cioc); + yank_register_function(s->yank_name, yank_generic_iochannel, + QIO_CHANNEL(cioc)); tcp_chr_new_client(chr, cioc); } @@ -945,6 +956,8 @@ static int tcp_chr_connect_client_sync(Chardev *chr, Error **errp) object_unref(OBJECT(sioc)); return -1; } + yank_register_function(s->yank_name, yank_generic_iochannel, + QIO_CHANNEL(sioc)); tcp_chr_new_client(chr, sioc); object_unref(OBJECT(sioc)); return 0; @@ -960,6 +973,8 @@ static void tcp_chr_accept_server_sync(Chardev *chr) tcp_chr_change_state(s, TCP_CHARDEV_STATE_CONNECTING); sioc = qio_net_listener_wait_client(s->listener); tcp_chr_set_client_ioc_name(chr, sioc); + yank_register_function(s->yank_name, yank_generic_iochannel, + QIO_CHANNEL(sioc)); tcp_chr_new_client(chr, sioc); object_unref(OBJECT(sioc)); } @@ -1070,6 +1085,8 @@ static void char_socket_finalize(Object *obj) object_unref(OBJECT(s->tls_creds)); } g_free(s->tls_authz); + yank_unregister_instance(s->yank_name); + g_free(s->yank_name); qemu_chr_be_event(chr, CHR_EVENT_CLOSED); } @@ -1085,6 +1102,8 @@ static void qemu_chr_socket_connected(QIOTask *task, void *opaque) if (qio_task_propagate_error(task, &err)) { tcp_chr_change_state(s, TCP_CHARDEV_STATE_DISCONNECTED); + yank_unregister_function(s->yank_name, yank_generic_iochannel, + QIO_CHANNEL(sioc)); check_report_connect_error(chr, err); error_free(err); goto cleanup; @@ -1119,6 +1138,8 @@ static void tcp_chr_connect_client_async(Chardev *chr) tcp_chr_change_state(s, TCP_CHARDEV_STATE_CONNECTING); sioc = qio_channel_socket_new(); tcp_chr_set_client_ioc_name(chr, sioc); + yank_register_function(s->yank_name, yank_generic_iochannel, + QIO_CHANNEL(sioc)); /* * Normally code would use the qio_channel_socket_connect_async * method which uses a QIOTask + qio_task_set_error internally @@ -1360,6 +1381,9 @@ static void qmp_chardev_open_socket(Chardev *chr, qemu_chr_set_feature(chr, QEMU_CHAR_FEATURE_FD_PASS); } + s->yank_name = g_strconcat("chardev:", chr->label, NULL); + yank_register_instance(s->yank_name); + /* be isn't opened until we get a connection */ *be_opened = false; From patchwork Tue Jun 23 14:42:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukas Straub X-Patchwork-Id: 11620879 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 2329014E3 for ; Tue, 23 Jun 2020 14:47:31 +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 DE82320720 for ; Tue, 23 Jun 2020 14:47:30 +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="f0Hx31tD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE82320720 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]:60980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnkCv-00083g-VH for patchwork-qemu-devel@patchwork.kernel.org; Tue, 23 Jun 2020 10:47:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnk8c-00042h-5Z; Tue, 23 Jun 2020 10:43:02 -0400 Received: from mout.web.de ([217.72.192.78]:50347) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnk8a-0002WD-0v; Tue, 23 Jun 2020 10:43:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1592923374; bh=OXYA2rA7TS0jYFzP7AJQBG9AKnGgKRdTNDQd8/ZssBo=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=f0Hx31tD5Zyd4sLchX4lMbw3+OaNETax0snATbwMMfWU8ylMonZ8bGCfVNqHSwqSY 5AUWTmfXzQkS5OPKCqqNEwWZ4+0G+tfJDj9ZAO++vzJ6Ii9wYfZ9uopSFFDUgFUG6P 5QKaa1klVz5kg+H1KjfRPuwJm7T8qCowINOGlRaA= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from luklap ([88.130.61.8]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1M76bV-1jmMIE43wd-008ZT8; Tue, 23 Jun 2020 16:42:54 +0200 Date: Tue, 23 Jun 2020 16:42:52 +0200 From: Lukas Straub To: qemu-devel Subject: [PATCH v5 4/7] migration: Add yank feature Message-ID: <5f155c94d2d516bf2a10cb183b1740f7d56f0459.1592923201.git.lukasstraub2@web.de> In-Reply-To: References: MIME-Version: 1.0 X-Provags-ID: V03:K1:CF9JN5Qkz5PZh0Zymzf09S1yWzxZ0pUq1Rr1YOcNM1LAb43u9gr 45BBa2qFope7ZWA1jn9XvPDu2uJOq8bbsr6h+zM2qVRiOPCmHiXo0rDsW/vGq7BzdB2+DXq mQ374/OwAJrjd6AhqLNkZ8o1dj0QYqY89vy9lraxJEXS4mEzhsL8D8VkFkgTAKF0QKFrquC qgM2mCb4aw2sXU2egLXvQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:Lx3sl0MR+WM=:mlxqhJHadW7A8sb9TMUvrT TUd8XYgxdFRCnU0beXcuthvCCtsi4wcuAPWa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GE35srlZZk8XGs4I8vXVkrGzVbjL8S1aac0Zhjt5i tPhQl0jhnv3JjMWcPV3eLnaNzAZYUJ1MgUQYF0eS5GoaPSnMKMfkGrkU3tWc/yBQsPVB7YxED UocIJ3GY4vYijD93U Received-SPF: pass client-ip=217.72.192.78; envelope-from=lukasstraub2@web.de; helo=mout.web.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/23 10:42:44 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.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_H2=-1, SPF_HELO_NONE=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" Register yank functions on sockets to shut them down. Signed-off-by: Lukas Straub Reviewed-by: Daniel P. Berrangé --- migration/channel.c | 12 ++++++++++++ migration/migration.c | 18 +++++++++++++++++- migration/multifd.c | 10 ++++++++++ migration/qemu-file-channel.c | 6 ++++++ migration/savevm.c | 2 ++ tests/Makefile.include | 2 +- 6 files changed, 48 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/migration/channel.c b/migration/channel.c index 20e4c8e2dc..21fc8046b9 100644 --- a/migration/channel.c +++ b/migration/channel.c @@ -18,6 +18,8 @@ #include "trace.h" #include "qapi/error.h" #include "io/channel-tls.h" +#include "io/channel-socket.h" +#include "qemu/yank.h" /** * @migration_channel_process_incoming - Create new incoming migration channel @@ -35,6 +37,11 @@ void migration_channel_process_incoming(QIOChannel *ioc) trace_migration_set_incoming_channel( ioc, object_get_typename(OBJECT(ioc))); + if (object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET)) { + yank_register_function("migration", yank_generic_iochannel, + QIO_CHANNEL(ioc)); + } + if (s->parameters.tls_creds && *s->parameters.tls_creds && !object_dynamic_cast(OBJECT(ioc), @@ -67,6 +74,11 @@ void migration_channel_connect(MigrationState *s, ioc, object_get_typename(OBJECT(ioc)), hostname, error); if (!error) { + if (object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET)) { + yank_register_function("migration", yank_generic_iochannel, + QIO_CHANNEL(ioc)); + } + if (s->parameters.tls_creds && *s->parameters.tls_creds && !object_dynamic_cast(OBJECT(ioc), diff --git a/migration/migration.c b/migration/migration.c index 481a590f72..720f0f9d44 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -54,6 +54,7 @@ #include "net/announce.h" #include "qemu/queue.h" #include "multifd.h" +#include "qemu/yank.h" #define MAX_THROTTLE (32 << 20) /* Migration transfer speed throttling */ @@ -231,6 +232,8 @@ void migration_incoming_state_destroy(void) qapi_free_SocketAddressList(mis->socket_address_list); mis->socket_address_list = NULL; } + + yank_unregister_instance("migration"); } static void migrate_generate_event(int new_state) @@ -362,7 +365,9 @@ void qemu_start_incoming_migration(const char *uri, Error **errp) const char *p; qapi_event_send_migration(MIGRATION_STATUS_SETUP); + yank_register_instance("migration"); if (!strcmp(uri, "defer")) { + yank_unregister_instance("migration"); deferred_incoming_migration(errp); } else if (strstart(uri, "tcp:", &p)) { tcp_start_incoming_migration(p, errp); @@ -377,6 +382,7 @@ void qemu_start_incoming_migration(const char *uri, Error **errp) } else if (strstart(uri, "fd:", &p)) { fd_start_incoming_migration(p, errp); } else { + yank_unregister_instance("migration"); error_setg(errp, "unknown migration protocol: %s", uri); } } @@ -1646,6 +1652,7 @@ static void migrate_fd_cleanup(MigrationState *s) } notifier_list_notify(&migration_state_notifiers, s); block_cleanup_parameters(s); + yank_unregister_instance("migration"); } static void migrate_fd_cleanup_schedule(MigrationState *s) @@ -1912,6 +1919,7 @@ void qmp_migrate_recover(const char *uri, Error **errp) * only re-setup the migration stream and poke existing migration * to continue using that newly established channel. */ + yank_unregister_instance("migration"); qemu_start_incoming_migration(uri, errp); } @@ -2048,7 +2056,9 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, /* Error detected, put into errp */ return; } - + if (!(has_resume && resume)) { + yank_register_instance("migration"); + } if (strstart(uri, "tcp:", &p)) { tcp_start_outgoing_migration(s, p, &local_err); #ifdef CONFIG_RDMA @@ -2062,6 +2072,9 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, } else if (strstart(uri, "fd:", &p)) { fd_start_outgoing_migration(s, p, &local_err); } else { + if (!(has_resume && resume)) { + yank_unregister_instance("migration"); + } error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "uri", "a valid migration protocol"); migrate_set_state(&s->state, MIGRATION_STATUS_SETUP, @@ -2071,6 +2084,9 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, } if (local_err) { + if (!(has_resume && resume)) { + yank_unregister_instance("migration"); + } migrate_fd_error(s, local_err); error_propagate(errp, local_err); return; diff --git a/migration/multifd.c b/migration/multifd.c index d0441202aa..2c9863e770 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -24,6 +24,9 @@ #include "trace.h" #include "multifd.h" +#include "qemu/yank.h" +#include "io/channel-socket.h" + /* Multiple fd's */ #define MULTIFD_MAGIC 0x11223344U @@ -866,6 +869,13 @@ int multifd_load_cleanup(Error **errp) for (i = 0; i < migrate_multifd_channels(); i++) { MultiFDRecvParams *p = &multifd_recv_state->params[i]; + if (object_dynamic_cast(OBJECT(p->c), TYPE_QIO_CHANNEL_SOCKET) + && OBJECT(p->c)->ref == 1) { + yank_unregister_function("migration", + yank_generic_iochannel, + QIO_CHANNEL(p->c)); + } + object_unref(OBJECT(p->c)); p->c = NULL; qemu_mutex_destroy(&p->mutex); diff --git a/migration/qemu-file-channel.c b/migration/qemu-file-channel.c index d2ce32f4b9..d8f8384fea 100644 --- a/migration/qemu-file-channel.c +++ b/migration/qemu-file-channel.c @@ -27,6 +27,7 @@ #include "qemu-file.h" #include "io/channel-socket.h" #include "qemu/iov.h" +#include "qemu/yank.h" static ssize_t channel_writev_buffer(void *opaque, @@ -104,6 +105,11 @@ static int channel_close(void *opaque, Error **errp) int ret; QIOChannel *ioc = QIO_CHANNEL(opaque); ret = qio_channel_close(ioc, errp); + if (object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET) + && OBJECT(ioc)->ref == 1) { + yank_unregister_function("migration", yank_generic_iochannel, + QIO_CHANNEL(ioc)); + } object_unref(OBJECT(ioc)); return ret; } diff --git a/migration/savevm.c b/migration/savevm.c index b979ea6e7f..75e8b85697 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -63,6 +63,7 @@ #include "migration/colo.h" #include "qemu/bitmap.h" #include "net/announce.h" +#include "qemu/yank.h" const unsigned int postcopy_ram_discard_version = 0; @@ -2897,6 +2898,7 @@ int load_snapshot(const char *name, Error **errp) qemu_system_reset(SHUTDOWN_CAUSE_NONE); mis->from_src_file = f; + yank_register_instance("migration"); aio_context_acquire(aio_context); ret = qemu_loadvm_state(f); migration_incoming_state_destroy(); diff --git a/tests/Makefile.include b/tests/Makefile.include index 3f4448a20b..889fc4e4e7 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -450,7 +450,7 @@ tests/test-qdev-global-props$(EXESUF): tests/test-qdev-global-props.o \ $(test-qapi-obj-y) tests/test-vmstate$(EXESUF): tests/test-vmstate.o \ migration/vmstate.o migration/vmstate-types.o migration/qemu-file.o \ - migration/qemu-file-channel.o migration/qjson.o \ + migration/qemu-file-channel.o migration/qjson.o util/yank.o \ $(test-io-obj-y) tests/test-timed-average$(EXESUF): tests/test-timed-average.o $(test-util-obj-y) tests/test-base64$(EXESUF): tests/test-base64.o $(test-util-obj-y) From patchwork Tue Jun 23 14:42:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukas Straub X-Patchwork-Id: 11620885 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 7A20C6C1 for ; Tue, 23 Jun 2020 14:52:48 +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 5143820723 for ; Tue, 23 Jun 2020 14:52:48 +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="dSwiULTF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5143820723 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]:45256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnkI3-0005fE-E3 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 23 Jun 2020 10:52:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58474) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnk8e-00045s-Rl; Tue, 23 Jun 2020 10:43:04 -0400 Received: from mout.web.de ([212.227.15.3]:57299) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnk8d-0002XA-AP; Tue, 23 Jun 2020 10:43:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1592923377; bh=qd/7yebiS+3k/Kn4Vg71ggA6f9/4npqJ5cGwy+3qO4c=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=dSwiULTFzoKT0vHvdiXyPQvphYqqxcY0C66nbQVhea9QBAyrNvZXpspXcMOOdzwbV J2KjBydYmmHiJKGXSiCw+m7+/xOhqppaN+fg6x98oC5HbmoOYmh2rlIweMTWaLb4RI Ix0N5bEUwGVdyjurjTtA3n7eEnHw1lPFgh096MiU= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from luklap ([88.130.61.8]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M8hdL-1isSmY16up-00wFZA; Tue, 23 Jun 2020 16:42:57 +0200 Date: Tue, 23 Jun 2020 16:42:56 +0200 From: Lukas Straub To: qemu-devel Subject: [PATCH v5 5/7] io/channel-tls.c: make qio_channel_tls_shutdown thread-safe Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Provags-ID: V03:K1:JzrpfeIQ8CpPCekPtyoLxLgUJ8CGMRtgW549i29qab60bCywFjm 122WEpOsT2JxpOCqxgK6vdcYTgWc60nOv11PFrdVBXQ68W6F2CNiu9rofsTnnQgLmzM6ikD 7kTqTJADaFBbAutAJ57S92Mbrrf68iJns03WJuDYyXYeH51oLKBnofdQ2FhGMPoPim8ruP8 wmRH0c7wyLWBsCC/+H2Kg== X-UI-Out-Filterresults: notjunk:1;V03:K0:HFXjYqe2qpQ=:H4ukt0c+cIKFGhGH7gbjyA LB+KnKtF+5A3bzPBTMnCeib2LyBQXyP21pUwBm3Asz8y5aGuGZoZOfV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HeX/x3wY/zRe55Lf7ZLWRlFlVJV0NP 2LlDIRcI8bOHpNTV25R5Dj1RUFJG9jYeQ8pvSJcz8bsfZr/QqcmSM5bxZ75/6TQ8wkT+BGVIz NMLMW3YHiilemEWvY Received-SPF: pass client-ip=212.227.15.3; envelope-from=lukasstraub2@web.de; helo=mout.web.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/23 10:42:47 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 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.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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" Make qio_channel_tls_shutdown thread-safe by using atomics when accessing tioc->shutdown. Signed-off-by: Lukas Straub Reviewed-by: Daniel P. Berrangé --- io/channel-tls.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/io/channel-tls.c b/io/channel-tls.c index 7ec8ceff2f..b350c84640 100644 --- a/io/channel-tls.c +++ b/io/channel-tls.c @@ -23,6 +23,7 @@ #include "qemu/module.h" #include "io/channel-tls.h" #include "trace.h" +#include "qemu/atomic.h" static ssize_t qio_channel_tls_write_handler(const char *buf, @@ -277,7 +278,8 @@ static ssize_t qio_channel_tls_readv(QIOChannel *ioc, return QIO_CHANNEL_ERR_BLOCK; } } else if (errno == ECONNABORTED && - (tioc->shutdown & QIO_CHANNEL_SHUTDOWN_READ)) { + (atomic_load_acquire(&tioc->shutdown) & + QIO_CHANNEL_SHUTDOWN_READ)) { return 0; } @@ -361,7 +363,7 @@ static int qio_channel_tls_shutdown(QIOChannel *ioc, { QIOChannelTLS *tioc = QIO_CHANNEL_TLS(ioc); - tioc->shutdown |= how; + atomic_or(&tioc->shutdown, how); return qio_channel_shutdown(tioc->master, how, errp); } From patchwork Tue Jun 23 14:42:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukas Straub X-Patchwork-Id: 11620893 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 33D10913 for ; Tue, 23 Jun 2020 14:58:45 +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 0971720723 for ; Tue, 23 Jun 2020 14:58:45 +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="PmXbJZl9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0971720723 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]:52872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnkNo-00017p-3N for patchwork-qemu-devel@patchwork.kernel.org; Tue, 23 Jun 2020 10:58:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnk8i-00047O-SV; Tue, 23 Jun 2020 10:43:08 -0400 Received: from mout.web.de ([212.227.17.11]:42367) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnk8g-0002Ys-Ss; Tue, 23 Jun 2020 10:43:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1592923380; bh=3cHbGcz3lZmcKJXuzmvXzd3SToaDH2ofaQrw3xL/jKU=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=PmXbJZl9h+nIAZN0Y5bfufaoTYV/qWlRlR9gGsSiBEyRQgIOPDHKBPaxKVdxfXolQ 7MN7E+tc3iwwXUCMvXONWD6XCwODScs0jlnTe9TIpM5Fg+Km8gHQvZOeQEhjKq/l6A WGIQ1z0/RoPy1iy7FI+xccu7nB+toQ4PDrPeg2Rc= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from luklap ([88.130.61.8]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MINAx-1jqm8x2ONj-0048Fa; Tue, 23 Jun 2020 16:43:00 +0200 Date: Tue, 23 Jun 2020 16:42:59 +0200 From: Lukas Straub To: qemu-devel Subject: [PATCH v5 6/7] io: Document thread-safety of qio_channel_shutdown Message-ID: <8d567c499f0d778501d57007b90ec3450aba9947.1592923201.git.lukasstraub2@web.de> In-Reply-To: References: MIME-Version: 1.0 X-Provags-ID: V03:K1:UYMpYLGEX++84fzRIrzOsAtFaWAxdWVv5LLvfKJOhQ0OpegH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lmCOXkjNnp0Gd+4KNHcIOZ FkF/oA42sy2vYRtIH939YkR5u4z9wy0UdVVRFfhnOnKJTH1WdEeFMtemKCZ9OFv5vb2SJtWzU /aNLXiYznmMUd346TiUUBZbq+bVMYMEUXP8pvtpVl/GIrn0/n9a47BTqoV3MKtZqdQXtIGSxb CY+lGgAvkKhKrgd8oWvFo/tOC0E88zl6ZGFhWnbWX+7kEJ8nHLWqVBPvqrknm6RKHHkx7Rx7U ajz5bwRxWg0d190hJ2eOfV1bmfk/oPrM8ZccvYY3XqBXjt5Yc5sc79yhYfZcehH/Emu8H8I3w K5gHWtVEY/mqX94lhdtv+1ahywVhpvHWm2+XA7uyCbCQUzcCQxtq+/6Rv1i2t6BpJKdoVhXEx YIWxwnoRsFOxLsc7v Received-SPF: pass client-ip=212.227.17.11; envelope-from=lukasstraub2@web.de; helo=mout.web.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/23 10:42:51 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 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.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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" Migration and yank code assume that qio_channel_shutdown is thread -safe. Document this after checking the code. Signed-off-by: Lukas Straub Reviewed-by: Daniel P. Berrangé --- include/io/channel.h | 2 ++ 1 file changed, 2 insertions(+) -- 2.20.1 diff --git a/include/io/channel.h b/include/io/channel.h index d4557f0930..6b8a2b87b8 100644 --- a/include/io/channel.h +++ b/include/io/channel.h @@ -516,6 +516,8 @@ int qio_channel_close(QIOChannel *ioc, * QIO_CHANNEL_FEATURE_SHUTDOWN prior to calling * this method. * + * This function is thread-safe. + * * Returns: 0 on success, -1 on error */ int qio_channel_shutdown(QIOChannel *ioc, From patchwork Tue Jun 23 14:43:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Straub X-Patchwork-Id: 11620891 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 26FF0913 for ; Tue, 23 Jun 2020 14:58:15 +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 9763320723 for ; Tue, 23 Jun 2020 14:58:14 +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="nYQJ4XCd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9763320723 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]:50600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnkNJ-0000BK-Dx for patchwork-qemu-devel@patchwork.kernel.org; Tue, 23 Jun 2020 10:58:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnk8w-0004Ik-H1; Tue, 23 Jun 2020 10:43:22 -0400 Received: from mout.web.de ([212.227.15.4]:49071) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnk8u-0002cT-Qe; Tue, 23 Jun 2020 10:43:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1592923395; bh=ZNMbTxbtXHaFTwahCwpOthPggxtv9+n/34UoZIYiClI=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=nYQJ4XCdyKnLD5rjHH1JocN+8LXlNXynP/MbfmFAuiWoG2sjuyC3T3OHLEvbJOlam KauoPPbpMP9sQTDFQFqkzHc//9otBTcU2lrs7TgSJ2f5KIQDm2U5LCrEZn0vrpmkUl FpP+XW9Ha+aTyaKPi6HdjM1EFPZDuCjabGcaceH4= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from luklap ([88.130.61.8]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1Mmhnu-1j6Syj0Gco-00jtwg; Tue, 23 Jun 2020 16:43:15 +0200 Date: Tue, 23 Jun 2020 16:43:13 +0200 From: Lukas Straub To: qemu-devel Subject: [PATCH v5 7/7] MAINTAINERS: Add myself as maintainer for yank feature Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Provags-ID: V03:K1:oImakV1bRvPU7UulmCWxpSLYdOjZC3Vo1nv+ue14TJE6BfPqnM+ +YL8HLZfudkZbQHUC6JiFHWVvzBwshxtr0YhcAHWwT78j5w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II5zf/1QDjYYmRK+iTEb1g1JPZkcfgkYUBqVkzsOJr4ta+0TAvY/7Ej Q87q5ysOifbxKxEKBaXMGMh1VuQHfs64SSvnU+5XM7ygUiMVERh5B9S27VR65D7IhgMw+8VKx iMbjp2YGfzST6q+lC2ogixzxiRLPJw5tHeh6wldJv6YDRsqM5JvexEUUOKoWCnJ69/7cvlCSI QFsm6AZl2UvHA63EhFV3/YyNk+LS9hNmzp6A/377lqJu8R3gge1fhXUHH97I64+Am66qOKlhx IG+2bBhsb3I8ezAPYpB/J78QN+xBwqLWSIRaMBQoo9MfwtAJYAadbh2O04urghdX0XLuhOly4 2gWhy+uFXdfRJjLz8 Received-SPF: pass client-ip=212.227.15.4; envelope-from=lukasstraub2@web.de; helo=mout.web.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/23 09:48:08 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 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.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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" I'll maintain this for now as the colo usecase is the first user of this functionality. Signed-off-by: Lukas Straub --- MAINTAINERS | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 2.20.1 diff --git a/MAINTAINERS b/MAINTAINERS index 955cc8dd5c..a403d59190 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2506,6 +2506,19 @@ F: util/uuid.c F: include/qemu/uuid.h F: tests/test-uuid.c +Yank feature +M: Lukas Straub +S: Odd fixes +F: util/yank.c +F: include/qemu/yank.h +F: chardev/char-socket.c +F: block/nbd.c +F: migration/channel.c +F: migration/migration.c +F: migration/multifd.c +F: migration/qemu-file-channel.c +F: migration/savevm.c + COLO Framework M: zhanghailiang S: Maintained