From nobody Tue Oct 22 22:18:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1729613271; cv=none; d=zohomail.com; s=zohoarc; b=JybyXwp9PavdXiUqXLZmIxhFCih/Mqag+9DpgbCdbrLxupWrFu7WXOqlMLnt4KQ160fkTl/kkEKOUbY6CjSiybU8OPyWa/dtKZbb4ja9WRCDQgTcHUNYMP9Oi6jO4UnucZLULWbhIY0S7qIH7WnXuremromU3A10YK3SQ3QPbLQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729613271; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RpHqTPG9MnhZBW1ja6qou5cPaboyQUJVUHc5xgQ+NH0=; b=Ct0NtfObPDymiYNgvpbramR/VnCrTNYnqSUp6uQQZbPkI4diuwD4JMs1+N8DalQ3mbdyr9J5AkvsciyScqUXGVVZGK/SEVZt2rBjZHi0dtG4Zq0aKZ4nK4hM+VF0PeYowfywXX2GQx8gRKttQyCHEm0tv06FWWxFc0JVD25eyF0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1729613271718492.50276348027216; Tue, 22 Oct 2024 09:07:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3HPw-0000Dg-H9; Tue, 22 Oct 2024 12:07:32 -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 1t3HPt-0000Cl-WE for qemu-devel@nongnu.org; Tue, 22 Oct 2024 12:07:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3HPq-0001Uc-PN for qemu-devel@nongnu.org; Tue, 22 Oct 2024 12:07:28 -0400 Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-258-kSh5eqzSNsSSRTAKgDB0FA-1; Tue, 22 Oct 2024 12:07:24 -0400 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-6cbe4cb4252so24448666d6.2 for ; Tue, 22 Oct 2024 09:07:24 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-114-190.cpe.net.cable.rogers.com. [99.254.114.190]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ce008fb113sm30224026d6.34.2024.10.22.09.07.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 09:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729613245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RpHqTPG9MnhZBW1ja6qou5cPaboyQUJVUHc5xgQ+NH0=; b=K+C4bPF75RVWVjd0GIh6nrxg50Xu5uMI4ikisNeeOX6fa/boyNX3Lqxb7dmwa8PXCv9RG8 RbkxjWYVN+XM2fySseS3UhbPKOrSz/ac5Bw+pOfjl/+VrouSst+IUwdfA7iIXul6jkmFUG 3NeDqDC/hoNEBrwqDiQ6KdOrEAQLpDc= X-MC-Unique: kSh5eqzSNsSSRTAKgDB0FA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729613244; x=1730218044; 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=RpHqTPG9MnhZBW1ja6qou5cPaboyQUJVUHc5xgQ+NH0=; b=ESTQy7nBVIKCDbjOA3GzlXWPtQEvFTewlJbgE6qChpgHKIRfxntGSzSOr1HD3c/ndV J5Wdrr/GjZN6maThj3poV+3PyV+uhrXGG5yDKQxxUcbNrPmse4yxQgubQFCFEkfr1EbV ZlEJ+4DHQZJ1j9TtDUEGByezCo04s/B2xYi3W9H8S50MtbI3/uQgvaWzwsPWLRWlUVNv riEqXxsV9f7suy92xn6d29UCMmekvPiSwVJcmfCc+KFqnHLjKcLd30nf0Co7mHZFKQ1b nvA5qLw2UwGiOJB4btC0DEY0xnVn7gB8pRgMs7gEaMSIlxYD2dpF7RsznzNnH5VKHGwA C6uw== X-Gm-Message-State: AOJu0Yywr/M4Aw7dUfHUssjZ/XSj9yz5A0UJxkn8xEiZHTNQgh9dSHx7 upfo6+pM+m9b95PQmzBWK8BbtotP9jeryazqsN37abOoa48IZAG11hkUoTKC9/NAaTaHYVq7sqQ b7+RB7KRUQlud3f651FkY6t9tkivglPcYJ8Rx00Q6TDzcm/xQdumPh4Vnl+MU0EEuQ77VMHutJs uhh0CghVwJ3htdFXRYDa0ja/5cEFfOTVF/MA== X-Received: by 2002:a05:6214:5d83:b0:6cb:8a6a:25cb with SMTP id 6a1803df08f44-6cde1633993mr211256296d6.43.1729613243811; Tue, 22 Oct 2024 09:07:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEgmT7QRglNeSRLHfyuDZvscafMWNAMFpr1aOX1TivfSKWSzZYemsMmX42RLMTz/TjJaXvmtA== X-Received: by 2002:a05:6214:5d83:b0:6cb:8a6a:25cb with SMTP id 6a1803df08f44-6cde1633993mr211255776d6.43.1729613243074; Tue, 22 Oct 2024 09:07:23 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Avihai Horon , Alex Williamson , Fabiano Rosas , peterx@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , "Dr . David Alan Gilbert" Subject: [PATCH 1/2] migration: Make all helpers in misc.h safe to use without migration Date: Tue, 22 Oct 2024 12:07:19 -0400 Message-ID: <20241022160720.1013543-2-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241022160720.1013543-1-peterx@redhat.com> References: <20241022160720.1013543-1-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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, DKIMWL_WL_HIGH=-0.519, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1729613273385116600 Migration object can be freed before some other device codes run, while we do have a bunch of migration helpers exported in migration/misc.h that logically can be invoked at any time of QEMU, even during destruction of a VM. Make all these functions safe to be called, especially, not crashing after the migration object is freed. Add a rich comment in the header explaining how to guarantee thread safe on using these functions, and we choose BQL because fundamentally that's how it's working now. We can move to other things (e.g. RCU) whenever necessary in the future but it's an overkill if we have BQL anyway in most/all existing callers. When at it, update some comments, e.g. migrate_announce_params() is exported from options.c now. Cc: C=C3=A9dric Le Goater Cc: Avihai Horon Cc: Fabiano Rosas Cc: Dr. David Alan Gilbert Signed-off-by: Peter Xu Reviewed-by: C=C3=A9dric Le Goater --- include/migration/misc.h | 33 ++++++++++++++++++++++++++++----- migration/migration.c | 22 +++++++++++++++++++++- 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index bfadc5613b..8d6812b8c7 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -19,8 +19,26 @@ #include "qapi/qapi-types-net.h" #include "migration/client-options.h" =20 -/* migration/ram.c */ +/* + * Misc migration functions exported to be used in QEMU generic system + * code outside migration/. + * + * By default, BQL is required to use below functions to avoid race + * conditions (e.g. concurrent free of the migration object). It's + * caller's responsibility to make sure it's thread safe otherwise when + * below helpers are used without BQL held. + * + * One example of the special case is migration_thread(), who will take a + * refcount of the migration object. The refcount will make sure the + * migration object will not be freed concurrently when accessing through + * below helpers. + * + * When unsure, always take BQL first before using the helpers. + */ =20 +/* + * migration/ram.c + */ typedef enum PrecopyNotifyReason { PRECOPY_NOTIFY_SETUP =3D 0, PRECOPY_NOTIFY_BEFORE_BITMAP_SYNC =3D 1, @@ -43,14 +61,19 @@ void ram_mig_init(void); void qemu_guest_free_page_hint(void *addr, size_t len); bool migrate_ram_is_ignored(RAMBlock *block); =20 -/* migration/block.c */ - +/* + * migration/options.c + */ AnnounceParameters *migrate_announce_params(void); -/* migration/savevm.c */ =20 +/* + * migration/savevm.c + */ void dump_vmstate_json_to_file(FILE *out_fp); =20 -/* migration/migration.c */ +/* + * migration/migration.c + */ void migration_object_init(void); void migration_shutdown(void); bool migration_is_idle(void); diff --git a/migration/migration.c b/migration/migration.c index bcb735869b..27341eed50 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1121,6 +1121,10 @@ bool migration_is_setup_or_active(void) { MigrationState *s =3D current_migration; =20 + if (!s) { + return false; + } + switch (s->state) { case MIGRATION_STATUS_ACTIVE: case MIGRATION_STATUS_POSTCOPY_ACTIVE: @@ -1136,7 +1140,6 @@ bool migration_is_setup_or_active(void) =20 default: return false; - } } =20 @@ -1685,6 +1688,10 @@ bool migration_is_active(void) { MigrationState *s =3D current_migration; =20 + if (!s) { + return false; + } + return (s->state =3D=3D MIGRATION_STATUS_ACTIVE || s->state =3D=3D MIGRATION_STATUS_POSTCOPY_ACTIVE); } @@ -1693,6 +1700,10 @@ bool migration_is_device(void) { MigrationState *s =3D current_migration; =20 + if (!s) { + return false; + } + return s->state =3D=3D MIGRATION_STATUS_DEVICE; } =20 @@ -1700,6 +1711,11 @@ bool migration_thread_is_self(void) { MigrationState *s =3D current_migration; =20 + /* If no migration object, must not be the migration thread */ + if (!s) { + return false; + } + return qemu_thread_is_self(&s->thread); } =20 @@ -3077,6 +3093,10 @@ void migration_file_set_error(int ret, Error *err) { MigrationState *s =3D current_migration; =20 + if (!s) { + return; + } + WITH_QEMU_LOCK_GUARD(&s->qemu_file_lock) { if (s->to_dst_file) { qemu_file_set_error_obj(s->to_dst_file, ret, err); --=20 2.45.0 From nobody Tue Oct 22 22:18:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1729613284; cv=none; d=zohomail.com; s=zohoarc; b=K+NWzRRV5gGVgG67p1wO7jKYHmG6uaYw4LHSCbLKAmCA3YBblpQTe8/pc/nxQ4jJc9aZqF/CthyP6/13RmyEs3ok9vR7e67xRvgXx5qV+Q7b3ed/uNuCAOrZg3ISYfM4hO/JgSizAVMmkC45yuKwxDCXz7dD7gIPOx+ohQUJGYw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729613284; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gnA2LcxAbTKhpziQJQ5f+Q6+OsbjhtmFmnKtEJ+wng4=; b=TKvhpMgFhmxAU1ctU/oa+c7qKtdG0dR8pt0aFOGWINbkPOuX7U+9R4arY+Na9OIz49cGVUfuRxkbjx+66mFmslWzmeU27cVp4oQ6bQx6T93CSL76FufKDNRBsDe6KaUGgBOxrygcAXiBtLNctKbVuHXmZesKzbtzTZtxF1GHg1M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1729613284133883.9853419287327; Tue, 22 Oct 2024 09:08:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3HQ1-0000Ec-Gq; Tue, 22 Oct 2024 12:07:37 -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 1t3HPy-0000Dz-4d for qemu-devel@nongnu.org; Tue, 22 Oct 2024 12:07:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3HPw-0001Uz-KH for qemu-devel@nongnu.org; Tue, 22 Oct 2024 12:07:33 -0400 Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-505-Urn-bavANYq_PG6FX5CvaA-1; Tue, 22 Oct 2024 12:07:25 -0400 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-6cbf59c1b3cso80503286d6.2 for ; Tue, 22 Oct 2024 09:07:25 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-114-190.cpe.net.cable.rogers.com. [99.254.114.190]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ce008fb113sm30224026d6.34.2024.10.22.09.07.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 09:07:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729613251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gnA2LcxAbTKhpziQJQ5f+Q6+OsbjhtmFmnKtEJ+wng4=; b=GTE0CaqW8urvhtRiUqaXoJDjFkgSDQcubNMMrzn9PMYWpYzkbwsmUJcBD7yaZgkANp6xjw EjsUb0eXmhzrAMlxj+jayBphE9Rl7ToO8Q7zRtUs2OiWFy4NZFIUNDHgnZcrwS2yQsJtvQ QZCnmHwcMEGRRCXFwGLM+DyBdraIXb8= X-MC-Unique: Urn-bavANYq_PG6FX5CvaA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729613244; x=1730218044; 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=gnA2LcxAbTKhpziQJQ5f+Q6+OsbjhtmFmnKtEJ+wng4=; b=LPA2BnJbaR0DlY9eMSuIaN98BWAcWyYYjVSLEtNA6I6/JaMvJFxEqDJJ3idwLXq/Ws cpKywjneMtHKXZ75pngSrczRTR/pieex4OyE5nlFCeUUTMT8jj+zguz9YnMXn6thC+CD NqwhmCxveysiY7hvujDIihvBZN5PkL+AcX4PARsTq0IH1FRh6zo5U4aHG7uF1W7l342d AkLJ5aRcjUarnqlyGn6+o/Zj4otZbGgqAos2wTFkTRe4eR7N5S+yy2lgDjjFBE397zM4 WNwzIBFhvKotTyumIHb89l3y6v0LDkiTGaG+Y3jEBTY6O3w9JVBZu+SrW0grGwtD8F9f GxgQ== X-Gm-Message-State: AOJu0YxoWmouQMMrNFvr1mkL/oRpCJ3mS80Y/bWJ1jjvju8MLFm7lhSE ZhuQa2vPAfPgLm8fPx2D66VyfodXR+oubt4wIUWUNehHzgSeVrKekrLozUNIUdeYFWssVHLGTFd Y9td5Rfn/UDPTwaX8kX7YY+ERo0zUruHewJ2l+phEzNnoddGhMe5WUCB9RAPqupHHBucpNxvg3R /zi+6PNSsnE2CckBTOHPxxOV1d03CmlstLDQ== X-Received: by 2002:ad4:536c:0:b0:6ce:2426:473 with SMTP id 6a1803df08f44-6ce242605f7mr23759396d6.52.1729613244714; Tue, 22 Oct 2024 09:07:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGEBTSi4QnnARNYPqmvbVNIbXAGrFWzcqE1csc0fMCTqsvHJ6fOHpVcsWSpFPOzT+njoHfGJg== X-Received: by 2002:ad4:536c:0:b0:6ce:2426:473 with SMTP id 6a1803df08f44-6ce242605f7mr23758916d6.52.1729613244164; Tue, 22 Oct 2024 09:07:24 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Avihai Horon , Alex Williamson , Fabiano Rosas , peterx@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH 2/2] migration: Unexport dirty_bitmap_mig_init() in misc.h Date: Tue, 22 Oct 2024 12:07:20 -0400 Message-ID: <20241022160720.1013543-3-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241022160720.1013543-1-peterx@redhat.com> References: <20241022160720.1013543-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.519, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1.697, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1729613285343116600 Content-Type: text/plain; charset="utf-8" It's only used within migration/, so it shouldn't be exported. Signed-off-by: Peter Xu Reviewed-by: C=C3=A9dric Le Goater --- include/migration/misc.h | 3 --- migration/migration.h | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index 8d6812b8c7..e0e88b1c0c 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -131,7 +131,4 @@ bool migration_incoming_postcopy_advised(void); /* True if background snapshot is active */ bool migration_in_bg_snapshot(void); =20 -/* migration/block-dirty-bitmap.c */ -void dirty_bitmap_mig_init(void); - #endif diff --git a/migration/migration.h b/migration/migration.h index 7dc59c5e8d..0956e9274b 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -552,4 +552,8 @@ int migration_rp_wait(MigrationState *s); void migration_rp_kick(MigrationState *s); =20 void migration_bitmap_sync_precopy(bool last_stage); + +/* migration/block-dirty-bitmap.c */ +void dirty_bitmap_mig_init(void); + #endif --=20 2.45.0