Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA754606A31E for ; Thu, 26 Nov 2026 23:17:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Su5DJC7w; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=pyHbIOF1 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xWii5-0008IE-Go; Thu, 26 Nov 2026 18:17:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xWihz-0008Cg-U4 for qemu-devel@nongnu.org; Thu, 26 Nov 2026 18:16:56 -0500 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 1xWihy-00064t-B8 for qemu-devel@nongnu.org; Thu, 26 Nov 2026 18:16:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795735013; 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=TEp351wB5GQySx79Zc08YPzzjN27Sn3CHKUChdROs60=; b=Su5DJC7wonJSuS5TPVAPhiAl+QYpO+z6gLUc5g/zv/VZGOiM5Gk8o/Gaq6lrqfSKvqOhDu vHEv2BpeqgnDANRC3844Dh/0A058rr0uoeC+0bonpBJmRJH1egzRh5S3LSK/5XMm8s3LFn goEqWcCb+OXwuBZ9IxmU0bybr7jNLwE= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-395-7ywXZxCeN32fp6kOYojRsg-1; Thu, 26 Nov 2026 23:16:51 +0000 X-MC-Unique: 7ywXZxCeN32fp6kOYojRsg-1 X-Mimecast-MFC-AGG-ID: 7ywXZxCeN32fp6kOYojRsg_1795735011 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-537548d4bc0so169118861cf.2 for ; Thu, 26 Nov 2026 15:16:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1795735011; x=1796339811; 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:content-type; bh=TEp351wB5GQySx79Zc08YPzzjN27Sn3CHKUChdROs60=; b=pyHbIOF1tu5Tqkq6lMmJTtLqp3PzahwdO087ck8gC6C5GgpUFo0YqhoAMVn737JHLN WEZrsSfCZlJ20yNMB4JhzX0Qi/nygweijzTEUpTZlqJL/nDjgge5ClN9+9gn/Eq/EN5V o5xA+I5LHM9WpvH7zSpimfprj0+xqVIoSUqr3MMBVH3xi79fMpk9ofc/rZV6a9fQMVk2 lNj1OkQBB7NzWzQsrq0vFasC8nDwdxqIYaPc9cZNQDhFQbJD+kRaVqUwb0Tde8mAfklo hC1unYkGTNnZ2AJfD7xNxWwuIcOp/VrJNqOTvb2EGIlOS+/Ivh+WI9rbOhhOhrIWgwgq 5wEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795735011; x=1796339811; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:re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X-Received: by 2002:a05:622a:412:b0:55c:9b4f:f362 with SMTP id d75a77b69052e-55d76a5af9dmr409044721cf.34.1795735010926; Thu, 26 Nov 2026 15:16:50 -0800 (PST) X-Received: by 2002:a05:622a:412:b0:55c:9b4f:f362 with SMTP id d75a77b69052e-55d76a5af9dmr409044341cf.34.1795735010315; Thu, 26 Nov 2026 15:16:50 -0800 (PST) Received: from localhost ([142.188.212.246]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-55d7889ea4csm193940131cf.26.2026.11.26.15.16.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2026 15:16:49 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Cc: Juraj Marcin , Peter Maydell , peterx@redhat.com, Fabiano Rosas , Gavin Shan Subject: [PATCH for-12.0 v2 9/9] migration: Drop VMSTATE_VALIDATE() and VMS_MUST_EXIST Date: Thu, 26 Nov 2026 18:16:31 -0500 Message-ID: <20261126231631.3392756-10-peterx@redhat.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261126231631.3392756-1-peterx@redhat.com> References: <20261126231631.3392756-1-peterx@redhat.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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: qemu development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 We have moved all users to other API, now they're never used. Signed-off-by: Peter Xu --- include/migration/vmstate.h | 11 ----------- migration/savevm.c | 5 ----- migration/vmstate.c | 12 ------------ 3 files changed, 28 deletions(-) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 2901877308..de7a957140 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -130,10 +130,6 @@ enum VMStateFlags { * allocated. Only valid in combination with VMS_VBUFFER. */ VMS_MULTIPLY = 0x200, - /* Fail loading the serialised VM state if this field is missing - * from the input. */ - VMS_MUST_EXIST = 0x1000, - /* When loading serialised VM state, allocate memory for the * (entire) field. Only valid in combination with * VMS_POINTER. Note: Not all combinations with other flags are @@ -458,13 +454,6 @@ extern const VMStateInfo vmstate_info_g_byte_array; .offset = vmstate_offset_value(_state, _field, _type), \ } -/* Validate state using a boolean predicate. */ -#define VMSTATE_VALIDATE(_name, _test) { \ - .name = (_name), \ - .field_exists = (_test), \ - .flags = VMS_MUST_EXIST | VMS_NO_STATE, \ -} - #define VMSTATE_POINTER(_field, _state, _version, _info, _type) { \ .name = (stringify(_field)), \ .version_id = (_version), \ diff --git a/migration/savevm.c b/migration/savevm.c index fe94ba96e4..e4f614cc86 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -622,11 +622,6 @@ static void dump_vmstate_vmsd(FILE *out_file, fprintf(out_file, ",\n%*s\"Fields\": [\n", indent, ""); first = true; while (field->name != NULL) { - if (field->flags & VMS_MUST_EXIST) { - /* Ignore VMSTATE_VALIDATE bits; these don't get migrated */ - field++; - continue; - } if (!first) { fprintf(out_file, ",\n"); } diff --git a/migration/vmstate.c b/migration/vmstate.c index 24004565bf..7734caab06 100644 --- a/migration/vmstate.c +++ b/migration/vmstate.c @@ -116,8 +116,6 @@ static uint64_t vmstate_n_elems(void *opaque, const VMStateField *field) n_elems = field->num; } else if (field->flags & VMS_VARRAY) { n_elems = vmstate_read_from_offset(&field->num_indirect, opaque); - } else if (field->flags & VMS_MUST_EXIST && field->flags & VMS_NO_STATE) { - n_elems = 0; } else { n_elems = 1; } @@ -430,10 +428,6 @@ bool vmstate_load_vmsd(QEMUFile *f, const VMStateDescription *vmsd, return false; } } - } else if (field->flags & VMS_MUST_EXIST) { - error_setg(errp, "Input validation failed: %s/%s version_id: %d", - vmsd->name, field->name, vmsd->version_id); - return false; } field++; } @@ -810,12 +804,6 @@ static bool vmstate_save_vmsd_v(QEMUFile *f, const VMStateDescription *vmsd, vmdesc_loop = NULL; } } - } else { - if (field->flags & VMS_MUST_EXIST) { - error_report("Output state validation failed: %s/%s", - vmsd->name, field->name); - assert(!(field->flags & VMS_MUST_EXIST)); - } } field++; } -- 2.56.0