From patchwork Fri Jan 19 16:35:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 763947 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a08:0:b0:337:62d3:c6d5 with SMTP id m8csp535262wrq; Fri, 19 Jan 2024 08:35:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IHvdO2VjpcfuCISypBFLy1L/AAyCLTR/izA3REHZP9hMUl+f5vz38ZU2GvC/gmNreMJHBfg X-Received: by 2002:a9d:4f06:0:b0:6dc:9c6:b060 with SMTP id d6-20020a9d4f06000000b006dc09c6b060mr83987otl.13.1705682130667; Fri, 19 Jan 2024 08:35:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705682130; cv=none; d=google.com; s=arc-20160816; b=xYPtINifAaNLZaOiJsDdZQygGCBc00Hq2zVxD/fvKIAm6soAtTZaEJApLirwxntfrH kU0+0qHq1d8d4n19t8kgKkAe8OQpbUsWsjtT8XSBKhb09FsvkP6ik6hv2T5pme5Mlz85 suQ0aiPW3Jro7BLmYK9z4OpM2FlwaoaW8LRpKqc8vvcYq6b0662K6Uft5wKAf38OkUPk P38Y5zy8kTJlwcl+ribxMXbOdac1yP1gyT9wyfhE7v4DakdWDdFO0jhD1g0HaDZuCnbC ZiHJqyDNVRv4NUNoPcWWs9IRlK9ozekGYUrqmIHW/MrTGMkTkyhdJJlsBHH08BMfNKyX 1jzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wLWOOCsvWKB0fq6rzd5QzssHwCuxhyOKho4Poa5gytE=; fh=nxeo78RkLzeDKPAjNj8CYMf+h+JyAlKdAq+qj8OM6yk=; b=WGWQrszwQWFlmrmB2eETDQXsS7uQ4qI2wBFY2eneASkNqFo65PFGi0RYqZfhwy/KFE pdL4vZFpIARNty4HOFEur3iJWiL5nVpTXoRPlsbtVtLo3m5vpUmrvyyFc1N0rJVtgcVY ML5mmTe4eS+/FBGOamlkyns5oQwulz56jwS8qzniv1gvGjn+RdC/XrYOI9P/xtazkRe6 0Cr2TGZGmA+DpYcH4mN7iK+vFK3EkP9hrbKVxUvMdQ0L3OGiXO8dwUd0HwJuI+1HxFGz 0iq4z8IkCKVY5ZYhOSNhHoXbLpgSXT6GKbDsXZqKj4rky0xOp3kU7wCJWMCr3K9LxheW K6oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fuEGenAO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w2-20020a05622a190200b00429b8cf9a8esi17114028qtc.11.2024.01.19.08.35.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Jan 2024 08:35:30 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fuEGenAO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQrpx-0000mC-5h; Fri, 19 Jan 2024 11:35:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQrpu-0000kZ-RJ for qemu-devel@nongnu.org; Fri, 19 Jan 2024 11:35:18 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rQrps-0004lz-OQ for qemu-devel@nongnu.org; Fri, 19 Jan 2024 11:35:18 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40e8801221cso8759375e9.1 for ; Fri, 19 Jan 2024 08:35:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705682115; x=1706286915; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wLWOOCsvWKB0fq6rzd5QzssHwCuxhyOKho4Poa5gytE=; b=fuEGenAOd7SfKoknSV1TTyD9k1olsYyvQoVkKQn5XJTLgxLOoq9fh2Jqrw/w+waI+V zhyrhQbkg1e6noIgk4oyTAw7dzXwqK4uRNq548ggci5yEi88S+hbC/dAInyxCXtvDiMo NvE87ZbzfyXJ8VUfXJVI5NqWg8CVkuFVZjuJYcGwc9Oqxy0HG1xMasZHkAAul051lcGY g5aZQnVA/9tTiJ3juCbG+R+/cl0buS89XiJW/f7iXxmbY9cTw7ytWfPI7Ee401UHvcZx J03NQA73XquWm3CrV+eSEcPK3RGAGRlLmEL0C+vKdL3If/VDRPoy2tylEEEPX8rEW0Ne o14g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705682115; x=1706286915; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wLWOOCsvWKB0fq6rzd5QzssHwCuxhyOKho4Poa5gytE=; b=qcGf3t6552OutJ9RW1+nTJUJS+4e4tH7yAzXw7Q1x9D42v/fwNEJ/mkDDyB30m+KhP aEXu8CvGMKDOwVvpXtAAHU5lqG384/78w2AmcijTw6Y0dS4sy+vsQT2fNnq/KdJpEfVD eqORBLz2YEYwtH06+b1IAg+HAVy4nic7UbIAExA2HvEKVEdwkDriqxS5uAo6E++lYtQ8 XW/XAGGL++R+3jUMnki5bJ9joog3urHjyO7wxJy9mecJOBGAhaB+cSnA3UNLGeXvZWkK X5UnBKWI45wlvEMBoHDCobc1PzxCg5oVMlbxFlClT3wLRbhDL47w+gUfNqG6iLQWXouc ZvpA== X-Gm-Message-State: AOJu0YysRnxSSiqrBEEDuNpDJQU87HtQtXs2FgMb327DdNpb8c9ix16z wYkWb9JLx1yqz1iXD89vCEGNa08ngd1J+fYtiI0T0rZWY+L0V0VZm6G7xhwIQrmBvARkzS0o/oB G X-Received: by 2002:a05:600c:1c06:b0:40e:88be:4ef0 with SMTP id j6-20020a05600c1c0600b0040e88be4ef0mr33004wms.0.1705682115282; Fri, 19 Jan 2024 08:35:15 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id fc11-20020a05600c524b00b0040e86fbd772sm10979260wmb.38.2024.01.19.08.35.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 08:35:15 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: "Maciej S. Szmigiero" , Mark Cave-Ayland , "Michael S. Tsirkin" , Marcel Apfelbaum , Halil Pasic , Christian Borntraeger , Eric Farman , Peter Xu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/5] vmbus: Switch bus reset to 3-phase-reset Date: Fri, 19 Jan 2024 16:35:09 +0000 Message-Id: <20240119163512.3810301-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240119163512.3810301-1-peter.maydell@linaro.org> References: <20240119163512.3810301-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Switch vmbus from using BusClass::reset to the Resettable interface. This has no behavioural change, because the BusClass code to support subclasses that use the legacy BusClass::reset will call that method in the hold phase of 3-phase reset. Signed-off-by: Peter Maydell Acked-by: Maciej S. Szmigiero Reviewed-by: Zhao Liu --- hw/hyperv/vmbus.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c index c86d1895bae..380239af2c7 100644 --- a/hw/hyperv/vmbus.c +++ b/hw/hyperv/vmbus.c @@ -2453,9 +2453,9 @@ static void vmbus_unrealize(BusState *bus) qemu_mutex_destroy(&vmbus->rx_queue_lock); } -static void vmbus_reset(BusState *bus) +static void vmbus_reset_hold(Object *obj) { - vmbus_deinit(VMBUS(bus)); + vmbus_deinit(VMBUS(obj)); } static char *vmbus_get_dev_path(DeviceState *dev) @@ -2476,12 +2476,13 @@ static char *vmbus_get_fw_dev_path(DeviceState *dev) static void vmbus_class_init(ObjectClass *klass, void *data) { BusClass *k = BUS_CLASS(klass); + ResettableClass *rc = RESETTABLE_CLASS(klass); k->get_dev_path = vmbus_get_dev_path; k->get_fw_dev_path = vmbus_get_fw_dev_path; k->realize = vmbus_realize; k->unrealize = vmbus_unrealize; - k->reset = vmbus_reset; + rc->phases.hold = vmbus_reset_hold; } static int vmbus_pre_load(void *opaque)