From patchwork Thu Jun 20 15:22:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 805985 Delivered-To: patch@linaro.org Received: by 2002:a5d:508d:0:b0:362:4979:7f74 with SMTP id a13csp345985wrt; Thu, 20 Jun 2024 08:24:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWhyI0z9Sfrclbrxj/oXanF/plbQgtGaICRfXlmsN1QoujmLvOY2+AOL7zAdprpVDevvwIP+MMJSysm5iyU45AC X-Google-Smtp-Source: AGHT+IE1EndobiZd0OeqY8Hig0j/aRpx3q/6xzlGk7SEUuUDZjAb/XPaEcngfq18da7ZbkzXByS8 X-Received: by 2002:a81:9303:0:b0:617:c383:42ac with SMTP id 00721157ae682-63a8faf1da8mr52993387b3.51.1718897044151; Thu, 20 Jun 2024 08:24:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718897044; cv=none; d=google.com; s=arc-20160816; b=a239lIWSuOkERygCPJ6vdMKNMN+2QFngSmuFGFvD1Kvv43FL0xDzwB6NTnwKjFTCmE Hs3e+rLHBtTyEPGO7IQ/3HKFtPrIVajj/eakHg7WrKhZf+2JsqTna7WV8ygFN4IdOHL6 zhGUAO68yEILw9LPMMqepuedAx/AGFOn9WOAVMrsyI3GzpbfmE1e/xhHESOax6pCn70v 7Xwk9XCT32K060y6b63Y/ySbIbqpgxoSUWU1nJBh+K3138crAzKmCZ+3mRiVY6kzQijJ RKZEl1YJlMw50ndfyxG0PpC6MyLS/XVuBnr9T0TRly66KJBWF+IXvIIFfPNuTa98wLfI jgwQ== 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=ZQ8CEbgFXQ50Jx+/zMrlpDCus+bU22jqqVwm5sZfxvc=; fh=qYUyA+SSE+X3fQR5X1u+SwltJ/ArWqMeAeFp+rGIm4A=; b=Fxdq0+rQ7qDI2U5ke7+SmXgFoSde80u+oxyLDRABhDXKl/rYnyBz5TZLzrogsaIYPe i+iCXcdd1vqkK9GZCghcg+xK+NWVeYnCzSZgn/9GhzJLFq9Q+25RSntG1N6G7kBXqngL +iHpgZhvpjI1RsoCC9RLyDcwxrfvbThF4zxrs9GHhO8giozhOophV7q9J/PuSMKpOChV bvO2TeolRFnMnmMZsf4jQ52s/J2lM07o5MLZHB1KSRtcYWbibdCfqtfyOOT6t/cNOMwP G5qlM6xOTCTriu+q42b7uACh3dvuRUlalUAH+/8b7KYVbsb75PwUYe3CcW6y1/fBuTfQ h7zw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qyTwHgqY; 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 d75a77b69052e-441f2fb79besi169425951cf.429.2024.06.20.08.24.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Jun 2024 08:24:04 -0700 (PDT) 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=qyTwHgqY; 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 1sKJcZ-00064M-Ro; Thu, 20 Jun 2024 11:22:43 -0400 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 1sKJcX-0005zm-Iv for qemu-devel@nongnu.org; Thu, 20 Jun 2024 11:22:41 -0400 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sKJcU-00081J-BT for qemu-devel@nongnu.org; Thu, 20 Jun 2024 11:22:41 -0400 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a6fb341a7f2so130464666b.1 for ; Thu, 20 Jun 2024 08:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718896957; x=1719501757; 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=ZQ8CEbgFXQ50Jx+/zMrlpDCus+bU22jqqVwm5sZfxvc=; b=qyTwHgqYX6E3DfIN8VEFe6Y71TU8F1nmaGduFYVpRCLkMoaXz96+iyyJkslvLOpOp4 FF6nJjLkfCfRa7E5aEdJXHH95U5DYD6cvHa66P5t8rvUYTnjJdfet2SCynF4UBXXDYrZ aS5zd96v3Qof9gigW6Q12xT7tEmM/oQj5zBEgRdzFaWC3zk0f6hOzm3tBEP0dDX67vnl 40vEMer0v09Z2vn0AykHjiuKoAvdFl6rUPv+eeAUx1kkFTQMI/MZBleEKSTKoakEWBZc WRpE7epu6uFMgu1urh9ZHM2zVTyFA8m0y+UVGgrk7y8rg9QqS698kAzlu8JF3WbXcV5q AGhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718896957; x=1719501757; 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=ZQ8CEbgFXQ50Jx+/zMrlpDCus+bU22jqqVwm5sZfxvc=; b=aX8Ogj4VUdPP+PB/m7GkaOvtt8q4vBey5l22sRYE9RCbc+j/bHDMc15enMG8vOYeK5 DK3jzI58h2sQdYHE5AyiWPadC+15EqT/tcykGYBymAuaUg6hOZcCvYUaxYRYJ+BwzvAL 6fd6TPaJMDcnEq6y6Bc/lMsmecUOAtnd/xNoHWl6Ci4hosZNZ+0vTedhNZfFiecgTZTN UJTaA4qbxjI+y1O1meMOR9nbmFEnpipfnPV1I0XVckFgqsMnTMCiOLV86rN9/FWbZiIU xqhjBRDLbQsLH52BGWsT3gS/iwTHvxFGJkhvZPHn+3FQshkNw8+PieQH+OhhqP0tY1U3 7HZw== X-Gm-Message-State: AOJu0YyOzbB/+Q9UBDURMXIuBJuscHLHL5mW+9zzwNYCFc2wx2rXhF3B 6fS3ZSYuog7wV/4/n7mt3MqLCKR3Sf49QlC5BgqRNjdTm/ZkSDYo4G0bCU4hXtk= X-Received: by 2002:a17:907:a092:b0:a6f:4ae3:5327 with SMTP id a640c23a62f3a-a6fab609e5dmr478736466b.15.1718896956518; Thu, 20 Jun 2024 08:22:36 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56ed3590sm782032166b.98.2024.06.20.08.22.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 08:22:29 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id E6E735FA08; Thu, 20 Jun 2024 16:22:21 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Peter Maydell , kvm@vger.kernel.org, qemu-ppc@nongnu.org, Christian Borntraeger , Paolo Bonzini , Jamie Iles , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier , Mark Burton , Daniel Henrique Barboza , qemu-arm@nongnu.org, Laurent Vivier , Alexander Graf , Ilya Leoshkevich , Richard Henderson , Marco Liebel , Halil Pasic , Thomas Huth , qemu-s390x@nongnu.org, Cameron Esfahani , Alexandre Iooss , Nicholas Piggin , Roman Bolshakov , "Dr. David Alan Gilbert" , Marcelo Tosatti , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH v2 09/12] plugins: add migration blocker Date: Thu, 20 Jun 2024 16:22:17 +0100 Message-Id: <20240620152220.2192768-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240620152220.2192768-1-alex.bennee@linaro.org> References: <20240620152220.2192768-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x634.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=unavailable 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 If the plugin in controlling time there is some state that might be missing from the plugin tracking it. Migration is unlikely to work in this case so lets put a migration blocker in to let the user know if they try. Signed-off-by: Alex Bennée Suggested-by: "Dr. David Alan Gilbert" Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Reviewed-by: Alwalid Salama --- plugins/api.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/api.c b/plugins/api.c index 4431a0ea7e..c4239153af 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -47,6 +47,8 @@ #include "disas/disas.h" #include "plugin.h" #ifndef CONFIG_USER_ONLY +#include "qapi/error.h" +#include "migration/blocker.h" #include "exec/ram_addr.h" #include "qemu/plugin-memory.h" #include "hw/boards.h" @@ -589,11 +591,17 @@ uint64_t qemu_plugin_u64_sum(qemu_plugin_u64 entry) * Time control */ static bool has_control; +Error *migration_blocker; const void *qemu_plugin_request_time_control(void) { if (!has_control) { has_control = true; +#ifdef CONFIG_SOFTMMU + error_setg(&migration_blocker, + "TCG plugin time control does not support migration"); + migrate_add_blocker(&migration_blocker, NULL); +#endif return &has_control; } return NULL;