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: 1950226 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=qyTwHgqY; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4kls4HXlz20KL for ; Fri, 21 Jun 2024 01:23:37 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKJcZ-00063m-9W; 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-0005zd-HA for qemu-ppc@nongnu.org; Thu, 20 Jun 2024 11:22:41 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sKJcU-00081L-AH for qemu-ppc@nongnu.org; Thu, 20 Jun 2024 11:22:41 -0400 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a6f1da33826so130644366b.0 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=HtCf1ImS0inUfEPeTKpN/65IUzCbssFs7HU5SmVLF6E/oJ/Y6bvFUxKylydfD4AwFG tBuHi8E9UQb137gJZ2Tnze0nP07b/XRMbuu61gvNICDPcE3DAF6GSJk1A1HQ634KVcuX GRqOfL+XSDOopyNZ2RQoCIbDL9lBZcZVuO0vs/08U9wsOriDurMy1S2HstATfrh8+gXs Gpk/+GvExRzUZ7P6uYbclaJPUMltgTF5Iy9xbvQPMmNUdiW0mQu+gW/plNGQeJKIbhkQ nN4tFRjUXLX7W9AUlOtfcCI+l+Qn1HEd0QklsZkNPh+NDcrdywiHq8ivTbETwa/gVbr2 xFvg== X-Forwarded-Encrypted: i=1; AJvYcCUNbNici7kS6u92PRiVK1DA7ge+ctzodkrAdrwjj+K/vxEoY7oD8h2Zsb6STkodKYQTTX999rOQ34TEKftJmk1UDm13 X-Gm-Message-State: AOJu0YzJTwOdgPJEoywm8FqWgCea30igIuG7hK5xI9JuKvDsZxiSnew2 Te85bdERsK+tDQuJLvaKsm9ngXFnAuCAD0YgwRHLXAV4Eds6jN8BK7P0QZAHC38= X-Google-Smtp-Source: AGHT+IH9ydE3ImEmECu/jTqHbMKjkbdYKCQBP9DWZg1r82biwaNCpjgKg3b6KL1DuAkpxGXNwAJwVg== 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::630; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x630.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.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: 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;