From nobody Sat Sep 26 19:12:10 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1790350911; cv=none; d=zohomail.com; s=zohoarc; b=If85pzZhscHxaG70LjRWB+4W1+Zoj63LzJA8rr7FvGILkdE8enNiN2TrRCJuqkZCGVC2wziKCoUIyJ8+gmb081OQP58E/ilRh84jyO09+pkE8Sg6FLAb6TZZCh5cxd0BjqWyAVnjkoNFw86FxzNhzetlRLly8R7JvFnIzwmt7xg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790350911; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0PvDJtK0Au5m6THwZSUrV3hnLp8mzvhlIr0lT/cf6R4=; b=EoqoFZ5Tzcuz1nlLVgAjAlUiylgM7STUGEPKubvP+2I0i58m54p7gU2PxqaYID7k8nNQYnYDqDCuzBaIXZmBkTxSXXfWmbG0GnlAMl2GJBpq1C3YSgxQYGLBs1tgVrGdiM7lQYVUqvGOUK6R9vNQb3CC92vxlPNEwYqRgIIPYAw= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790350911438554.6620308039357; Fri, 25 Sep 2026 08:41:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA82I-0006fQ-6p; Fri, 25 Sep 2026 11:40:30 -0400 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 1xA82G-0006ej-0R for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:28 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xA82D-0004at-JQ for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:27 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 0BA781FF56; Fri, 25 Sep 2026 15:40:16 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 9C806132DD; Fri, 25 Sep 2026 15:40:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xxRgCd2VtmqjOwAAD6G6ig:T2 (envelope-from ); Fri, 25 Sep 2026 15:40:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350820; h=from:from:reply-to: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=0PvDJtK0Au5m6THwZSUrV3hnLp8mzvhlIr0lT/cf6R4=; b=Ha8VQP5vJJmCzufYZaKSJIUrvi2P25jHMAT6IhZ9K3pfB8/DArsvZtzJaBEQmDZjB97xKX +ISbvBei61rM1vAeuw7j3UgHf8DVHdoovZhA1m8UDSPe7SC6Q8gSHZKXIBBWeuWL9VHgwz 7Uiw3wSuOFc9C3AiuaUXs4ypkyiQQEM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350820; h=from:from:reply-to: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=0PvDJtK0Au5m6THwZSUrV3hnLp8mzvhlIr0lT/cf6R4=; b=iA1K5Q5e+1QiMBJLA1vduywOFMTa260meq+YykZnTS2T2r56xX/zWEHAGzL5cW2WhRffsh ks4QXHYvm1uciNBg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350816; h=from:from:reply-to: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=0PvDJtK0Au5m6THwZSUrV3hnLp8mzvhlIr0lT/cf6R4=; b=OMYxi1T5N14d+NHH+6NthREWfv09OyjCNKWJUOV6DMwArEfYg7aDafriQHAfX70VNYIqCo BqUYt/pcPi2vqXyEGtsJNknVub3UTEEyAShwqhqGmytoPgsO62TwOFv7a6q0gc2se85tPn JZa7rnr7dPgbnepj092/n3gD3L9keas= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350816; h=from:from:reply-to: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=0PvDJtK0Au5m6THwZSUrV3hnLp8mzvhlIr0lT/cf6R4=; b=GJ8iAmBh5LWaAJw6GMbwsO3CquM9KAFDvX7FNDIqfeXt+tyUEhTxYPyzg98d9Smv7UOJLr yJHN9Bu/fhaEglBA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Vladimir Sementsov-Ogievskiy , Akihiko Odaki Subject: [PULL 01/19] tests/unit/test-vmstate: move to new migration APIs Date: Fri, 25 Sep 2026 12:39:52 -0300 Message-ID: <20260925154010.599247-2-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260925154010.599247-1-farosas@suse.de> References: <20260925154010.599247-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.997]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] 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=lists1p.gnu.org; Received-SPF: pass client-ip=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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: qemu development 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 @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1790350913281158500 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Akihiko Odaki Reviewed-by: Fabiano Rosas Signed-off-by: Fabiano Rosas --- tests/unit/test-vmstate.c | 118 ++++++++++---------------------------- 1 file changed, 30 insertions(+), 88 deletions(-) diff --git a/tests/unit/test-vmstate.c b/tests/unit/test-vmstate.c index df1fb4c778..23f3173070 100644 --- a/tests/unit/test-vmstate.c +++ b/tests/unit/test-vmstate.c @@ -67,14 +67,9 @@ static QEMUFile *open_test_file(bool write) static void save_vmstate(const VMStateDescription *desc, void *obj) { QEMUFile *f =3D open_test_file(true); - Error *local_err =3D NULL; =20 /* Save file with vmstate */ - int ret =3D vmstate_save_state(f, desc, obj, NULL, &local_err); - if (ret) { - error_report_err(local_err); - } - g_assert(!ret); + vmstate_save_vmsd(f, desc, obj, NULL, &error_abort); qemu_put_byte(f, QEMU_VM_EOF); g_assert(!qemu_file_get_error(f)); qemu_fclose(f); @@ -112,7 +107,6 @@ static int load_vmstate_one(const VMStateDescription *d= esc, void *obj, int version, const uint8_t *wire, size_t size) { QEMUFile *f; - int ret; Error *local_err =3D NULL; =20 f =3D open_test_file(true); @@ -120,15 +114,16 @@ static int load_vmstate_one(const VMStateDescription = *desc, void *obj, qemu_fclose(f); =20 f =3D open_test_file(false); - ret =3D vmstate_load_state(f, desc, obj, version, &local_err); - if (ret) { + if (!vmstate_load_vmsd(f, desc, obj, version, &local_err)) { error_report_err(local_err); g_assert(qemu_file_get_error(f)); - } else{ - g_assert(!qemu_file_get_error(f)); + qemu_fclose(f); + return -EINVAL; } + + g_assert(!qemu_file_get_error(f)); qemu_fclose(f); - return ret; + return 0; } =20 =20 @@ -362,8 +357,6 @@ static const VMStateDescription vmstate_versioned =3D { =20 static void test_load_v1(void) { - Error *local_err =3D NULL; - int ret; uint8_t buf[] =3D { 0, 0, 0, 10, /* a */ 0, 0, 0, 30, /* c */ @@ -374,10 +367,7 @@ static void test_load_v1(void) =20 QEMUFile *loading =3D open_test_file(false); TestStruct obj =3D { .b =3D 200, .e =3D 500, .f =3D 600 }; - ret =3D vmstate_load_state(loading, &vmstate_versioned, &obj, 1, &loca= l_err); - if (ret < 0) { - error_report_err(local_err); - } + vmstate_load_vmsd(loading, &vmstate_versioned, &obj, 1, &error_abort); g_assert(!qemu_file_get_error(loading)); g_assert_cmpint(obj.a, =3D=3D, 10); g_assert_cmpint(obj.b, =3D=3D, 200); @@ -390,8 +380,6 @@ static void test_load_v1(void) =20 static void test_load_v2(void) { - Error *local_err =3D NULL; - int ret; uint8_t buf[] =3D { 0, 0, 0, 10, /* a */ 0, 0, 0, 20, /* b */ @@ -405,10 +393,7 @@ static void test_load_v2(void) =20 QEMUFile *loading =3D open_test_file(false); TestStruct obj; - ret =3D vmstate_load_state(loading, &vmstate_versioned, &obj, 2, &loca= l_err); - if (ret < 0) { - error_report_err(local_err); - } + vmstate_load_vmsd(loading, &vmstate_versioned, &obj, 2, &error_abort); g_assert_cmpint(obj.a, =3D=3D, 10); g_assert_cmpint(obj.b, =3D=3D, 20); g_assert_cmpint(obj.c, =3D=3D, 30); @@ -442,16 +427,10 @@ static const VMStateDescription vmstate_skipping =3D { =20 static void test_save_noskip(void) { - Error *local_err =3D NULL; QEMUFile *fsave =3D open_test_file(true); TestStruct obj =3D { .a =3D 1, .b =3D 2, .c =3D 3, .d =3D 4, .e =3D 5,= .f =3D 6, .skip_c_e =3D false }; - int ret =3D vmstate_save_state(fsave, &vmstate_skipping, &obj, NULL, - &local_err); - if (ret) { - error_report_err(local_err); - } - g_assert(!ret); + vmstate_save_vmsd(fsave, &vmstate_skipping, &obj, NULL, &error_abort); g_assert(!qemu_file_get_error(fsave)); =20 uint8_t expected[] =3D { @@ -469,16 +448,10 @@ static void test_save_noskip(void) =20 static void test_save_skip(void) { - Error *local_err =3D NULL; QEMUFile *fsave =3D open_test_file(true); TestStruct obj =3D { .a =3D 1, .b =3D 2, .c =3D 3, .d =3D 4, .e =3D 5,= .f =3D 6, .skip_c_e =3D true }; - int ret =3D vmstate_save_state(fsave, &vmstate_skipping, &obj, NULL, - &local_err); - if (ret) { - error_report_err(local_err); - } - g_assert(!ret); + vmstate_save_vmsd(fsave, &vmstate_skipping, &obj, NULL, &error_abort); g_assert(!qemu_file_get_error(fsave)); =20 uint8_t expected[] =3D { @@ -494,8 +467,6 @@ static void test_save_skip(void) =20 static void test_load_noskip(void) { - Error *local_err =3D NULL; - int ret; uint8_t buf[] =3D { 0, 0, 0, 10, /* a */ 0, 0, 0, 20, /* b */ @@ -509,10 +480,7 @@ static void test_load_noskip(void) =20 QEMUFile *loading =3D open_test_file(false); TestStruct obj =3D { .skip_c_e =3D false }; - ret =3D vmstate_load_state(loading, &vmstate_skipping, &obj, 2, &local= _err); - if (ret < 0) { - error_report_err(local_err); - } + vmstate_load_vmsd(loading, &vmstate_skipping, &obj, 2, &error_abort); g_assert(!qemu_file_get_error(loading)); g_assert_cmpint(obj.a, =3D=3D, 10); g_assert_cmpint(obj.b, =3D=3D, 20); @@ -525,8 +493,6 @@ static void test_load_noskip(void) =20 static void test_load_skip(void) { - Error *local_err =3D NULL; - int ret; uint8_t buf[] =3D { 0, 0, 0, 10, /* a */ 0, 0, 0, 20, /* b */ @@ -538,10 +504,7 @@ static void test_load_skip(void) =20 QEMUFile *loading =3D open_test_file(false); TestStruct obj =3D { .skip_c_e =3D true, .c =3D 300, .e =3D 500 }; - ret =3D vmstate_load_state(loading, &vmstate_skipping, &obj, 2, &local= _err); - if (ret < 0) { - error_report_err(local_err); - } + vmstate_load_vmsd(loading, &vmstate_skipping, &obj, 2, &error_abort); g_assert(!qemu_file_get_error(loading)); g_assert_cmpint(obj.a, =3D=3D, 10); g_assert_cmpint(obj.b, =3D=3D, 20); @@ -863,8 +826,6 @@ static void test_save_q(void) =20 static void test_load_q(void) { - int ret; - Error *local_err =3D NULL; TestQtailq obj_q =3D { .i16 =3D -512, .i32 =3D 70000, @@ -894,10 +855,7 @@ static void test_load_q(void) TestQtailq tgt; =20 QTAILQ_INIT(&tgt.q); - ret =3D vmstate_load_state(fload, &vmstate_q, &tgt, 1, &local_err); - if (ret < 0) { - error_report_err(local_err); - } + vmstate_load_vmsd(fload, &vmstate_q, &tgt, 1, &error_abort); char eof =3D qemu_get_byte(fload); g_assert(!qemu_file_get_error(fload)); g_assert_cmpint(tgt.i16, =3D=3D, obj_q.i16); @@ -1015,29 +973,29 @@ static void destroy_domain(gpointer data) g_free(domain); } =20 -static int domain_preload(void *opaque) +static bool domain_preload(void *opaque, Error **errp) { TestGTreeDomain *domain =3D opaque; =20 domain->mappings =3D g_tree_new_full((GCompareDataFunc)interval_cmp, NULL, g_free, g_free); - return 0; + return true; } =20 -static int iommu_preload(void *opaque) +static bool iommu_preload(void *opaque, Error **errp) { TestGTreeIOMMU *iommu =3D opaque; =20 iommu->domains =3D g_tree_new_full((GCompareDataFunc)int_cmp, NULL, NULL, destroy_domain); - return 0; + return true; } =20 static const VMStateDescription vmstate_domain =3D { .name =3D "domain", .version_id =3D 1, .minimum_version_id =3D 1, - .pre_load =3D domain_preload, + .pre_load_errp =3D domain_preload, .fields =3D (const VMStateField[]) { VMSTATE_INT32(id, TestGTreeDomain), VMSTATE_GTREE_V(mappings, TestGTreeDomain, 1, @@ -1073,7 +1031,7 @@ static const VMStateDescription vmstate_iommu =3D { .name =3D "iommu", .version_id =3D 1, .minimum_version_id =3D 1, - .pre_load =3D iommu_preload, + .pre_load_errp =3D iommu_preload, .fields =3D (const VMStateField[]) { VMSTATE_INT32(id, TestGTreeIOMMU), VMSTATE_GTREE_DIRECT_KEY_V(domains, TestGTreeIOMMU, 1, @@ -1239,8 +1197,6 @@ static void diff_iommu(TestGTreeIOMMU *iommu1, TestGT= reeIOMMU *iommu2) =20 static void test_gtree_load_domain(void) { - Error *local_err =3D NULL; - int ret; TestGTreeDomain *dest_domain =3D g_new0(TestGTreeDomain, 1); TestGTreeDomain *orig_domain =3D create_first_domain(); QEMUFile *fload, *fsave; @@ -1253,11 +1209,7 @@ static void test_gtree_load_domain(void) =20 fload =3D open_test_file(false); =20 - ret =3D vmstate_load_state(fload, &vmstate_domain, dest_domain, 1, - &local_err); - if (ret < 0) { - error_report_err(local_err); - } + vmstate_load_vmsd(fload, &vmstate_domain, dest_domain, 1, &error_abort= ); eof =3D qemu_get_byte(fload); g_assert(!qemu_file_get_error(fload)); g_assert_cmpint(orig_domain->id, =3D=3D, dest_domain->id); @@ -1360,8 +1312,6 @@ static void test_gtree_save_iommu(void) =20 static void test_gtree_load_iommu(void) { - Error *local_err =3D NULL; - int ret; TestGTreeIOMMU *dest_iommu =3D g_new0(TestGTreeIOMMU, 1); TestGTreeIOMMU *orig_iommu =3D create_iommu(); QEMUFile *fsave, *fload; @@ -1373,10 +1323,7 @@ static void test_gtree_load_iommu(void) qemu_fclose(fsave); =20 fload =3D open_test_file(false); - ret =3D vmstate_load_state(fload, &vmstate_iommu, dest_iommu, 1, &loca= l_err); - if (ret < 0) { - error_report_err(local_err); - } + vmstate_load_vmsd(fload, &vmstate_iommu, dest_iommu, 1, &error_abort); eof =3D qemu_get_byte(fload); g_assert(!qemu_file_get_error(fload)); g_assert_cmpint(orig_iommu->id, =3D=3D, dest_iommu->id); @@ -1498,8 +1445,6 @@ static void test_save_qlist(void) =20 static void test_load_qlist(void) { - Error *local_err =3D NULL; - int ret; QEMUFile *fsave, *fload; TestQListContainer *orig_container =3D alloc_container(); TestQListContainer *dest_container =3D g_new0(TestQListContainer, 1); @@ -1513,11 +1458,8 @@ static void test_load_qlist(void) qemu_fclose(fsave); =20 fload =3D open_test_file(false); - ret =3D vmstate_load_state(fload, &vmstate_container, dest_container, = 1, - &local_err); - if (ret < 0) { - error_report_err(local_err); - } + vmstate_load_vmsd(fload, &vmstate_container, dest_container, 1, + &error_abort); eof =3D qemu_get_byte(fload); g_assert(!qemu_file_get_error(fload)); g_assert_cmpint(eof, =3D=3D, QEMU_VM_EOF); @@ -1534,22 +1476,22 @@ typedef struct TmpTestStruct { int64_t diff; } TmpTestStruct; =20 -static int tmp_child_pre_save(void *opaque) +static bool tmp_child_pre_save(void *opaque, Error **errp) { struct TmpTestStruct *tts =3D opaque; =20 tts->diff =3D tts->parent->b - tts->parent->a; =20 - return 0; + return true; } =20 -static int tmp_child_post_load(void *opaque, int version_id) +static bool tmp_child_post_load(void *opaque, int version_id, Error **errp) { struct TmpTestStruct *tts =3D opaque; =20 tts->parent->b =3D tts->parent->a + tts->diff; =20 - return 0; + return true; } =20 static const VMStateDescription vmstate_tmp_back_to_parent =3D { @@ -1562,8 +1504,8 @@ static const VMStateDescription vmstate_tmp_back_to_p= arent =3D { =20 static const VMStateDescription vmstate_tmp_child =3D { .name =3D "test/tmp_child", - .pre_save =3D tmp_child_pre_save, - .post_load =3D tmp_child_post_load, + .pre_save_errp =3D tmp_child_pre_save, + .post_load_errp =3D tmp_child_post_load, .fields =3D (const VMStateField[]) { VMSTATE_INT64(diff, TmpTestStruct), VMSTATE_STRUCT_POINTER(parent, TmpTestStruct, --=20 2.53.0 From nobody Sat Sep 26 19:12:10 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1790350875; cv=none; d=zohomail.com; s=zohoarc; b=UceGI1k83oRv+/75oBix32Ql2W3v+eKh0tju6uH9VA9DHEk6OgLY9TWicifbBgCn7ekX6NaJI1tCGJxONBVpGCJfST2DcnA9lEvGefDkNtH/WrczMMJllVwD5275Va1S7Y5zcTqc8TJMVgMM6ZkdKQDa2nALyCwSlT0Tbo8ba2o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790350875; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6ktLq+I+glfOQL2jD8orpGWN+zrfRAKYw6XE6C6Sabw=; b=YBEsATEUJXPsnfzi+4RiL2BlcAoiPI2+NAjJMJkJz9Mb85EHWRf54eY/a9dqsznAgQhW+fE5tP9enGYEw16N09B6r43++SIZTVqiJseSaF0hykXnD7ZF4lp0l8EmXXcGTiR9yAH2SBsg+caSaHD9SSoYAYxMhHcsUMEif7dpx8w= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790350874978975.60986350219; Fri, 25 Sep 2026 08:41:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA82J-0006fj-NN; Fri, 25 Sep 2026 11:40:31 -0400 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 1xA82I-0006fa-B6 for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:30 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xA82G-0004ax-Ly for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:30 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 4D04F1F44F; Fri, 25 Sep 2026 15:40:17 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 1B8D013310; Fri, 25 Sep 2026 15:40:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xxRgCd2VtmqjOwAAD6G6ig:T3 (envelope-from ); Fri, 25 Sep 2026 15:40:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350821; h=from:from:reply-to: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=6ktLq+I+glfOQL2jD8orpGWN+zrfRAKYw6XE6C6Sabw=; b=08Pvza3CSVwMgOyw4jmJ5q+qI6uvUVmuvFcHuChg22RMzt3Oz8f6BFglW27WB96MKsZMSG RIJ45SLgfPZ3nBNI4I4f4EtKQ76fXtwvVONmTLK48Be2T7RmBx/QnJa6dB7R9Y49kBWBpr 9cL9DWLIgHK4eY60+gIPcseHhiVaUJE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350821; h=from:from:reply-to: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=6ktLq+I+glfOQL2jD8orpGWN+zrfRAKYw6XE6C6Sabw=; b=XaNHqvLrmOWva4hhnVIauhqGZ0BGd+zwSb3SX84QTHwVF//BihW+4D3kIWdRCJ9IZM831k syqqrHd/7vdcjmDQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350817; h=from:from:reply-to: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=6ktLq+I+glfOQL2jD8orpGWN+zrfRAKYw6XE6C6Sabw=; b=cl4YggMqIoKBEO4ubgfYbyRHdsehnnIiMREc2lR/1TQv5s0QMMJU6aG5uF2ajQTUPaJAS2 3Ic4v+s8b0Uge1cBe4xazSSDiQO+lEyIZieq5QOhWNlupwsfT3DWjEJwahTUKlvTAiwWPz YS6sioqV7tLYRrR6i6OIHHr+ZeysQdY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350817; h=from:from:reply-to: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=6ktLq+I+glfOQL2jD8orpGWN+zrfRAKYw6XE6C6Sabw=; b=Y3kPAbr6WLhYYYS6QZTBH8hldoY5NON9fqAZJnBit0x++bw/RQ0AuJPDGWlFLuEh0uA/kQ EtXG5/sxPJcau1Cg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Vladimir Sementsov-Ogievskiy Subject: [PULL 02/19] migration/vmstate-types: convert vmstate_info_g_byte_array to new APIs Date: Fri, 25 Sep 2026 12:39:53 -0300 Message-ID: <20260925154010.599247-3-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260925154010.599247-1-farosas@suse.de> References: <20260925154010.599247-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.997]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de 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, 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: qemu development 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 @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1790350877195158500 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas Signed-off-by: Fabiano Rosas --- migration/vmstate-types.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/migration/vmstate-types.c b/migration/vmstate-types.c index 8c01215c25..c2d4645f31 100644 --- a/migration/vmstate-types.c +++ b/migration/vmstate-types.c @@ -925,30 +925,31 @@ const VMStateInfo vmstate_info_qlist =3D { .save =3D save_qlist, }; =20 -static int get_g_byte_array(QEMUFile *f, void *pv, size_t size, - const VMStateField *field) +static bool load_g_byte_array(QEMUFile *f, void *pv, size_t size, + const VMStateField *field, Error **errp) { GByteArray *byte_array =3D *(GByteArray **)pv; uint32_t len =3D qemu_get_be32(f); =20 g_byte_array_set_size(byte_array, len); qemu_get_buffer(f, byte_array->data, len); - return 0; + return true; } =20 -static int put_g_byte_array(QEMUFile *f, void *pv, size_t size, - const VMStateField *field, JSONWriter *vmdesc) +static bool save_g_byte_array(QEMUFile *f, void *pv, size_t size, + const VMStateField *field, JSONWriter *vmdes= c, + Error **errp) { GByteArray *byte_array =3D *(GByteArray **)pv; =20 qemu_put_be32(f, byte_array->len); qemu_put_buffer(f, byte_array->data, byte_array->len); =20 - return 0; + return true; } =20 const VMStateInfo vmstate_info_g_byte_array =3D { .name =3D "GByteArray", - .get =3D get_g_byte_array, - .put =3D put_g_byte_array, + .load =3D load_g_byte_array, + .save =3D save_g_byte_array, }; --=20 2.53.0 From nobody Sat Sep 26 19:12:10 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1790350937; cv=none; d=zohomail.com; s=zohoarc; b=Tn12+OUwHPwsmIyMTPRZKZ7Lo/lvb5Fcg3PMYqccAm+6is4gw8cysxY5gBC96w+MjpbictXPDVZXkWgYWyl3TX0gjLQHUK1OLXABu4m42Ingkjo5Y9mVYGRxtf/CpqEzDLlxLcx+P+PnNZPzvLcNSpPwCar846PENv9FskvVGvk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790350937; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zDTHNuIn4GHwcHpTCa/xceDGSLHn9ucpmuchLkMWlzA=; b=jnz7umDOnED8pMsX/+QgxnXAR+LXpqmSXrHjXi/P8AskwX4sRcFBIbWeSy1aZrFt0Ha4jxbMgCEBOh5S8PwmoqJzyMbUJ0GePxEqQ43dgn56YOzAP6C+1tm+4SdooWfjRAkHah++1aue3+xHj/bWbWkrwU55Bn7AhEpq/vaLVO8= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179035093745497.03348382404874; Fri, 25 Sep 2026 08:42:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA82K-0006fo-59; Fri, 25 Sep 2026 11:40:32 -0400 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 1xA82H-0006fP-Ru for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:29 -0400 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xA82F-0004b4-Uq for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:29 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7167921E7C; Fri, 25 Sep 2026 15:40:18 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 60CCB1333B; Fri, 25 Sep 2026 15:40:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xxRgCd2VtmqjOwAAD6G6ig:T4 (envelope-from ); Fri, 25 Sep 2026 15:40:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350822; h=from:from:reply-to: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=zDTHNuIn4GHwcHpTCa/xceDGSLHn9ucpmuchLkMWlzA=; b=zNbZGkAUVSql2DPEvjRwns4O1Cm9nzk+EGgmDAJv7xeQtxMvfTYMWY8F6vdPTMER1R8iXg IVGO02xshM2D5V1ru4Gq6GXTPqg4L4MtMfUAJceqkysaJOLAHa6Tw0QceU7MoGxhKj457W dGvv06TCGY9dh4m7LttMhBFuQU10rZU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350822; h=from:from:reply-to: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=zDTHNuIn4GHwcHpTCa/xceDGSLHn9ucpmuchLkMWlzA=; b=fYzYns4uTQPb02Ud48qYkwc5X1nQSDeeK9y8gpBMdRmlx61ohBZM2uSigI+m3oNRx+Daoq IysGAUgOZUEda+Dg== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=em5Il3ez; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=1KXV9JUM DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350818; h=from:from:reply-to: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=zDTHNuIn4GHwcHpTCa/xceDGSLHn9ucpmuchLkMWlzA=; b=em5Il3ezsY1RDGwJvWLZylPRcImwpYsRhRNhwNdW4MNO5Z7DIbKn7IxDAtnNoqOda8oIWg lKTex1V3YVA2YC8GV3h3qPSJbxQRJoPipBKTsMoQCrzjo4BQWSFD3n/v89if/aAq2LMLIZ k5L73QGQHJOqULfPvAmUVAMHxeMmFJo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350818; h=from:from:reply-to: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=zDTHNuIn4GHwcHpTCa/xceDGSLHn9ucpmuchLkMWlzA=; b=1KXV9JUMNijpgnTqUh+l9nG/frIdd7P7eS19I9uB6o9VfSb17UwN8bOkcK+F+LJvLVpKZ0 E33OAEo/CWASrCCg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 03/19] migration: remove duplicate VMSTATE_STRUCT_VARRAY Date: Fri, 25 Sep 2026 12:39:54 -0300 Message-ID: <20260925154010.599247-4-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260925154010.599247-1-farosas@suse.de> References: <20260925154010.599247-1-farosas@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: 7167921E7C X-Spamd-Result: default: False [-3.51 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from,2a07:de40:b281:106:10:150:64:167:received]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email,suse.de:mid,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo]; DKIM_TRACE(0.00)[suse.de:+] X-Spam-Score: -3.51 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:1; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de 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, 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: qemu development 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 @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1790350938458158500 From: Marc-Andr=C3=A9 Lureau Fixes: 028d4ec43de6 ("migration: Remove duplicate vmstate macros") Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Fabiano Rosas --- include/migration/vmstate.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 7d2b786382..2901877308 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -725,16 +725,6 @@ extern const VMStateInfo vmstate_info_g_byte_array; #define VMSTATE_STRUCT_VARRAY_POINTER_UINT32 VMSTATE_STRUCT_VARRAY_POINTER #define VMSTATE_STRUCT_VARRAY_POINTER_UINT16 VMSTATE_STRUCT_VARRAY_POINTER =20 -#define VMSTATE_STRUCT_VARRAY(_field, _state, _field_num, _version, _vmsd,= \ - _type) { \ - .name =3D (stringify(_field)), \ - .num_indirect =3D vmstate_field_offset(_state, _field_num), \ - .version_id =3D (_version), \ - .vmsd =3D &(_vmsd), \ - .size =3D sizeof(_type), \ - .flags =3D VMS_STRUCT | VMS_VARRAY, \ - .offset =3D vmstate_offset_varray(_state, _field, _type), \ -} #define VMSTATE_STRUCT_VARRAY_INT32 VMSTATE_STRUCT_VARRAY #define VMSTATE_STRUCT_VARRAY_UINT32 VMSTATE_STRUCT_VARRAY =20 --=20 2.53.0 From nobody Sat Sep 26 19:12:10 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1790350941; cv=none; d=zohomail.com; s=zohoarc; b=Tf81g4EF9AlEgPKx0LFULEhR5mqGfJTRf2Riq6UPUCSUaMh08Onjrz7rqZ0eQwa8FjC+HvhEEzGB56IdTyN2w9+6069dGkoymIoIn0Fa47z+Wybrfwwe0GOcJz/qjCSSC4glIuORKoT1YFSHITLse9tV7Dp8eVAtB0Cx4krAkQ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790350941; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5G45mBCiYUDen0EoHtKerILaJEv08Eo3StMnQ0TSXzc=; b=W/kijFPaI7JwjK/GNV4ngxgdnul+Zho/dyeTY/6ByxekJrh5vue7/NDlT3jx4nXLy2kwib/5v1C5Hm9xCqzRaxeYG2P2rQ0d7CWF4th8DpVqOdhGVwxQWAnlBIoOQM7wvwuYf2oqSTGYmVS4d6oHvgEURNKbRJGWhOVtB/tBJ+Q= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790350941796154.79418547386433; Fri, 25 Sep 2026 08:42:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA82L-0006gm-W0; Fri, 25 Sep 2026 11:40:34 -0400 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 1xA82J-0006fl-SA for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:31 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xA82I-0004bH-8J for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:31 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 469A91F457; Fri, 25 Sep 2026 15:40:20 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A69D313274; Fri, 25 Sep 2026 15:40:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xxRgCd2VtmqjOwAAD6G6ig:T5 (envelope-from ); Fri, 25 Sep 2026 15:40:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350824; h=from:from:reply-to: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=5G45mBCiYUDen0EoHtKerILaJEv08Eo3StMnQ0TSXzc=; b=m6vcviOivINBEauc67S/xHGkjogsaR0VD3ghyuvx7Bv3JU/7bfOBBMncf995rtLjSPBbTe vg6AxbDJwxk7NYi9sVwkkOLQ5nSS6qyGs0OoeoAvfeG0kEisNC/CpjwwRkWzDVCwEDdj7a qDOoxfB8+WWiJ7WnfkdQofsJUiuYr6s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350824; h=from:from:reply-to: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=5G45mBCiYUDen0EoHtKerILaJEv08Eo3StMnQ0TSXzc=; b=3nSFUnXTqiulniKoqnG6jkrerwSPCZMqA7GpnMykMYxtGwP1kJH/LGSe8k9dQEtvMg/1Xf kfkZTGu4Zk1Tx6CQ== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=pzUpQP8H; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=ihkwdhie DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350820; h=from:from:reply-to: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=5G45mBCiYUDen0EoHtKerILaJEv08Eo3StMnQ0TSXzc=; b=pzUpQP8Hwt3tHKIr6EgtJbxb/dOCNs55naMK9CGOoE9A1zKJyr+9MKoOrL5uj3yppBg3VV ADWDe8Can0V6mWvFcxUnMoZYxdToMapccxiaq2ubU9QSbvyWXsoS4X8FQ1ggmOXPX5pzX7 UOnmdGpjJl0gONPnlVk4QqMDIUbTiuk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350820; h=from:from:reply-to: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=5G45mBCiYUDen0EoHtKerILaJEv08Eo3StMnQ0TSXzc=; b=ihkwdhievJRFySxIE/U5MptiVIvV3Sqi40B+OVwXVmPC1R20PS6qTe+liiB8VpIWEJIqJJ s45XL1Zg+cGyO3DQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Yanfei Xu , Jack Wang , Li Zhijian , Lukas Straub Subject: [PULL 04/19] migration/rdma: Fix write-side shutdown Date: Fri, 25 Sep 2026 12:39:55 -0300 Message-ID: <20260925154010.599247-5-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260925154010.599247-1-farosas@suse.de> References: <20260925154010.599247-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.01 X-Rspamd-Queue-Id: 469A91F457 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Action: no action X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,bytedance.com,cloud.ionos.com,fujitsu.com,web.de]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[fujitsu.com:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,bytedance.com:email,ionos.com:email,suse.de:dkim,suse.de:email,suse.de:mid]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_ENVRCPT(0.00)[web.de]; FROM_HAS_DN(0.00)[]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from,2a07:de40:b281:106:10:150:64:167:received]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_FIVE(0.00)[6]; DKIM_TRACE(0.00)[suse.de:+] 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=lists1p.gnu.org; Received-SPF: pass client-ip=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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: qemu development 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 @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1790350942536158500 Content-Type: text/plain; charset="utf-8" From: Yanfei Xu qio_channel_rdma_shutdown() reads rdmain for both the input and output contexts. As a result, a write-side shutdown marks the input context as errored while leaving the output context active. A shutdown of both directions also fails to stop the output context. Read rdmaout from the output context so each shutdown direction marks the corresponding RDMA context as errored. Fixes: 54db882f073a ("migration: implement the shutdown for RDMA QIOChannel= ") Signed-off-by: Yanfei Xu Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Reviewed-by: Jack Wang Reviewed-by: Li Zhijian Tested-by: Lukas Straub Signed-off-by: Fabiano Rosas --- migration/rdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/rdma.c b/migration/rdma.c index e976739fad..61181deb8a 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -2860,7 +2860,7 @@ qio_channel_rdma_shutdown(QIOChannel *ioc, RCU_READ_LOCK_GUARD(); =20 rdmain =3D qatomic_rcu_read(&rioc->rdmain); - rdmaout =3D qatomic_rcu_read(&rioc->rdmain); + rdmaout =3D qatomic_rcu_read(&rioc->rdmaout); =20 switch (how) { case QIO_CHANNEL_SHUTDOWN_READ: --=20 2.53.0 From nobody Sat Sep 26 19:12:10 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1790350975; cv=none; d=zohomail.com; s=zohoarc; b=CW69W27qHnd8nbtdNXmQVTIwJobUMHuda8UKA8BHFla4QQWOIKnOyvzb4o7boOiNbhMwuJ2v8eSDwPUf+ixEOZ6gpwJfXobRLZi3SzdNZSVIv+4e8cMeysica8K7783ryJ4vC2MnNaqKcFK1k0v3uEYW/HTyZ9uKgUAlpT3vFbI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790350975; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=r+rSzTpAzrT4c/X+RTvbzW/ZNpBPyGBfleZmS7Annoo=; b=aaCDMDM+b4jULlICzHj1LafRGJdk/gPJQy6fkXnEEqAiXDFkaVY+XeK7ZWydf3GNhRBZHqp9ZR9oZTtXxtSiCfz4PbTPAn4VTPRSdbR1RHyVcqU7Lsm5LR9ExIjyjxot4P150jFBjJjJ4BTIAW5n9pAZ5jWmOqhnbXHfwqu7dJo= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179035097505723.779745523996098; Fri, 25 Sep 2026 08:42:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA82M-0006gr-Rj; Fri, 25 Sep 2026 11:40:34 -0400 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 1xA82L-0006gP-3f for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:33 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xA82J-0004bX-AX for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:32 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id D97161FDA7; Fri, 25 Sep 2026 15:40:21 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 7E56E13297; Fri, 25 Sep 2026 15:40:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xxRgCd2VtmqjOwAAD6G6ig:T6 (envelope-from ); Fri, 25 Sep 2026 15:40:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350826; h=from:from:reply-to: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=r+rSzTpAzrT4c/X+RTvbzW/ZNpBPyGBfleZmS7Annoo=; b=fnDdKY3W+SCpZbDScCZIH+u+XeRO3wnNwlBTQcomVGA/yeecnJKGnjDw1KglZLPLIrQJVA ho500HXUYXeo603LIwlfCOrbCzA9lH4Pa4RcQl0Y203bIMXLVYxuGaa+900v8/KV7M/fo2 WIpy6fZJIb2aE2r0FwcLBKNXiYOLvj0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350826; h=from:from:reply-to: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=r+rSzTpAzrT4c/X+RTvbzW/ZNpBPyGBfleZmS7Annoo=; b=AK9eGG8cH343V47yn8r52JXF2y/3+5HukZHz0yLdcaobgIC+n3G3fohp8RajNSWvilMjT5 Pe2YXyX+GdZW0gCQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350821; h=from:from:reply-to: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=r+rSzTpAzrT4c/X+RTvbzW/ZNpBPyGBfleZmS7Annoo=; b=tsaxNpUjbR5l6FSOjyn0zRFi+F8jZ2AvjjOohXmZS0PJ+p4dxiOGJujRB4CsE4mYH04HvC kjSCJcV6TH3kr1GAEe+qskXA5iWhzjcRXJ7FcQ+EDdwEL6Mo/Rp4gSncsB/dxG/56yQ9wL aBWD99+0ZQW9eiZ6B/nijtvzunl0CfU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350821; h=from:from:reply-to: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=r+rSzTpAzrT4c/X+RTvbzW/ZNpBPyGBfleZmS7Annoo=; b=94GtCiUGUdNJNCUDgMrvoV5NvcaRErBcH7dCTT7HJyyLo3WCiHPu3+9DJjYfoEul64f6bj El1RGnL/Qseu9cAA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Yanfei Xu , Jack Wang Subject: [PULL 05/19] migration/rdma: Post initial receive before accepting Date: Fri, 25 Sep 2026 12:39:56 -0300 Message-ID: <20260925154010.599247-6-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260925154010.599247-1-farosas@suse.de> References: <20260925154010.599247-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.997]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email,bytedance.com:email,ionos.com:email]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] 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=lists1p.gnu.org; Received-SPF: pass client-ip=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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: qemu development 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 @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1790350976653158500 Content-Type: text/plain; charset="utf-8" From: Yanfei Xu The source return-path thread can send READY before the destination has posted its initial receive. Since RNR retries default to zero, the send can fail and abort migration. Post the initial receive before rdma_accept() to close this window. Adding delays can easily reproduce it. For exmaple with sleep(1), error could be found at the source side: 2026-08-20T05:55:11.471421Z qemu_rdma_exchange_get_response_start CONTROL: = READY receiving... 2026-08-20T05:55:11.471422Z qemu_rdma_post_send_control CONTROL: sending QE= MU FILE.. 2026-08-20T05:55:11.471447Z qemu_rdma_poll_other other completion 2000 rece= ived left 0 2026-08-20T05:55:11.471589Z qemu_rdma_poll_recv completion 0 received (4000= ) left 0 2026-08-20T05:55:11.471592Z qemu_rdma_poll_other other completion 4000 rece= ived left 0 2026-08-20T05:55:11.471594Z qemu_rdma_exchange_get_response_start CONTROL: = READY receiving... 2026-08-20T05:55:11.471596Z qemu_rdma_post_send_control CONTROL: sending QE= MU FILE.. 2026-08-20T05:55:11.471617Z qemu_rdma_poll_other other completion 2000 rece= ived left 0 2026-08-20T05:55:11.705561Z qemu_rdma_close 2026-08-20T05:55:11.705587Z qemu_rdma_close 2026-08-20T05:55:11.705626Z qemu-system-x86_64: rdma migration: send pollin= g control error 2026-08-20T05:55:11.707001Z qemu-system-x86_64: warning: Early error. Sendi= ng error. 2026-08-20T05:55:11.707031Z qemu_rdma_post_send_control CONTROL: sending ER= ROR.. 2026-08-20T05:55:11.707038Z qemu-system-x86_64: warning: rdma migration: se= nd polling control error 2026-08-20T05:55:11.707301Z qemu_rdma_cleanup_disconnect 2026-08-20T05:55:11.710569Z qemu_rdma_cleanup_disconnect Fixes: 55cc1b5937a8 ("migration: create a dedicated connection for rdma ret= urn path") Signed-off-by: Yanfei Xu Reviewed-by: Peter Xu Reviewed-by: Jack Wang Signed-off-by: Fabiano Rosas --- migration/rdma.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 61181deb8a..618324645b 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -3141,6 +3141,12 @@ static int qemu_rdma_accept(RDMAContext *rdma) } } =20 + ret =3D qemu_rdma_post_recv_control(rdma, RDMA_WRID_READY, &err); + if (ret < 0) { + error_report_err(err); + goto err_rdma_dest_wait; + } + /* Accept the second connection request for return path */ if ((migrate_postcopy() || migrate_return_path()) && !rdma->is_return_path) { @@ -3173,12 +3179,6 @@ static int qemu_rdma_accept(RDMAContext *rdma) rdma_ack_cm_event(cm_event); rdma->connected =3D true; =20 - ret =3D qemu_rdma_post_recv_control(rdma, RDMA_WRID_READY, &err); - if (ret < 0) { - error_report_err(err); - goto err_rdma_dest_wait; - } - qemu_rdma_dump_gid("dest_connect", rdma->cm_id); =20 return 0; --=20 2.53.0 From nobody Sat Sep 26 19:12:10 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1790350887; cv=none; d=zohomail.com; s=zohoarc; b=dxnxpN6YCbdfQ1tM6kWbK12xy74e++gwoa71j1H2kmhFCyv/iN611UuR9AJSh5vrmPGtJLbS1Z4aM820FjUMVHdutBs0DeSNekms+OI4dQsn+b8mNI65kv+T1vDHpjUqdk1OZOPXQMubPIGh3kMlZUQB2YaEYM7m5/H2RRoXWDM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790350887; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7OSpCuW9nO5gBUIlHX+CIcRjX/6Jh/dAG4Pg2+xuudQ=; b=iUEPRiVJtjTSR5NwUdTJd4Ya3qLpsFE01gxgBAhFCudWdq8QYDvyMC62iajdbd+s1ZRNYAnwXNbzrrhPLQijyULLI+pWPHr1GUwwc14VfR8yofbPTZYbA6O2HmQbQ9/sgvm+oiimKNwYmb89bPc3oMyIgD1N1EhBvoSzrT5+25I= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790350886854600.7710762215954; Fri, 25 Sep 2026 08:41:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA82O-0006hO-1o; Fri, 25 Sep 2026 11:40:36 -0400 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 1xA82M-0006gn-GL for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:34 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xA82K-0004bh-Gq for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:34 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 35EA21FF6B; Fri, 25 Sep 2026 15:40:23 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id EFE5C1333E; Fri, 25 Sep 2026 15:40:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xxRgCd2VtmqjOwAAD6G6ig:T7 (envelope-from ); Fri, 25 Sep 2026 15:40:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350827; h=from:from:reply-to: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=7OSpCuW9nO5gBUIlHX+CIcRjX/6Jh/dAG4Pg2+xuudQ=; b=zmTUD0KAkkSE5H010zXP3/rIvcDXIMp8cYq5TSTJEBSl/f3PTTVNOPjEfSEenNNPW7+XPU gvGvarO9jSUdPOaSgW/kWW4ff9zhKZIr+jsp3E+OAO8QJHXScSl1ge9PD6s25arY4xmppc wSVWakHVdOk8XFrKWFvzsuj9sOL3Wt4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350827; h=from:from:reply-to: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=7OSpCuW9nO5gBUIlHX+CIcRjX/6Jh/dAG4Pg2+xuudQ=; b=0HDrwIu97RqANSPZEMxgCloms4Hcr7+cN0U4XaAWnNYtEnwoBE+p3kBuoo9cCMfci2xGV6 UJvMrUtxvrReKkBA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=aPjSd1Fx; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=1Pn0WDOX DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350823; h=from:from:reply-to: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=7OSpCuW9nO5gBUIlHX+CIcRjX/6Jh/dAG4Pg2+xuudQ=; b=aPjSd1Fx3oAioumCg5qVQW283JXbXL6vdf0neSNmYIpU1bkJN9pZlpBLB76k0qmvO8QWuD 6y/a15jcmTXJohd9/WrJctACplCLeW/Z0fF/3ViwcNQ3h2/Q0dtUXUOrjHA1Mo/Ody5yCv arUZ1d/XBloCvt2CpzGDaW1h+oWwE3Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350823; h=from:from:reply-to: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=7OSpCuW9nO5gBUIlHX+CIcRjX/6Jh/dAG4Pg2+xuudQ=; b=1Pn0WDOXpXm80s+G667Mhipj7+y+JeS9nuCYFjS6BY6hMN1T+f95moYOJV/eZw1Ri9dL4y KpLzovRFw5GOHaAA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Yanfei Xu , Jack Wang Subject: [PULL 06/19] migration/rdma: Retry control sends on full queue Date: Fri, 25 Sep 2026 12:39:57 -0300 Message-ID: <20260925154010.599247-7-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260925154010.599247-1-farosas@suse.de> References: <20260925154010.599247-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: 35EA21FF6B X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from,2a07:de40:b281:106:10:150:64:167:received]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_TLS_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[bytedance.com:email,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo,suse.de:dkim,suse.de:email,suse.de:mid,ionos.com:email]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+] X-Spam-Score: -3.01 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de 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, 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: qemu development 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 @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1790350888340158500 Content-Type: text/plain; charset="utf-8" From: Yanfei Xu RAM writes and control messages share the send queue. If outstanding writes fill it, RDMA writes drain a completion and retry, but control sends fail the migration. Move send posting and queue-full handling into a common helper. On ENOMEM, drain one outstanding RDMA write and retry the failed request once. If no write is outstanding, or the retry still fails, propagate the error. Signed-off-by: Yanfei Xu Reviewed-by: Peter Xu Reviewed-by: Jack Wang Signed-off-by: Fabiano Rosas --- migration/rdma.c | 75 ++++++++++++++++++++++++++---------------- migration/trace-events | 2 +- 2 files changed, 48 insertions(+), 29 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 618324645b..35d918ec83 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -1423,6 +1423,51 @@ err_block_for_wrid: return -1; } =20 +/* + * Post a send work request, draining an outstanding RDMA write if the send + * queue is full. + */ +static bool qemu_rdma_post_send(RDMAContext *rdma, + struct ibv_send_wr *send_wr, + Error **errp) +{ + struct ibv_send_wr *bad_wr; + uint64_t wr_id =3D send_wr->wr_id & RDMA_WRID_TYPE_MASK; + const char *wr_desc; + int ret; + + switch (wr_id) { + case RDMA_WRID_RDMA_WRITE: + wr_desc =3D "RDMA write"; + break; + case RDMA_WRID_SEND_CONTROL: + wr_desc =3D "control send"; + break; + default: + g_assert_not_reached(); + } + + ret =3D ibv_post_send(rdma->qp, send_wr, &bad_wr); + if (ret =3D=3D ENOMEM && rdma->nb_sent) { + trace_rdma_post_send_queue_full(send_wr->wr_id, rdma->nb_sent); + ret =3D qemu_rdma_block_for_wrid(rdma, RDMA_WRID_RDMA_WRITE, NULL); + if (ret < 0) { + error_setg(errp, "rdma migration: failed to make room for %s", + wr_desc); + return false; + } + ret =3D ibv_post_send(rdma->qp, send_wr, &bad_wr); + } + + if (ret > 0) { + error_setg_errno(errp, ret, "rdma migration: post %s failed", + wr_desc); + return false; + } + + return true; +} + /* * Post a SEND message work request for the control channel * containing some data and block until the post completes. @@ -1433,7 +1478,6 @@ static int qemu_rdma_post_send_control(RDMAContext *r= dma, uint8_t *buf, { int ret; RDMAWorkRequestData *wr =3D &rdma->wr_data[RDMA_WRID_CONTROL]; - struct ibv_send_wr *bad_wr; struct ibv_sge sge =3D { .addr =3D (uintptr_t)(wr->control), .length =3D head->len + sizeof(RDMAControlHeade= r), @@ -1465,11 +1509,7 @@ static int qemu_rdma_post_send_control(RDMAContext *= rdma, uint8_t *buf, memcpy(wr->control + sizeof(RDMAControlHeader), buf, head->len); } =20 - - ret =3D ibv_post_send(rdma->qp, &send_wr, &bad_wr); - - if (ret > 0) { - error_setg(errp, "Failed to use post IB SEND for control"); + if (!qemu_rdma_post_send(rdma, &send_wr, errp)) { return -1; } =20 @@ -1729,7 +1769,6 @@ static int qemu_rdma_write_one(RDMAContext *rdma, { struct ibv_sge sge; struct ibv_send_wr send_wr =3D { 0 }; - struct ibv_send_wr *bad_wr; int reg_result_idx, ret, count =3D 0; uint64_t chunk, chunks; uint64_t chunk_size =3D migrate_rdma_chunk_size(); @@ -1743,7 +1782,6 @@ static int qemu_rdma_write_one(RDMAContext *rdma, .repeat =3D 1, }; =20 -retry: sge.addr =3D (uintptr_t)(block->local_host_addr + (current_addr - block->offset)); sge.length =3D length; @@ -1900,26 +1938,7 @@ retry: trace_rdma_write_one_post(chunk, sge.addr, send_wr.wr.rdma.remote_addr, sge.length); =20 - /* - * ibv_post_send() does not return negative error numbers, - * per the specification they are positive - no idea why. - */ - ret =3D ibv_post_send(rdma->qp, &send_wr, &bad_wr); - - if (ret =3D=3D ENOMEM) { - trace_rdma_write_one_queue_full(); - ret =3D qemu_rdma_block_for_wrid(rdma, RDMA_WRID_RDMA_WRITE, NULL); - if (ret < 0) { - error_setg(errp, "rdma migration: failed to make " - "room in full send queue!"); - return -1; - } - - goto retry; - - } else if (ret > 0) { - error_setg_errno(errp, ret, - "rdma migration: post rdma write failed"); + if (!qemu_rdma_post_send(rdma, &send_wr, errp)) { return -1; } =20 diff --git a/migration/trace-events b/migration/trace-events index e87d4abd91..2ee2c8f212 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -245,7 +245,7 @@ rdma_resolve_host_trying(const char *host, const char *= ip) "Trying %s =3D> %s" rdma_write_flush(int sent) "sent total: %d" rdma_write_one_block(int count, int block, uint64_t chunk, uint64_t curren= t, uint64_t len, int nb_sent, int nb_chunks) "(%d) Not clobbering: block: %= d chunk %" PRIu64 " current %" PRIu64 " len %" PRIu64 " %d %d" rdma_write_one_post(uint64_t chunk, long addr, long remote, uint32_t len) = "Posting chunk: %" PRIu64 ", addr: 0x%lx remote: 0x%lx, bytes %" PRIu32 -rdma_write_one_queue_full(void) "" +rdma_post_send_queue_full(uint64_t wr_id, int sent) "send queue full, wr_i= d=3D%" PRIu64 ", outstanding writes=3D%d" rdma_write_one_recvregres(int mykey, int theirkey, uint64_t chunk) "Receiv= ed registration result: my key: 0x%x their key 0x%x, chunk %" PRIu64 rdma_write_one_sendreg(uint64_t chunk, int len, int index, int64_t offset)= "Sending registration request chunk %" PRIu64 " for %d bytes, index: %d, o= ffset: %" PRId64 rdma_write_one_top(uint64_t chunks, uint64_t size) "Writing %" PRIu64 " ch= unks, (%" PRIu64 " MB)" --=20 2.53.0 From nobody Sat Sep 26 19:12:10 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1790350968; cv=none; d=zohomail.com; s=zohoarc; b=G0K5U3i0DamFdGkV8I4aqnCQyFkT2tG2ZW6vkM/sbf7y5M1GvFe745x+vYSa8N3ktC24BMo441KzPKdnxrnduUqco0WR4B4Ptq+oRonjTXdbhP9Uce/lFV9rQiOLdoXft6g6mbBUqLXeUdfIcjeWVXbXITnHnYmMBtvzBv0V9cM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790350968; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=H0N/vnnHidDRQ3Tlq22ye4mHuQiQRR6uIVyLN1zgboo=; b=Nldd1isojtWAGoz5QlPO9To0tJGf5L+VX+AEOTEjSzRomfvrE3HnOOtWCh+qPD8qT8ngm1DKqk7CFkNNr/4QpUu6adZDQWW6E68Igae57hgE779FXHa1mTFO2oi0SuFKz38qPidMc84cI5JoM8eMSodvtZK3UZlRtNTXrEUp0NA= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790350968487135.18524848793834; Fri, 25 Sep 2026 08:42:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA82P-0006hn-5M; Fri, 25 Sep 2026 11:40:37 -0400 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 1xA82O-0006hP-2X for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:36 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xA82M-0004bz-BH for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:35 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id DBEB91F833; Fri, 25 Sep 2026 15:40:24 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6D341132C9; Fri, 25 Sep 2026 15:40:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xxRgCd2VtmqjOwAAD6G6ig:T8 (envelope-from ); Fri, 25 Sep 2026 15:40:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350829; h=from:from:reply-to: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=H0N/vnnHidDRQ3Tlq22ye4mHuQiQRR6uIVyLN1zgboo=; b=CvwGck4r39zJjgHiW7JvApKQPVPsAoAd1f2a224EUK458hvb/F+Fwp8DiYx21T0sqf3Fd/ K4uxmNgcXuXNPoEII2fDz7uqbCFHEc5yQKnRBzgM12E8wI3+lIOrGrSPL9cvYKYhlBJcCS i0DqM00dcIFNMKIvNMkI+T5drWqL5aY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350829; h=from:from:reply-to: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=H0N/vnnHidDRQ3Tlq22ye4mHuQiQRR6uIVyLN1zgboo=; b=yOrD5cHoW89G6jFsw7gABZeZ+gxIllKQEgFE6jUxKsjbGxylE2GUAuj61UMLxboc+44c4o mU7lZdF9wUEZH7AQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350824; h=from:from:reply-to: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=H0N/vnnHidDRQ3Tlq22ye4mHuQiQRR6uIVyLN1zgboo=; b=UXKuR8ID3/eO7E4Svne5LiK8Kcga2DzE1xy1ZY6ijLSQ+OJgHj6v20VDzkA0+/pVhaI+wZ rGQimDKbWPJNXTXLnOtYjqwRaC+KtQ8oUUalhuOnDBtJLxkkO6/jFgZHn1vFhyQzQmMkKL giU0uULhvivyCiYSDVRBVVKNsL2cWgk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350824; h=from:from:reply-to: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=H0N/vnnHidDRQ3Tlq22ye4mHuQiQRR6uIVyLN1zgboo=; b=NXJ0p28STuPdbNwgpZBxHGYRCv8/VhxAP7PWKKO8mPExtz1+7EiEUYrfw6YcQw9oVHV/gA 3IExSQrcNh0jUVDQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Markus Armbruster , Prasad Pandit , Vladimir Sementsov-Ogievskiy Subject: [PULL 07/19] qapi/migration: Make migration parameter @local consistently unstable Date: Fri, 25 Sep 2026 12:39:58 -0300 Message-ID: <20260925154010.599247-8-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260925154010.599247-1-farosas@suse.de> References: <20260925154010.599247-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.997]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email,fedoraproject.org:email,imap1.dmz-prg2.suse.org:helo,yandex-team.ru:email]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] 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=lists1p.gnu.org; Received-SPF: pass client-ip=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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: qemu development 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 @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1790350971069158500 Content-Type: text/plain; charset="utf-8" From: Markus Armbruster @local is unstable in MigrationParameters, but not in MigrationParameter. Fix the latter. Fixes: c9affb8e9b (qapi: add local migration parameter) Signed-off-by: Markus Armbruster Reviewed-by: Prasad Pandit Reviewed-by: Peter Xu Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Fabiano Rosas --- qapi/migration.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qapi/migration.json b/qapi/migration.json index f7628b55e9..9a1cc7c4e5 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -804,8 +804,8 @@ # # Features: # -# @unstable: Members @x-checkpoint-delay, @x-rdma-chunk-size, and -# @x-vcpu-dirty-limit-period are experimental. +# @unstable: Members @local, @x-checkpoint-delay, @x-rdma-chunk-size, +# and @x-vcpu-dirty-limit-period are experimental. # # Since: 2.4 ## @@ -831,7 +831,7 @@ 'direct-io', { 'name': 'x-rdma-chunk-size', 'features': [ 'unstable' ] }, 'cpr-exec-command', - 'local'] } + { 'name': 'local', 'features': [ 'unstable' ] } ] } =20 ## # @migrate-set-parameters: --=20 2.53.0 From nobody Sat Sep 26 19:12:10 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1790350990; cv=none; d=zohomail.com; s=zohoarc; b=lCyHRowidbrn1iskinsdzIeoQk2bWqrxFUumGnTiXYeQRV8IBe4Wpp8j2gvrB1NKkB92qY+xRkkrb7OLF2Sb4CsedTX9PmJQB30i772tQ+N1ltx0uyZdpme2FgC/ckJE4xeURhIaKQzM9LqSL5E8A05mU9ZuXobJ4CsWeaprDfI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790350990; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=52DIgqmLX5fYoHFezqVp/OYQGAW7c+IKgzFrqII9PQ0=; b=gfwKA97F4Wbc98IrEtrYY1pab6oYhM92RJQMEW/Cdf777xtyUp0Kt1clVEwhANwEb2eU2VmBWtl58/OpfbeY+S8MT1Bg/JhDrFhh3v1gtcxfAYDr0REbA8LcuABvuwO2qMJSk2D5ES3LMeYBxcJ2QwUO/N8BqR7aSeuk4/RXi9I= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790350990323794.1645416108032; Fri, 25 Sep 2026 08:43:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA82T-0006iu-6e; Fri, 25 Sep 2026 11:40:41 -0400 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 1xA82Q-0006i3-S7 for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:39 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xA82N-0004cA-Q2 for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:38 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 560991FF47; Fri, 25 Sep 2026 15:40:26 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 1A05213353; Fri, 25 Sep 2026 15:40:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xxRgCd2VtmqjOwAAD6G6ig:T9 (envelope-from ); Fri, 25 Sep 2026 15:40:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350830; h=from:from:reply-to: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=52DIgqmLX5fYoHFezqVp/OYQGAW7c+IKgzFrqII9PQ0=; b=p7cokc9KBcSwZp+eWeBuG3JQu1AlKriaFAI2lnGwJtJh50acVVwk4Uh2Fhcy0rpQqegIhx 2JORQx/kfKql0R6xZ6eeHPuOwUqTeO+2vJlJlqm0ev1YQxmXE2I8mCKkqEq3YuMdgMheUn R7WcXdzrTQy933KphXWG+1SG+TTLeSk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350830; h=from:from:reply-to: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=52DIgqmLX5fYoHFezqVp/OYQGAW7c+IKgzFrqII9PQ0=; b=4M9vO7Nup84m/6UuH5SoXlx41O/KfA55FAanivQCm90whWOoudLS6KTEf/+C2xxvcFiwY9 G7OlzVZcMAYrMmDA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350826; h=from:from:reply-to: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=52DIgqmLX5fYoHFezqVp/OYQGAW7c+IKgzFrqII9PQ0=; b=bzyQAFIAtdct8ABcODuJIXnbSLbkLIr5w/KKzf2clc23NbaaesD6/aoCSOUn0QIBPhZTL5 DpRjLR0CgpHOHhqwj9z6upBcCq2L8LtXuSGZDnFl4ayTXmdl2B6uxZRlVdQKIEw043P8m9 gryx5LrgezyV0W7bhVre7BZylJohhCU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350826; h=from:from:reply-to: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=52DIgqmLX5fYoHFezqVp/OYQGAW7c+IKgzFrqII9PQ0=; b=MY9xTScGDR7XldHCzPJrYW7V516N2mFRPANcX9ZOh6LqSUSi14wyVOr7N35N7acaLCx8Q6 6gdOjfly0J0yO6Bg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Yanfei Xu , Jack Wang Subject: [PULL 08/19] migration/ram: Add RAM round synchronization notifiers Date: Fri, 25 Sep 2026 12:39:59 -0300 Message-ID: <20260925154010.599247-9-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260925154010.599247-1-farosas@suse.de> References: <20260925154010.599247-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.997]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,bytedance.com:email,ionos.com:email,suse.de:email,suse.de:mid]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] 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=lists1p.gnu.org; Received-SPF: pass client-ip=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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: qemu development 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 @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1790350990797158500 Content-Type: text/plain; charset="utf-8" From: Yanfei Xu find_dirty_block() directly invokes multifd's per-round synchronization when the RAM scan wraps. Other transports need the same boundary to order page versions. Add a return-valued notifier for RAM round completion and register multifd's existing synchronization through it. This keeps the current behavior while allowing other transports to synchronize at the same boundary. Signed-off-by: Yanfei Xu Reviewed-by: Peter Xu Tested-by: Jack Wang Signed-off-by: Fabiano Rosas --- migration/multifd-nocomp.c | 24 ++++++++++++++++++++ migration/ram.c | 45 +++++++++++++++++++++++++++++++++----- migration/ram.h | 12 ++++++++++ 3 files changed, 75 insertions(+), 6 deletions(-) diff --git a/migration/multifd-nocomp.c b/migration/multifd-nocomp.c index 9f7a792fa7..3067c19cc6 100644 --- a/migration/multifd-nocomp.c +++ b/migration/multifd-nocomp.c @@ -19,6 +19,7 @@ #include "multifd-colo.h" #include "options.h" #include "migration.h" +#include "ram.h" #include "qapi/error.h" #include "qemu/cutils.h" #include "qemu/error-report.h" @@ -27,6 +28,28 @@ =20 static MultiFDSendData *multifd_ram_send; =20 +static int multifd_ram_round_notify(NotifierWithReturn *n G_GNUC_UNUSED, + void *data, Error **errp) +{ + RAMRoundNotifyData *round_data =3D data; + QEMUFile *f =3D round_data->file; + int ret; + + if (!multifd_ram_sync_per_round()) { + return 0; + } + + ret =3D multifd_ram_flush_and_sync(f); + if (ret < 0) { + error_setg(errp, "multifd RAM round synchronization failed"); + } + return ret; +} + +static NotifierWithReturn multifd_ram_round_notifier =3D { + .notify =3D multifd_ram_round_notify, +}; + void multifd_ram_payload_alloc(MultiFDPages_t *pages) { pages->offset =3D g_new0(ram_addr_t, multifd_ram_page_count()); @@ -471,6 +494,7 @@ static const MultiFDMethods multifd_nocomp_ops =3D { static void multifd_nocomp_register(void) { multifd_register_ops(MULTIFD_COMPRESSION_NONE, &multifd_nocomp_ops); + ram_round_add_notifier(&multifd_ram_round_notifier); } =20 migration_init(multifd_nocomp_register); diff --git a/migration/ram.c b/migration/ram.c index b7c406428e..e6db3bf523 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -470,6 +470,8 @@ typedef struct RAMState RAMState; static RAMState *ram_state; =20 static NotifierWithReturnList precopy_notifier_list; +static NotifierWithReturnList ram_round_notifier_list =3D + NOTIFIER_WITH_RETURN_LIST_INITIALIZER(ram_round_notifier_list); =20 /* Whether postcopy has queued requests? */ static bool postcopy_has_request(RAMState *rs) @@ -500,6 +502,38 @@ int precopy_notify(PrecopyNotifyReason reason, Error *= *errp) return notifier_with_return_list_notify(&precopy_notifier_list, &pnd, = errp); } =20 +void ram_round_add_notifier(NotifierWithReturn *n) +{ + notifier_with_return_list_add(&ram_round_notifier_list, n); +} + +void ram_round_remove_notifier(NotifierWithReturn *n) +{ + notifier_with_return_remove(n); +} + +static int ram_round_notify(QEMUFile *f) +{ + RAMRoundNotifyData data =3D { + .file =3D f, + }; + Error *local_err =3D NULL; + int ret; + + ret =3D notifier_with_return_list_notify(&ram_round_notifier_list, &da= ta, + &local_err); + if (ret) { + if (local_err) { + error_report_err(local_err); + } else { + error_report("RAM round notifier failed: %d", ret); + } + return -1; + } + + return 0; +} + uint64_t ram_bytes_remaining(void) { return ram_state ? (ram_state->migration_dirty_pages * TARGET_PAGE_SIZ= E) : @@ -1410,12 +1444,11 @@ static int find_dirty_block(RAMState *rs, PageSearc= hStatus *pss) pss->page =3D 0; pss->block =3D QLIST_NEXT_RCU(pss->block, next); if (!pss->block) { - if (multifd_ram_sync_per_round()) { - QEMUFile *f =3D rs->pss[RAM_CHANNEL_PRECOPY].pss_channel; - int ret =3D multifd_ram_flush_and_sync(f); - if (ret < 0) { - return ret; - } + QEMUFile *f =3D rs->pss[RAM_CHANNEL_PRECOPY].pss_channel; + int ret =3D ram_round_notify(f); + + if (ret < 0) { + return ret; } =20 /* Hit the end of the list */ diff --git a/migration/ram.h b/migration/ram.h index 41697a7599..84f10087e8 100644 --- a/migration/ram.h +++ b/migration/ram.h @@ -31,6 +31,7 @@ =20 #include "qapi/qapi-types-migration.h" #include "exec/cpu-common.h" +#include "qemu/notify.h" #include "system/ram_addr.h" #include "io/channel.h" =20 @@ -95,6 +96,17 @@ void ram_handle_zero(void *host, uint64_t size); void ram_transferred_add(uint64_t bytes); void ram_release_page(const char *rbname, uint64_t offset); =20 +/* + * The RAM round notifier is invoked whenever the migration RAM core + * completes one full scan of guest memory. + */ +typedef struct RAMRoundNotifyData { + QEMUFile *file; +} RAMRoundNotifyData; + +void ram_round_add_notifier(NotifierWithReturn *n); +void ram_round_remove_notifier(NotifierWithReturn *n); + int ramblock_recv_bitmap_test(RAMBlock *rb, void *host_addr); bool ramblock_recv_bitmap_test_byte_offset(RAMBlock *rb, uint64_t byte_off= set); void ramblock_recv_bitmap_set(RAMBlock *rb, void *host_addr); --=20 2.53.0 From nobody Sat Sep 26 19:12:10 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1790350887; cv=none; d=zohomail.com; s=zohoarc; b=oB0o7Ri8LhpFbZWU+Hd873tUykbUslljb3OIjPku99FnrLK65trLMSa4Cn+biIOJuNGcsNIbVL6ZzwzIo17r5VmlhN6o/8E9OI0WspdNwsHc8zkEn5mRPXgHwNb2LVaqgnTT4G/v2iBukv9JMWkXyxka9qjALLbm3lNBgAoQSZk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790350887; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yS5g+M/ArDhr1b73HQeW3DJeLuz8kjkGkzHV5VYgDKA=; b=GXh+uyWwyyvGiZt6SVz/x919/jROXVmAQdV3x/0rcKlErrJOfjiL4+DqRSant0v+DMlSN4dRubTeHIXme5NLybLuqxC7m1ewGXnpcvsjzwXNroN0nNWeLHxVeBRXsS47DQixUg4sn271dsro1foqyxqR9sjv4oNVte6dUZZtOd0= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17903508870651004.1040255041061; Fri, 25 Sep 2026 08:41:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA82R-0006iL-O3; Fri, 25 Sep 2026 11:40:39 -0400 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 1xA82Q-0006i5-Ue for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:39 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xA82P-0004cK-4i for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:38 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id C5D471F44E; Fri, 25 Sep 2026 15:40:27 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 8B7C713310; Fri, 25 Sep 2026 15:40:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xxRgCd2VtmqjOwAAD6G6ig:T10 (envelope-from ); Fri, 25 Sep 2026 15:40:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350831; h=from:from:reply-to: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=yS5g+M/ArDhr1b73HQeW3DJeLuz8kjkGkzHV5VYgDKA=; b=d1KRisbTKwbepLKQg5dm1dLo+Nn3MRZkKBCQW1sfpJd98oNYN+PKCwY+wd28cP/m6e3r6L rh6EiE9UlsEn6spITmxf+7cd9STucYIu+ooHozE8uAYrwmIWo09YFMllHzHMwLaETKwi3Q w6l+NL4fU1GNjVynABLLe1X1BgkX0uY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350831; h=from:from:reply-to: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=yS5g+M/ArDhr1b73HQeW3DJeLuz8kjkGkzHV5VYgDKA=; b=4/8hiFrvnOypwBWUY+rndmry8zrIsN/Jx07OFH+SUVJYsWubohfEozn7Z2bMmaX7I4kWPX VhxIy8UwJ9KPMxDg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350827; h=from:from:reply-to: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=yS5g+M/ArDhr1b73HQeW3DJeLuz8kjkGkzHV5VYgDKA=; b=BFlzmU5ZnVqJfcRt16Ho/l+JCzV7mXFosNfBG3OH6md7eQ7wI3dhuAGeZi3l9cRU1Xz1sr j1ti3wfDnKb/ugTlIFpaeVqZ0lH0hNhPB8ku9xW75gFefOUKwqhj21u/kvc4KqvAjXQePm DRtSReMn1L4if+v15kyYPzx0xOLlVg4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350827; h=from:from:reply-to: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=yS5g+M/ArDhr1b73HQeW3DJeLuz8kjkGkzHV5VYgDKA=; b=Vm8kaIicn64cJARbR5XYzfqHPE9v6AVkXJ/OalKi0zsiyVVV68R5k8ajVS1N+TiHpM3ghS xDJLZ42zHevMauDQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Yanfei Xu , Jack Wang Subject: [PULL 09/19] migration/rdma: Drain writes at RAM round boundaries Date: Fri, 25 Sep 2026 12:40:00 -0300 Message-ID: <20260925154010.599247-10-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260925154010.599247-1-farosas@suse.de> References: <20260925154010.599247-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.997]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email,bytedance.com:email,ionos.com:email,imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de 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, 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: qemu development 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 @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1790350888344158500 Content-Type: text/plain; charset="utf-8" From: Yanfei Xu rdma_registration_stop() runs after every ram_save_iterate() call, which can stop before a complete RAM scan because of rate limiting. Draining there ties the completion barrier to a SaveVM section rather than the point where the scan wraps and a newer page version can be sent. Register an RDMA RAM round notifier that drains all outstanding writes. Keep posting the buffered tail in rdma_registration_stop() so it remains ordered before REGISTER_FINISHED. Signed-off-by: Yanfei Xu Reviewed-by: Peter Xu Tested-by: Jack Wang Signed-off-by: Fabiano Rosas --- migration/rdma.c | 58 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 11 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 35d918ec83..7d220acef8 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -2636,21 +2636,16 @@ static ssize_t qio_channel_rdma_readv(QIOChannel *i= oc, return done; } =20 -/* - * Block until all the outstanding chunks have been delivered by the hardw= are. - */ -static int qemu_rdma_drain_cq(RDMAContext *rdma) +/* Block until all outstanding writes have been delivered by the hardware.= */ +static int qemu_rdma_drain_cq(RDMAContext *rdma, Error **errp) { - Error *err =3D NULL; - - if (qemu_rdma_write_flush(rdma, &err) < 0) { - error_report_err(err); + if (qemu_rdma_write_flush(rdma, errp) < 0) { return -1; } =20 while (rdma->nb_sent) { if (qemu_rdma_block_for_wrid(rdma, RDMA_WRID_RDMA_WRITE, NULL) < 0= ) { - error_report("rdma migration: complete polling error!"); + error_setg(errp, "rdma migration: completion polling error"); return -1; } } @@ -2658,6 +2653,38 @@ static int qemu_rdma_drain_cq(RDMAContext *rdma) return 0; } =20 +static int rdma_ram_round_notify(NotifierWithReturn *n G_GNUC_UNUSED, + void *data, Error **errp) +{ + RAMRoundNotifyData *round_data =3D data; + QEMUFile *f; + QIOChannelRDMA *rioc; + RDMAContext *rdma; + + if (!migrate_rdma()) { + return 0; + } + + f =3D round_data->file; + RCU_READ_LOCK_GUARD(); + rioc =3D QIO_CHANNEL_RDMA(qemu_file_get_ioc(f)); + rdma =3D qatomic_rcu_read(&rioc->rdmaout); + if (!rdma) { + error_setg(errp, "RDMA output context is not set"); + return -1; + } + + if (rdma_errored(rdma)) { + error_setg(errp, "RDMA is in an error state"); + return -1; + } + + return qemu_rdma_drain_cq(rdma, errp); +} + +static NotifierWithReturn rdma_ram_round_notifier =3D { + .notify =3D rdma_ram_round_notify, +}; =20 static int qio_channel_rdma_set_blocking(QIOChannel *ioc, bool blocking, @@ -3558,7 +3585,8 @@ int rdma_registration_start(QEMUFile *f, uint64_t fla= gs) =20 /* * Inform dest that dynamic registrations are done for now. - * First, flush writes, if any. + * Post any buffered write before sending the control marker. Outstanding + * writes are drained at the RAM scan round boundary. */ int rdma_registration_stop(QEMUFile *f, uint64_t flags) { @@ -3584,9 +3612,10 @@ int rdma_registration_stop(QEMUFile *f, uint64_t fla= gs) } =20 qemu_fflush(f); - ret =3D qemu_rdma_drain_cq(rdma); + ret =3D qemu_rdma_write_flush(rdma, &err); =20 if (ret < 0) { + error_report_err(err); goto err; } =20 @@ -3720,6 +3749,13 @@ static void qio_channel_rdma_register_types(void) =20 type_init(qio_channel_rdma_register_types); =20 +static void rdma_register_migration_notifiers(void) +{ + ram_round_add_notifier(&rdma_ram_round_notifier); +} + +migration_init(rdma_register_migration_notifiers); + static QIOChannel *rdma_new_input(RDMAContext *rdma) { QIOChannelRDMA *rioc =3D QIO_CHANNEL_RDMA(object_new(TYPE_QIO_CHANNEL_= RDMA)); --=20 2.53.0 From nobody Sat Sep 26 19:12:10 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1790350992; cv=none; d=zohomail.com; s=zohoarc; b=ldV/fG3KDqmEDVAeHbkHegFIFw/Am6JO4gqwqRvgv+4BuvsLoHURFAfp3SKylQiQV4Xfcabhctr2U53zFhT8u+sSkzYjMa7r+/r7cAAMUTMHGIgPKskWaIt9zvbyvPLcrqSk9VegjPG1w4Em+CjSvaI2QdOHdWKOXeeKO8RoIq8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790350992; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZJ1m1CY+5yotCAkfbobTcXoVHjPVSpp0h7o/ODhYa3w=; b=VbboVAwIkTgVyO5hfeGEbt/ebbJn3Ia8SW7WjEZtnS4eZPe0cGFSCyjxbPbU2FsGWbB2yZQaPU6iqR8djDnfQyeIbdEmApkrodRYMFwnApvEx5XEOwfFuA92hpjtIXQGsw86z2tyG243hS/VUDojle5X4we2HEFmOrtu55EMP00= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790350992933840.013136493468; Fri, 25 Sep 2026 08:43:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA82T-0006jB-QZ; Fri, 25 Sep 2026 11:40:41 -0400 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 1xA82S-0006iS-Hh for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:40 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xA82Q-0004cR-NR for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:40 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 43E0B1F7D3; Fri, 25 Sep 2026 15:40:29 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 091C21333B; Fri, 25 Sep 2026 15:40:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xxRgCd2VtmqjOwAAD6G6ig:T11 (envelope-from ); Fri, 25 Sep 2026 15:40:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350833; h=from:from:reply-to: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=ZJ1m1CY+5yotCAkfbobTcXoVHjPVSpp0h7o/ODhYa3w=; b=DSzxsDdJX3/H7ZeVYpDulQIT80FPCKmJNuKjhwFJmWtTvZtykQAogHXtNL9MdXPLGtw3pL +GptUrcDRL7oPtsQNEGsjwE6bE+HJRqHkO3GZgBc6CEevzDyF0bHmMNRsHTE9pdYSUIyjq upKNeblDB4jgSEWuC2DnkBbg08oahmM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350833; h=from:from:reply-to: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=ZJ1m1CY+5yotCAkfbobTcXoVHjPVSpp0h7o/ODhYa3w=; b=lxJ3uf/vEh2xfSXpdZZ5qitLqMmPwR9jaKIjc0o0VKLN01weOhGstaRaZeOFoPr+udTc3Q zUFpzu86zMtnwdAQ== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=hKjeRZbG; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=937MJ+mg DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350829; h=from:from:reply-to: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=ZJ1m1CY+5yotCAkfbobTcXoVHjPVSpp0h7o/ODhYa3w=; b=hKjeRZbGogME7/CQBZdw6I88HScnoM/NVuL0ShtjPgaBgvo7FsUfUbdG6BGnYaHzGxTczH Hn6Q1igsBHuJckmtq+Idtil7FnLa64NNGdQvubGq6R2JIRckV7T32CRY3eceqP37nI58/4 Xc4AFI6gtSLRPXTFn/IbJX14md1zmwM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350829; h=from:from:reply-to: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=ZJ1m1CY+5yotCAkfbobTcXoVHjPVSpp0h7o/ODhYa3w=; b=937MJ+mgBdzfumeoHbJk6eqByqAh4qWwjOBK7m1DVcSxPV3KtQ3H8UhPqcimEpgFQH65Iq NY9xhN3jokSasIBQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Yanfei Xu , Jack Wang Subject: [PULL 10/19] migration/rdma: Allow multiple in-flight writes per chunk Date: Fri, 25 Sep 2026 12:40:01 -0300 Message-ID: <20260925154010.599247-11-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260925154010.599247-1-farosas@suse.de> References: <20260925154010.599247-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.01 X-Rspamd-Queue-Id: 43E0B1F7D3 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Action: no action X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received,2a07:de40:b281:104:10:150:64:97:from]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_TLS_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,ionos.com:email,bytedance.com:email,suse.de:dkim,suse.de:email,suse.de:mid]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+] 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=lists1p.gnu.org; Received-SPF: pass client-ip=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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: qemu development 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 @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1790350994837158500 Content-Type: text/plain; charset="utf-8" From: Yanfei Xu qemu_rdma_write_one() waits for an earlier write that shares the same registration chunk, even when the dirty ranges do not overlap. This serializes sparse writes and leaves send queue capacity unused. RAM round notifiers now provide the completion barrier before a newer page version can be sent, and the obsolete unregister path no longer requires per-chunk serialization. Remove the wait. The global nb_sent count continues to manage CQ and send queue resources. Signed-off-by: Yanfei Xu Reviewed-by: Peter Xu Tested-by: Jack Wang Signed-off-by: Fabiano Rosas --- migration/rdma.c | 19 +------------------ migration/trace-events | 1 - 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 7d220acef8..da5dff2f9b 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -1769,7 +1769,7 @@ static int qemu_rdma_write_one(RDMAContext *rdma, { struct ibv_sge sge; struct ibv_send_wr send_wr =3D { 0 }; - int reg_result_idx, ret, count =3D 0; + int reg_result_idx, ret; uint64_t chunk, chunks; uint64_t chunk_size =3D migrate_rdma_chunk_size(); uint8_t *chunk_start, *chunk_end; @@ -1800,23 +1800,6 @@ static int qemu_rdma_write_one(RDMAContext *rdma, =20 chunk_end =3D ram_chunk_end(block, chunk + chunks); =20 - - while (test_bit(chunk, block->transit_bitmap)) { - (void)count; - trace_rdma_write_one_block(count++, current_index, chunk, - sge.addr, length, rdma->nb_sent, block->nb_chunks); - - ret =3D qemu_rdma_block_for_wrid(rdma, RDMA_WRID_RDMA_WRITE, NULL); - - if (ret < 0) { - error_setg(errp, "Failed to Wait for previous write to complet= e " - "block %d chunk %" PRIu64 - " current %" PRIu64 " len %" PRIu64 " %d", - current_index, chunk, sge.addr, length, rdma->nb_sent); - return -1; - } - } - if (!rdma->pin_all) { if (!block->remote_keys[chunk]) { /* diff --git a/migration/trace-events b/migration/trace-events index 2ee2c8f212..00ac737aa9 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -243,7 +243,6 @@ rdma_register_odp_mr(const char *name) "Try to register= On-Demand Paging memory rdma_advise_mr(const char *name, uint32_t len, uint64_t addr, const char *= res) "Try to advise block %s prefetch at %" PRIu32 "@0x%" PRIx64 ": %s" rdma_resolve_host_trying(const char *host, const char *ip) "Trying %s =3D>= %s" rdma_write_flush(int sent) "sent total: %d" -rdma_write_one_block(int count, int block, uint64_t chunk, uint64_t curren= t, uint64_t len, int nb_sent, int nb_chunks) "(%d) Not clobbering: block: %= d chunk %" PRIu64 " current %" PRIu64 " len %" PRIu64 " %d %d" rdma_write_one_post(uint64_t chunk, long addr, long remote, uint32_t len) = "Posting chunk: %" PRIu64 ", addr: 0x%lx remote: 0x%lx, bytes %" PRIu32 rdma_post_send_queue_full(uint64_t wr_id, int sent) "send queue full, wr_i= d=3D%" PRIu64 ", outstanding writes=3D%d" rdma_write_one_recvregres(int mykey, int theirkey, uint64_t chunk) "Receiv= ed registration result: my key: 0x%x their key 0x%x, chunk %" PRIu64 --=20 2.53.0 From nobody Sat Sep 26 19:12:10 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1790350910; cv=none; d=zohomail.com; s=zohoarc; b=V3OHCOKrzj7wSmxujzckT4vPU0XS/nfuvvTAqkymd0fL+tGm52dmvCdca0uqJ4f/c5KK+OEEH8c46bijk6qQsM5jot90yD5jOR6orIRivtqMHBfLfTPk+owLjjtQpK/VyEl9Hs7taWAKsea3WzIzIfGP/4ftJkkRDNYltI55tBo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790350910; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+G12ss+6Bd8+EazhCD6uIyuAyXQ3cIZopSQxJRJcs2o=; b=aVOQq3lEpx3l8ZRXx+mY9LwcscORDgY8id05h+p+v8BEtqrqTfri5BcaxsqYenVL9oZKl7KJubvteDUaSbaSONBJ0WmQynR84o8KimOOkq+aBmwWwmx9WCgPXv3KPjeLT3hLGYVLGO5PFQra1/r1cHKzC2Hk1JCVYHdhsW2vsN4= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790350910347661.7431290468103; Fri, 25 Sep 2026 08:41:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA82V-0006k3-KG; Fri, 25 Sep 2026 11:40:43 -0400 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 1xA82U-0006jF-1i for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:42 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xA82S-0004ch-3B for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:41 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B66C81FFD7; Fri, 25 Sep 2026 15:40:30 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 7AEF613274; Fri, 25 Sep 2026 15:40:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xxRgCd2VtmqjOwAAD6G6ig:T12 (envelope-from ); Fri, 25 Sep 2026 15:40:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350834; h=from:from:reply-to: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=+G12ss+6Bd8+EazhCD6uIyuAyXQ3cIZopSQxJRJcs2o=; b=Mk6E1SH+cv+dxvRPdlI0BZYa6pkPSig2dX3qQPsUbetXc6rS1VexZ1yrPauWr0kGKJImcB TUST2WmDcFRiOa8RNf+2/zquwtz2mA5pE+SwIjEyqyiplP5TZdSaYcB0eH3VC3jzhtdn9D URoeKZJqnlv6pazeYQFuA+1uXi11B68= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350834; h=from:from:reply-to: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=+G12ss+6Bd8+EazhCD6uIyuAyXQ3cIZopSQxJRJcs2o=; b=3WNKu3Pa/KY8klk95/qo5p8+t9Pg3aFa2eAkqwiPhO6PSJTb/HyA8Mt8Mo61kX/wFxsNly 1phi65FK6ZWuK8Aw== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350830; h=from:from:reply-to: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=+G12ss+6Bd8+EazhCD6uIyuAyXQ3cIZopSQxJRJcs2o=; b=eCLVmBfc1MxFCljsAffJouDBMUitmx11o8H8PcWUSofNRgFaXngKbOHu5yg7n1Uit4fQMm l4ejGM2UCDWsivmM0mXHdfOTcX/bw0z1C8fh0dfH4t4ocm68jBmH4TewclnHC30nPR38eo kAbh7mojIqDaIU+CjkYD6WP3DCyuB54= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350830; h=from:from:reply-to: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=+G12ss+6Bd8+EazhCD6uIyuAyXQ3cIZopSQxJRJcs2o=; b=XeCxx8qcbHFLBaihHB3fBdbaY9JwPx6R4xbLEc9iIGjs3TEtFllAosvDy26KImG6EsU/qw sbHixiKNwjWPJMCg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Yanfei Xu , Jack Wang Subject: [PULL 11/19] migration/rdma: Remove unused transit bitmap Date: Fri, 25 Sep 2026 12:40:02 -0300 Message-ID: <20260925154010.599247-12-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260925154010.599247-1-farosas@suse.de> References: <20260925154010.599247-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.997]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[ionos.com:email,suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo,bytedance.com:email]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de 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, 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: qemu development 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 @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1790350912559158500 Content-Type: text/plain; charset="utf-8" From: Yanfei Xu After the per-chunk write wait is removed, transit_bitmap is no longer read. The remaining set and clear operations only maintain unused state. Remove the bitmap and simplify the block lifecycle tracepoints. Signed-off-by: Yanfei Xu Reviewed-by: Peter Xu Tested-by: Jack Wang Signed-off-by: Fabiano Rosas --- migration/rdma.c | 20 +++----------------- migration/trace-events | 4 ++-- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index da5dff2f9b..444123cbca 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -30,7 +30,6 @@ #include "qemu/module.h" #include "qemu/rcu.h" #include "qemu/sockets.h" -#include "qemu/bitmap.h" #include "qemu/coroutine.h" #include "system/memory.h" #include @@ -197,7 +196,6 @@ typedef struct RDMALocalBlock { int index; /* which block are we */ unsigned int src_index; /* (Only used on dest) */ int nb_chunks; - unsigned long *transit_bitmap; } RDMALocalBlock; =20 /* @@ -571,8 +569,6 @@ static void rdma_add_block(RDMAContext *rdma, const cha= r *block_name, block->index =3D local->nb_blocks; block->src_index =3D ~0U; /* Filled in by the receipt of the block lis= t */ block->nb_chunks =3D ram_chunk_index(host_addr, host_addr + length) + = 1UL; - block->transit_bitmap =3D bitmap_new(block->nb_chunks); - bitmap_clear(block->transit_bitmap, 0, block->nb_chunks); block->remote_keys =3D g_new0(uint32_t, block->nb_chunks); =20 if (rdma->blockmap) { @@ -583,8 +579,6 @@ static void rdma_add_block(RDMAContext *rdma, const cha= r *block_name, (uintptr_t) block->local_host_addr, block->offset, block->length, (uintptr_t) (block->local_host_addr + block->leng= th), - BITS_TO_LONGS(block->nb_chunks) * - sizeof(unsigned long) * 8, block->nb_chunks); =20 local->nb_blocks++; @@ -654,9 +648,6 @@ static void rdma_delete_block(RDMAContext *rdma, RDMALo= calBlock *block) block->mr =3D NULL; } =20 - g_free(block->transit_bitmap); - block->transit_bitmap =3D NULL; - g_free(block->remote_keys); block->remote_keys =3D NULL; =20 @@ -693,9 +684,8 @@ static void rdma_delete_block(RDMAContext *rdma, RDMALo= calBlock *block) =20 trace_rdma_delete_block(block, (uintptr_t)block->local_host_addr, block->offset, block->length, - (uintptr_t)(block->local_host_addr + block->le= ngth), - BITS_TO_LONGS(block->nb_chunks) * - sizeof(unsigned long) * 8, block->nb_chunks= ); + (uintptr_t)(block->local_host_addr + block->len= gth), + block->nb_chunks); =20 g_free(old); =20 @@ -1221,8 +1211,6 @@ static int qemu_rdma_poll(RDMAContext *rdma, struct i= bv_cq *cq, index, chunk, block->local_host_addr, (void *)(uintptr_t)block->remote_host_a= ddr); =20 - clear_bit(chunk, block->transit_bitmap); - if (rdma->nb_sent > 0) { rdma->nb_sent--; } @@ -1905,8 +1893,7 @@ static int qemu_rdma_write_one(RDMAContext *rdma, /* * Encode the ram block index and chunk within this wrid. * We will use this information at the time of completion - * to figure out which bitmap to check against and then which - * chunk in the bitmap to look for. + * to identify the completed write in trace output. */ send_wr.wr_id =3D qemu_rdma_make_wrid(RDMA_WRID_RDMA_WRITE, current_index, chunk); @@ -1925,7 +1912,6 @@ static int qemu_rdma_write_one(RDMAContext *rdma, return -1; } =20 - set_bit(chunk, block->transit_bitmap); qatomic_add(&mig_stats.normal_pages, sge.length / qemu_target_page_siz= e()); /* * We are adding to transferred the amount of data written, but no diff --git a/migration/trace-events b/migration/trace-events index 00ac737aa9..db911fe6f2 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -249,9 +249,9 @@ rdma_write_one_recvregres(int mykey, int theirkey, uint= 64_t chunk) "Received reg rdma_write_one_sendreg(uint64_t chunk, int len, int index, int64_t offset)= "Sending registration request chunk %" PRIu64 " for %d bytes, index: %d, o= ffset: %" PRId64 rdma_write_one_top(uint64_t chunks, uint64_t size) "Writing %" PRIu64 " ch= unks, (%" PRIu64 " MB)" rdma_write_one_zero(uint64_t chunk, int len, int index, int64_t offset) "E= ntire chunk is zero, sending compress: %" PRIu64 " for %d bytes, index: %d,= offset: %" PRId64 -rdma_add_block(const char *block_name, int block, uint64_t addr, uint64_t = offset, uint64_t len, uint64_t end, uint64_t bits, int chunks) "Added Block= : '%s':%d, addr: %" PRIu64 ", offset: %" PRIu64 " length: %" PRIu64 " end: = %" PRIu64 " bits %" PRIu64 " chunks %d" +rdma_add_block(const char *block_name, int block, uint64_t addr, uint64_t = offset, uint64_t len, uint64_t end, int chunks) "Added Block: '%s':%d, addr= : %" PRIu64 ", offset: %" PRIu64 " length: %" PRIu64 " end: %" PRIu64 " chu= nks %d" rdma_block_notification_handle(const char *name, int index) "%s at %d" -rdma_delete_block(void *block, uint64_t addr, uint64_t offset, uint64_t le= n, uint64_t end, uint64_t bits, int chunks) "Deleted Block: %p, addr: %" PR= Iu64 ", offset: %" PRIu64 " length: %" PRIu64 " end: %" PRIu64 " bits %" PR= Iu64 " chunks %d" +rdma_delete_block(void *block, uint64_t addr, uint64_t offset, uint64_t le= n, uint64_t end, int chunks) "Deleted Block: %p, addr: %" PRIu64 ", offset:= %" PRIu64 " length: %" PRIu64 " end: %" PRIu64 " chunks %d" rdma_registration_handle_compress(int64_t length, int index, int64_t offse= t) "Zapping zero chunk: %" PRId64 " bytes, index %d, offset %" PRId64 rdma_registration_handle_finished(void) "" rdma_registration_handle_ram_blocks(void) "" --=20 2.53.0 From nobody Sat Sep 26 19:12:10 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1790350917; cv=none; d=zohomail.com; s=zohoarc; b=JEu6TRMdguT8ljHabRMl+kIYqFliAK35xNp0sBtERJoYV+CaV/JwPJ/9uSnOfMemeId5tSRJ0+s7E6eVBz4KNT8IakqyyJnZfx3J8+sLRrqSipPmwi5qVTu1hP4+zKcX3/VsEC0GClpF/4QbETy/kGKBIjxOpB8DY4q4+rVGGbo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790350917; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GOpER+kyEWo8fW1URf1jlOhjhXIM/Qlj5C5S6Edhpm0=; b=oAUuGBjoQYsH6Wy2XZ1SXE0gOu+UqtQQuVGs4vq8o+GXdd4Zx02wuqoR3fBTxbbakwRwZH7qs+jX/CZF2geidYVBnrPGliObBgluTN7LOFLrSfEoi++CLq1EMxF7O5sdKWOeHJMYNvtXiBMf+gRQPrxOb5eQ9MweuObGkJSkahM= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790350917608714.4504766083821; Fri, 25 Sep 2026 08:41:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA82W-0006kn-TI; Fri, 25 Sep 2026 11:40:44 -0400 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 1xA82U-0006jc-Q5 for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:42 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xA82T-0004ct-9R for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:42 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id D6C0520049; Fri, 25 Sep 2026 15:40:31 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id ED58513297; Fri, 25 Sep 2026 15:40:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xxRgCd2VtmqjOwAAD6G6ig:T13 (envelope-from ); Fri, 25 Sep 2026 15:40:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350836; h=from:from:reply-to: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=GOpER+kyEWo8fW1URf1jlOhjhXIM/Qlj5C5S6Edhpm0=; b=HTE+g6K9C02wQCJNcmOowTU+7al1ypQgcZD+fyIqZaC3ma1XycW2L0REyd9uN9jwkBSUGK HKOSJAdklN+XPNpODUKyI3Zjk4xW66WcCsRMs3USejUuXwC974tFaH4TId78/H+Pov6Nnk rMhTfIa5XdFaFweIuhIXyLx1BpDPnP8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350836; h=from:from:reply-to: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=GOpER+kyEWo8fW1URf1jlOhjhXIM/Qlj5C5S6Edhpm0=; b=DhiKjxOsUuR+dojYDllxHI/5pJWeg/ewRoPeqlwrwwdmv4VOUW3aWAh1D31xw5g+ezpGG/ Pi5qTeO7Ar9n3uBw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=tVUl4qAu; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=CnG8wFoN DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350831; h=from:from:reply-to: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=GOpER+kyEWo8fW1URf1jlOhjhXIM/Qlj5C5S6Edhpm0=; b=tVUl4qAu8uPp1xE9qMA0zFEIrfbv3lcoPA/jTRUyvXO163SaQSh6+eWiwseai3tP6vKsNk zJPIpoKOsN/FuVUG6n+VStLjIYuhDYJj9b3gFyiokhFiCg9iou76MCao8JCeIpWH1oETyT yM1uhmWlOb5ohrMHWKYmRR1xfpnNkzE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350831; h=from:from:reply-to: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=GOpER+kyEWo8fW1URf1jlOhjhXIM/Qlj5C5S6Edhpm0=; b=CnG8wFoNK3WtMgxhNPu9Q4yiLR9FfIoVU7/1fbRepi0eBYjFvXX37IAnfr96bX9YjDch1r CFCJEEX+UrvOMoAg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu Subject: [PULL 12/19] migration/options.c: Don't export migrate_tls_opts_free Date: Fri, 25 Sep 2026 12:40:03 -0300 Message-ID: <20260925154010.599247-13-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260925154010.599247-1-farosas@suse.de> References: <20260925154010.599247-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: D6C0520049 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received,2a07:de40:b281:104:10:150:64:97:from]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCVD_TLS_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo,suse.de:dkim,suse.de:email,suse.de:mid]; RCVD_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[suse.de:+] X-Spam-Score: -3.01 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de 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, 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: qemu development 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 @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1790350918256158500 Content-Type: text/plain; charset="utf-8" The migrate_tls_opts_free function was never used outside options.c. Make it static. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/options.c | 2 +- migration/options.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/migration/options.c b/migration/options.c index 05b026f4bf..f4bba8ca26 100644 --- a/migration/options.c +++ b/migration/options.c @@ -1063,7 +1063,7 @@ AnnounceParameters *migrate_announce_params(void) return ≈ } =20 -void migrate_tls_opts_free(MigrationParameters *params) +static void migrate_tls_opts_free(MigrationParameters *params) { qapi_free_StrOrNull(params->tls_creds); qapi_free_StrOrNull(params->tls_hostname); diff --git a/migration/options.h b/migration/options.h index b46221998a..c272eb6208 100644 --- a/migration/options.h +++ b/migration/options.h @@ -93,5 +93,4 @@ uint64_t migrate_rdma_chunk_size(void); =20 bool migrate_params_check(MigrationParameters *params, Error **errp); void migrate_params_init(MigrationParameters *params); -void migrate_tls_opts_free(MigrationParameters *params); #endif --=20 2.53.0 From nobody Sat Sep 26 19:12:10 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1790350964; cv=none; d=zohomail.com; s=zohoarc; b=PjlMvkwmrHeSYiMTnzB12jASz9Nhn+qxveMer3Jon0Bo3T40LJLGZN1lKbKNyA640RQ//0S22mn8WmaJa1Cq4ruYoum71T84wm9pIxbZP8xRCK8A2DfKIgkZHT5CafKNva5KQ+qOgEutcsrFWKIjlnA2+qThxjhfxVjnT1Pi4F4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790350964; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=64Xq9U2HGefS91lpIZP3cCz+meKL3Vo4eC1IGiTJXI8=; b=DKIZ+bGg4zTmWnwlfSYlj+VAP3WuE3yIfaTtnN3kgH5ee2uXZYqLbIQvgQfQBN5P9KvtKk1221TEpaN2er2RmjLPisEUYPVsUSu/4ReiKV8aSjIK/elJA8isp73RvcD7MQ+YFMMVr6QwM3hbB+HybI3yQyoj7Njeifs5evl19pw= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790350964944283.657306557648; Fri, 25 Sep 2026 08:42:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA82X-0006l1-J1; Fri, 25 Sep 2026 11:40:45 -0400 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 1xA82V-0006k7-Pn for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:44 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xA82U-0004d4-9l for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:43 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id EBDF21FF6D; Fri, 25 Sep 2026 15:40:32 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 11CB41333E; Fri, 25 Sep 2026 15:40:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xxRgCd2VtmqjOwAAD6G6ig:T14 (envelope-from ); Fri, 25 Sep 2026 15:40:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350837; h=from:from:reply-to: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=64Xq9U2HGefS91lpIZP3cCz+meKL3Vo4eC1IGiTJXI8=; b=0UI23bxF23XOHdTu0ZF7D+BOWDttX3WJhoUNhpkFkwJyAJe1ywqWuG6umNJkflSucSqSc3 2FHFeukMA1R7nibxNlH6137JMWdhlzdshAd85wqo9/zCQUujWyWKDyCojpSiTzTxm1AP7R ROj3rHpoCLfIhntg83lOj8opdnZj7+M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350837; h=from:from:reply-to: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=64Xq9U2HGefS91lpIZP3cCz+meKL3Vo4eC1IGiTJXI8=; b=ZTXb7uL9J/U6iO5pq1u//HpjcR12cRj+aYELbLU43J6QCZME+MuaoBWU0F2876cpbNoaqg M/42t3tbuOIeONAw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="IP/MBTE+"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=wfY9dBbe DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350832; h=from:from:reply-to: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=64Xq9U2HGefS91lpIZP3cCz+meKL3Vo4eC1IGiTJXI8=; b=IP/MBTE+k8maFwcPvpV7WmQXqkkBcmzJwM4jxNHwle/jD3H+m5gMSkatIbnDv3Xz0kaOB9 a3faacR4r+zI9GXOepXE/bBSqo11iCspiI1Besmq3sLLydxweFd7ZLPjoY+Nhb9agU2T2s /NaI50wXlFiwoWlNBZE8C/kCPaGZacg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350832; h=from:from:reply-to: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=64Xq9U2HGefS91lpIZP3cCz+meKL3Vo4eC1IGiTJXI8=; b=wfY9dBbedKWrVdlKxhNs0AmzXNhRHXJNpfzmbCDvL6j8Xa/pNkPsam/Tn1Us0UxKrD7rzq wo1Vxk5N5a9fI6BA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu Subject: [PULL 13/19] migration: Rename variables in qmp_migrate_set_parameters Date: Fri, 25 Sep 2026 12:40:04 -0300 Message-ID: <20260925154010.599247-14-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260925154010.599247-1-farosas@suse.de> References: <20260925154010.599247-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: EBDF21FF6D X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from,2a07:de40:b281:106:10:150:64:167:received]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCVD_TLS_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo,suse.de:dkim,suse.de:email,suse.de:mid]; RCVD_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[suse.de:+] X-Spam-Score: -3.01 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de 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, 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: qemu development 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 @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1790350966579158500 Content-Type: text/plain; charset="utf-8" Give the variables in qmp_migrate_set_parameters more semantic names. s/params/input/ this is the user input from qapi s/tmp/new/ this is the combination of the current parameters and the input Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/options.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/migration/options.c b/migration/options.c index f4bba8ca26..3ce15497f8 100644 --- a/migration/options.c +++ b/migration/options.c @@ -1599,9 +1599,9 @@ static void migrate_params_apply(MigrationParameters = *params) } } =20 -void qmp_migrate_set_parameters(MigrationParameters *params, Error **errp) +void qmp_migrate_set_parameters(MigrationParameters *input, Error **errp) { - MigrationParameters tmp; + MigrationParameters new; =20 /* * Convert QTYPE_QNULL and NULL to the empty string (""). Even @@ -1611,18 +1611,18 @@ void qmp_migrate_set_parameters(MigrationParameters= *params, Error **errp) * the options to the rest of the migration code already use * return NULL when the empty string is found. */ - tls_opt_to_str(params->tls_creds); - tls_opt_to_str(params->tls_hostname); - tls_opt_to_str(params->tls_authz); + tls_opt_to_str(input->tls_creds); + tls_opt_to_str(input->tls_hostname); + tls_opt_to_str(input->tls_authz); =20 - migrate_params_test_apply(params, &tmp); + migrate_params_test_apply(input, &new); =20 - if (migrate_params_check(&tmp, errp)) { - migrate_params_apply(params); - migrate_post_update_params(params, errp); + if (migrate_params_check(&new, errp)) { + migrate_params_apply(input); + migrate_post_update_params(input, errp); } =20 - migrate_tls_opts_free(&tmp); - qapi_free_BitmapMigrationNodeAliasList(tmp.block_bitmap_mapping); - qapi_free_strList(tmp.cpr_exec_command); + migrate_tls_opts_free(&new); + qapi_free_BitmapMigrationNodeAliasList(new.block_bitmap_mapping); + qapi_free_strList(new.cpr_exec_command); } --=20 2.53.0 From nobody Sat Sep 26 19:12:10 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1790350889; cv=none; d=zohomail.com; s=zohoarc; b=PfOeXxU8b4q6pcTr6P6DXsTxxmP5vun6UIc+Jt6jJeXaFFPtKlPKOnAv1dIPcMHVIbCAj795FqWpsenX7LDiAbpfiCL4iWbV64c+GIzp4v0/lUc5rSTC9lMloWNk7jV+MBTLUTQcRv4OJKjJC3lN/UTqoB7Si0/k1Ne+A3lDbz8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790350889; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GwXWb79mzGxn+yao6OoforC5cOXb9F1bY7PW2RJHwQI=; b=ZJL+X3BZ9TIvG/u4kIPmGHA6J+88twRrA3MAP6CZAiiaozcKa6SodX6HzQE+91qM9YPaiJH4Ba//YnMbewc+WjXP4qKBi5gmLmf93vg8vOOPFspfdkhbGgyR2Fjzd87HoJa09zfVlxW5wJV7VLNabjTRU3tsKZOD6VI/AuogaCI= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179035088907458.441893308652766; Fri, 25 Sep 2026 08:41:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA82Z-0006lh-GH; Fri, 25 Sep 2026 11:40:47 -0400 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 1xA82X-0006l2-EU for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:45 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xA82V-0004dI-IX for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:45 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 39EBF1FF6F; Fri, 25 Sep 2026 15:40:34 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 2ADA91334C; Fri, 25 Sep 2026 15:40:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xxRgCd2VtmqjOwAAD6G6ig:T15 (envelope-from ); Fri, 25 Sep 2026 15:40:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350838; h=from:from:reply-to: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=GwXWb79mzGxn+yao6OoforC5cOXb9F1bY7PW2RJHwQI=; b=QbhF94zlliUuC9nD5qBKpv9jHCHGop4Y5pgcF4cpZArVtwuyOF1ZOhchtKb5V1pWna2rA9 emtFBJv0f3Xew91Hh5CDXYSJ+rVweyjhnsnyR4VRGLqX1QBewYhnjISLaq0na0ZSHLb/pc iV0gZZiZOLYVxvP/8gHAVK2ph4iqDSM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350838; h=from:from:reply-to: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=GwXWb79mzGxn+yao6OoforC5cOXb9F1bY7PW2RJHwQI=; b=iKhfUtscy6F8OFGZwNib53h6VNMeWVJf50vhk+vSLh7hCNrG4UrkUZBEE4byjWvvXT4OaW +MUbf3Nda89xM/Dg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350834; h=from:from:reply-to: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=GwXWb79mzGxn+yao6OoforC5cOXb9F1bY7PW2RJHwQI=; b=EY+sZuUYQ08/FMXiQ6zyTDcko4BJCu905oKsg2A1KHDVaqozc4IdBfmSHWVXBjUTFAHtiW ltFxF5PJ19G4uA/rxTj7hUR/FwLiv17b+zpL2FxV3hUyWxTisJeG9jdrt+ygwpTzdnUCI0 6Q6xTHALailgjC593/9BGJyaf/zU3rs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350834; h=from:from:reply-to: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=GwXWb79mzGxn+yao6OoforC5cOXb9F1bY7PW2RJHwQI=; b=xRmmBE2ZhgtHq/mXOqVTQ0x9jM6m8uuxmcgSwvr/YeR0CosOFfySCHjtwMlrO1+qLV+dXi rdh1U/utQQUuZ6Dw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Prasad Pandit Subject: [PULL 14/19] migration: Use QAPI_CLONE_MEMBERS in migrate_params_apply Date: Fri, 25 Sep 2026 12:40:05 -0300 Message-ID: <20260925154010.599247-15-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260925154010.599247-1-farosas@suse.de> References: <20260925154010.599247-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.997]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,fedoraproject.org:email,suse.de:mid,suse.de:email]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de 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, 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: qemu development 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 @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1790350890387158500 Content-Type: text/plain; charset="utf-8" Instead of setting parameters one by one, use the temporary object, which already contains the current migration parameters plus the new ones and was just validated by migration_params_check(). Use cloning to overwrite it. This avoids the need to alter this function every time a new parameter is added. Since parameters are not individually checked anymore, the setting of s->has_block_bitmap_mapping moves into migrate_post_update_params(). Reviewed-by: Peter Xu Reviewed-by: Prasad Pandit Signed-off-by: Fabiano Rosas --- migration/options.c | 145 +++++--------------------------------------- 1 file changed, 14 insertions(+), 131 deletions(-) diff --git a/migration/options.c b/migration/options.c index 3ce15497f8..ac7e94ed62 100644 --- a/migration/options.c +++ b/migration/options.c @@ -1168,6 +1168,10 @@ static void migrate_post_update_params(MigrationPara= meters *new, Error **errp) migration_rate_set(new->max_postcopy_bandwidth); } } + + if (new->has_block_bitmap_mapping) { + s->has_block_bitmap_mapping =3D true; + } } =20 /* @@ -1463,140 +1467,19 @@ static void migrate_params_test_apply(MigrationPar= ameters *params, } } =20 +/* + * Caller must ensure the has_* fields of @params are true so they all + * get copied and the pointer members don't dangle. + */ static void migrate_params_apply(MigrationParameters *params) { MigrationState *s =3D migrate_get_current(); + MigrationParameters *cur =3D &s->parameters; =20 - /* TODO use QAPI_CLONE() instead of duplicating it inline */ - - if (params->has_throttle_trigger_threshold) { - s->parameters.throttle_trigger_threshold =3D params->throttle_trig= ger_threshold; - } - - if (params->has_cpu_throttle_initial) { - s->parameters.cpu_throttle_initial =3D params->cpu_throttle_initia= l; - } - - if (params->has_cpu_throttle_increment) { - s->parameters.cpu_throttle_increment =3D params->cpu_throttle_incr= ement; - } - - if (params->has_cpu_throttle_tailslow) { - s->parameters.cpu_throttle_tailslow =3D params->cpu_throttle_tails= low; - } - - if (params->tls_creds) { - qapi_free_StrOrNull(s->parameters.tls_creds); - s->parameters.tls_creds =3D QAPI_CLONE(StrOrNull, params->tls_cred= s); - } - - if (params->tls_hostname) { - qapi_free_StrOrNull(s->parameters.tls_hostname); - s->parameters.tls_hostname =3D QAPI_CLONE(StrOrNull, - params->tls_hostname); - } - - if (params->tls_authz) { - qapi_free_StrOrNull(s->parameters.tls_authz); - s->parameters.tls_authz =3D QAPI_CLONE(StrOrNull, params->tls_auth= z); - } - - if (params->has_max_bandwidth) { - s->parameters.max_bandwidth =3D params->max_bandwidth; - } - - if (params->has_avail_switchover_bandwidth) { - s->parameters.avail_switchover_bandwidth =3D params->avail_switcho= ver_bandwidth; - } - - if (params->has_downtime_limit) { - s->parameters.downtime_limit =3D params->downtime_limit; - } - - if (params->has_x_checkpoint_delay) { - s->parameters.x_checkpoint_delay =3D params->x_checkpoint_delay; - } - - if (params->has_multifd_channels) { - s->parameters.multifd_channels =3D params->multifd_channels; - } - if (params->has_multifd_compression) { - s->parameters.multifd_compression =3D params->multifd_compression; - } - if (params->has_multifd_qatzip_level) { - s->parameters.multifd_qatzip_level =3D params->multifd_qatzip_leve= l; - } - if (params->has_multifd_zlib_level) { - s->parameters.multifd_zlib_level =3D params->multifd_zlib_level; - } - if (params->has_multifd_zstd_level) { - s->parameters.multifd_zstd_level =3D params->multifd_zstd_level; - } - if (params->has_xbzrle_cache_size) { - s->parameters.xbzrle_cache_size =3D params->xbzrle_cache_size; - } - if (params->has_max_postcopy_bandwidth) { - s->parameters.max_postcopy_bandwidth =3D params->max_postcopy_band= width; - } - if (params->has_max_cpu_throttle) { - s->parameters.max_cpu_throttle =3D params->max_cpu_throttle; - } - if (params->has_announce_initial) { - s->parameters.announce_initial =3D params->announce_initial; - } - if (params->has_announce_max) { - s->parameters.announce_max =3D params->announce_max; - } - if (params->has_announce_rounds) { - s->parameters.announce_rounds =3D params->announce_rounds; - } - if (params->has_announce_step) { - s->parameters.announce_step =3D params->announce_step; - } - - if (params->has_block_bitmap_mapping) { - qapi_free_BitmapMigrationNodeAliasList( - s->parameters.block_bitmap_mapping); - - s->has_block_bitmap_mapping =3D true; - s->parameters.block_bitmap_mapping =3D - QAPI_CLONE(BitmapMigrationNodeAliasList, - params->block_bitmap_mapping); - } - - if (params->has_x_vcpu_dirty_limit_period) { - s->parameters.x_vcpu_dirty_limit_period =3D - params->x_vcpu_dirty_limit_period; - } - if (params->has_vcpu_dirty_limit) { - s->parameters.vcpu_dirty_limit =3D params->vcpu_dirty_limit; - } - - if (params->has_mode) { - s->parameters.mode =3D params->mode; - } - - if (params->has_zero_page_detection) { - s->parameters.zero_page_detection =3D params->zero_page_detection; - } - - if (params->has_direct_io) { - s->parameters.direct_io =3D params->direct_io; - } - - if (params->has_x_rdma_chunk_size) { - s->parameters.x_rdma_chunk_size =3D params->x_rdma_chunk_size; - } - - if (params->has_cpr_exec_command) { - qapi_free_strList(s->parameters.cpr_exec_command); - s->parameters.cpr_exec_command =3D - QAPI_CLONE(strList, params->cpr_exec_command); - } - - if (params->has_local) { - s->parameters.local =3D params->local; - } + migrate_tls_opts_free(cur); + qapi_free_BitmapMigrationNodeAliasList(cur->block_bitmap_mapping); + qapi_free_strList(cur->cpr_exec_command); + QAPI_CLONE_MEMBERS(MigrationParameters, cur, params); } =20 void qmp_migrate_set_parameters(MigrationParameters *input, Error **errp) @@ -1618,7 +1501,7 @@ void qmp_migrate_set_parameters(MigrationParameters *= input, Error **errp) migrate_params_test_apply(input, &new); =20 if (migrate_params_check(&new, errp)) { - migrate_params_apply(input); + migrate_params_apply(&new); migrate_post_update_params(input, errp); } =20 --=20 2.53.0 From nobody Sat Sep 26 19:12:10 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1790350899; cv=none; d=zohomail.com; s=zohoarc; b=QzCEcdKTyZejg+DdNbpu3h9CdpompWA7naUOIy2On273yWaXmKgt84CuyEtGtCgdAr0QHkZDLauZ6EZAHKZs+iyAlKyrYaQe+xcDtR6lBv6jFxmXsA+tYYIUgYLAttL4UCht+VENymZCDYUo28zwuzmvAWkpetnLetDF3Z2dt6o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790350899; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=FoTZXTyVtqGz0iA556+8eviVAzDVcXsSW1coLubitAE=; b=GWmfKB/pQhjLK2yD7dDVsg9n0ZppCbuchWpk2m5TZ47j6t88i9eBs+vvGsEbaEsrLDYPuJ2f2QMNB9dSq6RLTHagmkYRqukoMkG2RpUYUDmiRjyJUBvVqkALOLVb5jx5Fw5EqqBDozSaJyYq1KpF1DDjQxJI42wc6dkglBE+iAI= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790350899226953.9187155041061; Fri, 25 Sep 2026 08:41:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA82c-0006mt-Pc; Fri, 25 Sep 2026 11:40:50 -0400 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 1xA82Z-0006lj-DF for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:47 -0400 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xA82W-0004dV-Np for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:46 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 53E45211CA; Fri, 25 Sep 2026 15:40:35 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 70F8C132C9; Fri, 25 Sep 2026 15:40:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xxRgCd2VtmqjOwAAD6G6ig:T16 (envelope-from ); Fri, 25 Sep 2026 15:40:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350839; h=from:from:reply-to: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=FoTZXTyVtqGz0iA556+8eviVAzDVcXsSW1coLubitAE=; b=m3d1fRcXnLjE99w4mQY3+N8H1y1N5LvgNPgWWXNG2Cr22Caib9GRUKO568rF0Ehg1XcpFz PLp2+cQNsmeZ1V8ZEn0PlLx1szlOSRyZejPKz0U7I9gn9lnXmdnDn5LLWd898ng6CjBGKy j3Uy4FeQ5CEPlCugapBf+TNXy2H5Xyo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350839; h=from:from:reply-to: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=FoTZXTyVtqGz0iA556+8eviVAzDVcXsSW1coLubitAE=; b=iVH/sCbmtYsJ/2gesmaatzKEWH/cmhDAzY7jX469Y81tdSyXWr+zVhRQ08uqc/ijTvH04r 0n3RVZpgYQHfw4CA== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Zxqz5axH; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=OBesEjSF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350835; h=from:from:reply-to: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=FoTZXTyVtqGz0iA556+8eviVAzDVcXsSW1coLubitAE=; b=Zxqz5axHiUKcxDiweEwcIghn3efPxNmJp1U7vlOF0E6XMea3C2eAQw5Q7dkOQt0U0BnG3G pdX0bCx5m/JDlmTOE3LZ3C/k0OGoFRI7wP4pPAY0HIcTl5Qt9x+JgDgQUwjXka5BxeIato vXFuxXl+teYoXz3prR0ksjkx0nzg58Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350835; h=from:from:reply-to: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=FoTZXTyVtqGz0iA556+8eviVAzDVcXsSW1coLubitAE=; b=OBesEjSFB6e5/uSdTS5uEpSs012mrAOPsGKWXMTKs7mH8vMTODorfpXfwQw7nCyq7LI0Zx ysB0hW2LY5PmZiBQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu Subject: [PULL 15/19] migration: Merge parameter structs instead of assigning one by one Date: Fri, 25 Sep 2026 12:40:06 -0300 Message-ID: <20260925154010.599247-16-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260925154010.599247-1-farosas@suse.de> References: <20260925154010.599247-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: 53E45211CA X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received,2a07:de40:b281:104:10:150:64:97:from]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCVD_TLS_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email,suse.de:mid,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[suse.de:+] X-Spam-Score: -3.01 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:1; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de 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, 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: qemu development 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 @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1790350900240158500 Content-Type: text/plain; charset="utf-8" Convert the code in migrate_params_test_apply() from an open-coded copy of every migration parameter to a merge operation using QAPI visitors and QDict. The purpose of that routine is to update a temporary structure (pre-populated with the current migration parameters), with the values received from the user via QAPI. As a result, the temporary structure will then contain the "to be applied" parameters and it's validated before being used to overwrite the parameters currently in use. The update is currently done as follows: where 'params' is the user input from QAPI, for each parameter: a) check if the option is present params->has_ =3D=3D true params-> !=3D NULL // for strings b) if the parameter is a pointer, free the to-be-assigned member and allocate memory for the copy from params c) assign the user provided value to the temporary structure. Step (a) is the same in principle as what the QAPI visitors do at visit_type_MigrationParameters_members(). Steps (b) and (c) are roughly the same as what the QDict implementation does when qdict_del() and qdict_put_obj() are combined. Therefore, replace the open-coded function with migrate_params_merge(), which achieves the same goal, but uses visitors and QDict. This hides the details of QAPI (has_*) from the migration code and avoids the need to update migrate_params_test_apply() every time a new migration parameter is added. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/options.c | 204 ++++++++++++++------------------------------ 1 file changed, 65 insertions(+), 139 deletions(-) diff --git a/migration/options.c b/migration/options.c index ac7e94ed62..0f7478aa6a 100644 --- a/migration/options.c +++ b/migration/options.c @@ -21,6 +21,9 @@ #include "qapi/qapi-commands-migration.h" #include "qapi/qapi-visit-migration.h" #include "qapi/qmp/qerror.h" +#include "qapi/qobject-input-visitor.h" +#include "qapi/qobject-output-visitor.h" +#include "qobject/qdict.h" #include "qobject/qnull.h" #include "system/runstate.h" #include "migration/colo.h" @@ -1082,6 +1085,28 @@ static void tls_opt_to_str(StrOrNull *opt) opt->u.s =3D g_strdup(""); } =20 +static QDict *migrate_params_to_dict(MigrationParameters *p, Error **errp) +{ + QObject *obj =3D NULL; + Visitor *v =3D qobject_output_visitor_new(&obj); + + if (visit_type_MigrationParameters(v, NULL, &p, errp)) { + visit_complete(v, &obj); + } + visit_free(v); + return qobject_to(QDict, obj); +} + +static MigrationParameters *migrate_params_from_dict(QDict *d, Error **err= p) +{ + Visitor *v =3D qobject_input_visitor_new(QOBJECT(d)); + MigrationParameters *tmp =3D NULL; + + visit_type_MigrationParameters(v, NULL, &tmp, errp); + visit_free(v); + return tmp; +} + /* * query-migrate-parameters expects all members of MigrationParameters * to be present, but we cannot mark them non-optional in QAPI because @@ -1174,6 +1199,38 @@ static void migrate_post_update_params(MigrationPara= meters *new, Error **errp) } } =20 +static bool migrate_params_merge(MigrationParameters *base, + MigrationParameters *updates, + MigrationParameters **new, + Error **errp) +{ + g_autoptr(QDict) d_base =3D NULL; + g_autoptr(QDict) d_upd =3D NULL; + const QDictEntry *e; + + d_base =3D migrate_params_to_dict(base, errp); + if (!d_base) { + return false; + } + + d_upd =3D migrate_params_to_dict(updates, errp); + if (!d_upd) { + return false; + } + + for (e =3D qdict_first(d_upd); e; e =3D qdict_next(d_upd, e)) { + const char *key =3D qdict_entry_key(e); + QObject *value =3D qdict_entry_value(e); + + qobject_ref(value); + qdict_put_obj(d_base, key, value); + } + + *new =3D migrate_params_from_dict(d_base, errp); + + return !!*new; +} + /* * Check whether the parameters are valid. Error will be put into errp * (if provided). Return true if valid, otherwise false. @@ -1336,137 +1393,6 @@ bool migrate_params_check(MigrationParameters *para= ms, Error **errp) return true; } =20 -static void migrate_params_test_apply(MigrationParameters *params, - MigrationParameters *dest) -{ - MigrationState *s =3D migrate_get_current(); - - QAPI_CLONE_MEMBERS(MigrationParameters, dest, &s->parameters); - - if (params->has_throttle_trigger_threshold) { - dest->throttle_trigger_threshold =3D params->throttle_trigger_thre= shold; - } - - if (params->has_cpu_throttle_initial) { - dest->cpu_throttle_initial =3D params->cpu_throttle_initial; - } - - if (params->has_cpu_throttle_increment) { - dest->cpu_throttle_increment =3D params->cpu_throttle_increment; - } - - if (params->has_cpu_throttle_tailslow) { - dest->cpu_throttle_tailslow =3D params->cpu_throttle_tailslow; - } - - if (params->tls_creds) { - qapi_free_StrOrNull(dest->tls_creds); - dest->tls_creds =3D QAPI_CLONE(StrOrNull, params->tls_creds); - } - - if (params->tls_hostname) { - qapi_free_StrOrNull(dest->tls_hostname); - dest->tls_hostname =3D QAPI_CLONE(StrOrNull, params->tls_hostname); - } - - if (params->tls_authz) { - qapi_free_StrOrNull(dest->tls_authz); - dest->tls_authz =3D QAPI_CLONE(StrOrNull, params->tls_authz); - } - - if (params->has_max_bandwidth) { - dest->max_bandwidth =3D params->max_bandwidth; - } - - if (params->has_avail_switchover_bandwidth) { - dest->avail_switchover_bandwidth =3D params->avail_switchover_band= width; - } - - if (params->has_downtime_limit) { - dest->downtime_limit =3D params->downtime_limit; - } - - if (params->has_x_checkpoint_delay) { - dest->x_checkpoint_delay =3D params->x_checkpoint_delay; - } - - if (params->has_multifd_channels) { - dest->multifd_channels =3D params->multifd_channels; - } - if (params->has_multifd_compression) { - dest->multifd_compression =3D params->multifd_compression; - } - if (params->has_multifd_qatzip_level) { - dest->multifd_qatzip_level =3D params->multifd_qatzip_level; - } - if (params->has_multifd_zlib_level) { - dest->multifd_zlib_level =3D params->multifd_zlib_level; - } - if (params->has_multifd_zstd_level) { - dest->multifd_zstd_level =3D params->multifd_zstd_level; - } - if (params->has_xbzrle_cache_size) { - dest->xbzrle_cache_size =3D params->xbzrle_cache_size; - } - if (params->has_max_postcopy_bandwidth) { - dest->max_postcopy_bandwidth =3D params->max_postcopy_bandwidth; - } - if (params->has_max_cpu_throttle) { - dest->max_cpu_throttle =3D params->max_cpu_throttle; - } - if (params->has_announce_initial) { - dest->announce_initial =3D params->announce_initial; - } - if (params->has_announce_max) { - dest->announce_max =3D params->announce_max; - } - if (params->has_announce_rounds) { - dest->announce_rounds =3D params->announce_rounds; - } - if (params->has_announce_step) { - dest->announce_step =3D params->announce_step; - } - - if (params->has_block_bitmap_mapping) { - qapi_free_BitmapMigrationNodeAliasList(dest->block_bitmap_mapping); - dest->block_bitmap_mapping =3D QAPI_CLONE(BitmapMigrationNodeAlias= List, - params->block_bitmap_mappi= ng); - } - - if (params->has_x_vcpu_dirty_limit_period) { - dest->x_vcpu_dirty_limit_period =3D - params->x_vcpu_dirty_limit_period; - } - if (params->has_vcpu_dirty_limit) { - dest->vcpu_dirty_limit =3D params->vcpu_dirty_limit; - } - - if (params->has_mode) { - dest->mode =3D params->mode; - } - - if (params->has_zero_page_detection) { - dest->zero_page_detection =3D params->zero_page_detection; - } - - if (params->has_direct_io) { - dest->direct_io =3D params->direct_io; - } - - if (params->has_x_rdma_chunk_size) { - dest->x_rdma_chunk_size =3D params->x_rdma_chunk_size; - } - - if (params->has_cpr_exec_command) { - qapi_free_strList(dest->cpr_exec_command); - dest->cpr_exec_command =3D QAPI_CLONE(strList, params->cpr_exec_co= mmand); - } - - if (params->has_local) { - dest->local =3D params->local; - } -} - /* * Caller must ensure the has_* fields of @params are true so they all * get copied and the pointer members don't dangle. @@ -1484,7 +1410,8 @@ static void migrate_params_apply(MigrationParameters = *params) =20 void qmp_migrate_set_parameters(MigrationParameters *input, Error **errp) { - MigrationParameters new; + MigrationParameters *cur =3D &migrate_get_current()->parameters; + g_autoptr(MigrationParameters) new =3D NULL; =20 /* * Convert QTYPE_QNULL and NULL to the empty string (""). Even @@ -1498,14 +1425,13 @@ void qmp_migrate_set_parameters(MigrationParameters= *input, Error **errp) tls_opt_to_str(input->tls_hostname); tls_opt_to_str(input->tls_authz); =20 - migrate_params_test_apply(input, &new); + /* merge input on top of current */ + if (!migrate_params_merge(cur, input, &new, errp)) { + return; + } =20 - if (migrate_params_check(&new, errp)) { - migrate_params_apply(&new); + if (migrate_params_check(new, errp)) { + migrate_params_apply(new); migrate_post_update_params(input, errp); } - - migrate_tls_opts_free(&new); - qapi_free_BitmapMigrationNodeAliasList(new.block_bitmap_mapping); - qapi_free_strList(new.cpr_exec_command); } --=20 2.53.0 From nobody Sat Sep 26 19:12:10 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1790350913; cv=none; d=zohomail.com; s=zohoarc; b=VDMptqIAhVh6BhOBwdiF+2joI7B+VBjYLbK0VMfyP8mf92YtzrUoIBYlCXnTrVvw+ja30c5GnZrPY7GaPTBa8aqDncGKxL54tPptY/EkhKxBJucwN2c6H/6kR4F89BMYIUPjpHIltSu0kx9E760T6ba+mF+SWGY53GM2/Oux7NU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790350913; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZXM6n2K9OZ73m3J3n6F63FRlHXCPIFdAsdyaQqGrOOw=; b=EpcJJa/9c6rcyNKP/90R5x7KdgB9ydAD457DZcAn251UPCLVEq6dQ820u6+vnWmLC9BPlC5X9jVDfU7sMnD93ywH3NCXJGLKA7HtX7x98qPacKPsyA7CnS4P43hGJ7LLrdZhkF28C1Yp6GKyPqp1TYhtFt+TktVkiLc1wLGWWY4= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790350913199188.43308490033678; Fri, 25 Sep 2026 08:41:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA82b-0006mZ-EE; Fri, 25 Sep 2026 11:40:49 -0400 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 1xA82Z-0006ls-MV for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:47 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xA82Y-0004dc-3K for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:47 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 98AB01F7B9; Fri, 25 Sep 2026 15:40:36 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 8A977132DD; Fri, 25 Sep 2026 15:40:35 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xxRgCd2VtmqjOwAAD6G6ig:T17 (envelope-from ); Fri, 25 Sep 2026 15:40:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350840; h=from:from:reply-to: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=ZXM6n2K9OZ73m3J3n6F63FRlHXCPIFdAsdyaQqGrOOw=; b=IXb+gnmQbofmt44Xo0X2nqZMpIjBlB2z8FT/VmVXfrxz+J1XWov6yb1mT3O/dDS8fjEsRy oQ9K9r4jkJbaxCUHJbaMSUx/zyTzAOSjNpGJ0x3amqyvEygCEBjxueD7I14vD4MsGXoZuS xduLxzAyXaW6e8XlLUlG/hKdK5b1TX8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350840; h=from:from:reply-to: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=ZXM6n2K9OZ73m3J3n6F63FRlHXCPIFdAsdyaQqGrOOw=; b=U2IY8tOvz2ztoIwmyOj0vqs+lLuQYfztdLN3c7WNmAqw4JhOn4DD1OwPC8Z62xAUanPzUm ruqxSVIJVOPDIhBg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350836; h=from:from:reply-to: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=ZXM6n2K9OZ73m3J3n6F63FRlHXCPIFdAsdyaQqGrOOw=; b=cGtRVYWC3+4R/+v2X8A4A5YTuZzmTxggWoXgpAC05WIOR2/n7H05kren5RCasfgW3ZyDXa R0nBHEXoNCkK9GuNmZduRdVnb7uzKIoUArgllQTRy1mrp8NRKVRFdNoQleytJQe2bl04SC nAxwzbhUgxxr61pFy/poMv2WpPWFb5o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350836; h=from:from:reply-to: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=ZXM6n2K9OZ73m3J3n6F63FRlHXCPIFdAsdyaQqGrOOw=; b=3GMVy6nhU574R1dsWOLn6TYm8FOdAnjQJ5l38iF2XnowsIXy5SJNmMjr+C9Mh9CqHlHuWh s1rgVaiWxWSMtaAQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Prasad Pandit Subject: [PULL 16/19] migration: Open code migrate_params_apply Date: Fri, 25 Sep 2026 12:40:07 -0300 Message-ID: <20260925154010.599247-17-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260925154010.599247-1-farosas@suse.de> References: <20260925154010.599247-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.997]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo, suse.de:mid, suse.de:email] 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de 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, 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: qemu development 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 @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1790350914227158500 Content-Type: text/plain; charset="utf-8" Remove migrate_params_apply so the logic of setting migration parameters is all in one spot. Suggested-by: Prasad Pandit Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/options.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/migration/options.c b/migration/options.c index 0f7478aa6a..12f884caa4 100644 --- a/migration/options.c +++ b/migration/options.c @@ -1393,21 +1393,6 @@ bool migrate_params_check(MigrationParameters *param= s, Error **errp) return true; } =20 -/* - * Caller must ensure the has_* fields of @params are true so they all - * get copied and the pointer members don't dangle. - */ -static void migrate_params_apply(MigrationParameters *params) -{ - MigrationState *s =3D migrate_get_current(); - MigrationParameters *cur =3D &s->parameters; - - migrate_tls_opts_free(cur); - qapi_free_BitmapMigrationNodeAliasList(cur->block_bitmap_mapping); - qapi_free_strList(cur->cpr_exec_command); - QAPI_CLONE_MEMBERS(MigrationParameters, cur, params); -} - void qmp_migrate_set_parameters(MigrationParameters *input, Error **errp) { MigrationParameters *cur =3D &migrate_get_current()->parameters; @@ -1430,8 +1415,15 @@ void qmp_migrate_set_parameters(MigrationParameters = *input, Error **errp) return; } =20 - if (migrate_params_check(new, errp)) { - migrate_params_apply(new); - migrate_post_update_params(input, errp); + if (!migrate_params_check(new, errp)) { + return; } + + migrate_tls_opts_free(cur); + qapi_free_BitmapMigrationNodeAliasList(cur->block_bitmap_mapping); + qapi_free_strList(cur->cpr_exec_command); + + QAPI_CLONE_MEMBERS(MigrationParameters, cur, new); + + migrate_post_update_params(input, errp); } --=20 2.53.0 From nobody Sat Sep 26 19:12:10 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1790350951; cv=none; d=zohomail.com; s=zohoarc; b=RRxKpUPmVglcWU9nyWsXDjEOis/us6vWYd4Q1TE9OeAUyZDMTrDtBYK6Z3k/jGmcBnPUcWHeJnBDY15cts7XmT6FoKluxFrdYud6Tndj0LKCjFNO66obpysMTOxv6U8eUxpIfDNLti6FopZdkyI5mridsvAsU8Sf80+3ZKbutZI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790350951; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1hTM0ZCY7OaihXhzw/hVe+idx+ErDM+z3nHvYLW4FaQ=; b=T5bKjZ5ba8YJ0ZTalCCQMAa9MvEwR8F/LhBZ4oTDicXmWeIPf47yMzTOf0cH7zrZL0mvYoWfwuZTQNBryL7pmgikHzzkE0XtEgJKa4p7ps1HAiYzXulpaNzUVYaWWKcMsMYfX7G1KGxOdihX1JII0HlGX2soRYzA1HuM3h+5gns= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790350951641134.47280302008153; Fri, 25 Sep 2026 08:42:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA82e-0006o0-Qa; Fri, 25 Sep 2026 11:40:52 -0400 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 1xA82b-0006ma-G6 for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:49 -0400 Received: from smtp-out1.suse.de ([195.135.223.130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xA82Z-0004dw-E0 for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:49 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B9E1521FBE; Fri, 25 Sep 2026 15:40:37 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D051A13310; Fri, 25 Sep 2026 15:40:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xxRgCd2VtmqjOwAAD6G6ig:T18 (envelope-from ); Fri, 25 Sep 2026 15:40:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350841; h=from:from:reply-to: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=1hTM0ZCY7OaihXhzw/hVe+idx+ErDM+z3nHvYLW4FaQ=; b=FaqsKy/9FiwEEXDeMitizaRgLa7sUrgvmFifXUVPUy1uK4YB58pDmhCvCZgFMh0Wmfabuj qhaF0NF6jNW8GM5+uREGbyygJLLcoCr73AvqVUT9xV/gNOwYXH8gvpdPtNPIUh+OmfEE9l 8cP5QdDI+Ez87imManl9viqGHkK666k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350841; h=from:from:reply-to: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=1hTM0ZCY7OaihXhzw/hVe+idx+ErDM+z3nHvYLW4FaQ=; b=OQfs7VhwP/cwvDT0nCQfRlcl5kQx6iTnMYvLC8JLnZC44iYGhOtlH2XB36ZzqrH0kOGwGu A9V0eWSc4jMfbyDA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350837; h=from:from:reply-to: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=1hTM0ZCY7OaihXhzw/hVe+idx+ErDM+z3nHvYLW4FaQ=; b=W+6mt2ydGk9g9xZEx00KuxOoBqRaQNO4hVqhDvzh4qzp2w2c6HoD4OVbtjfpYSHnc9EaVT l8O3BnhvbVK6vhX1cpaOJDueCkaDykfVJVkStt9WNti+YhhjG6QCzfGsTSpLEDTSjzDazP EQm75iSnUPJtiCl9JeWlHiCbtPxbyo0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350837; h=from:from:reply-to: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=1hTM0ZCY7OaihXhzw/hVe+idx+ErDM+z3nHvYLW4FaQ=; b=mbY7Gi/vWSXsBoSGZnny+8xSIZxhMuU4onzzGKDHVYhhUI8i6twg/Q0WmV/5MneIOkH5zr rfxTzQWtXmd61tAQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu Subject: [PULL 17/19] migration: Stop freeing s->parameters members individually Date: Fri, 25 Sep 2026 12:40:08 -0300 Message-ID: <20260925154010.599247-18-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260925154010.599247-1-farosas@suse.de> References: <20260925154010.599247-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.997]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] 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=lists1p.gnu.org; Received-SPF: pass client-ip=195.135.223.130; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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: qemu development 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 @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1790350952499158500 Content-Type: text/plain; charset="utf-8" Expecting every pointer member from s->parameters to be freed individually is prone to leave some fields forgotten when the code is eventually updated. Use a dealloc visitor to free them all at once. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/options.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/migration/options.c b/migration/options.c index 12f884caa4..bdcff002db 100644 --- a/migration/options.c +++ b/migration/options.c @@ -17,6 +17,7 @@ #include "qapi/util.h" #include "exec/target_page.h" #include "qapi/clone-visitor.h" +#include "qapi/dealloc-visitor.h" #include "qapi/error.h" #include "qapi/qapi-commands-migration.h" #include "qapi/qapi-visit-migration.h" @@ -1066,11 +1067,21 @@ AnnounceParameters *migrate_announce_params(void) return ≈ } =20 -static void migrate_tls_opts_free(MigrationParameters *params) +static bool migrate_params_free(MigrationParameters *params, Error **errp) { - qapi_free_StrOrNull(params->tls_creds); - qapi_free_StrOrNull(params->tls_hostname); - qapi_free_StrOrNull(params->tls_authz); + Visitor *v =3D qapi_dealloc_visitor_new(); + bool ret; + + /* + * qapi_free_MigrationParameters can't be used here because + * MigrationParameters is embedded in MigrationState due to qdev + * needing to access the offset of the migration properties inside + * the migration object. + */ + ret =3D visit_type_MigrationParameters_members(v, params, errp); + visit_free(v); + + return ret; } =20 /* normalize QTYPE_QNULL to QTYPE_QSTRING "" */ @@ -1419,9 +1430,9 @@ void qmp_migrate_set_parameters(MigrationParameters *= input, Error **errp) return; } =20 - migrate_tls_opts_free(cur); - qapi_free_BitmapMigrationNodeAliasList(cur->block_bitmap_mapping); - qapi_free_strList(cur->cpr_exec_command); + if (!migrate_params_free(cur, errp)) { + return; + } =20 QAPI_CLONE_MEMBERS(MigrationParameters, cur, new); =20 --=20 2.53.0 From nobody Sat Sep 26 19:12:10 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1790350964; cv=none; d=zohomail.com; s=zohoarc; b=KCbmlPxgwH3C8Xv44WWTIpifUOdUlGWAEPGxTUs7yv8Jxf13+dLyDnQlXXU6EBx1Q76tIUWPWO/IpUMJ5fstWjLrwwQ8ZkZAxsuI68PTrBAFd/JbXJB9Uo3OY4MdKMCQRNTrNZ18jQDyZZUYjMrklndjuDuxm7RWdJ4oZDsjAXk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790350964; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HKs/esBlOFAbBPmBNeIq0MYqcwqzt+NV/Ybw4pONbyc=; b=aPJE7tDh+jA+komqdEQav9E3tD52vAr1sCJFV0nPsYLTXusQW5jzoKKclQYasCdTeSJH4Pvt/2mp+3BmxUa9h9IY3TwyhjMRrwwipR9e55L7f8IH696/ohjcKCsFVijsuuGjV9LTR2ESkyQNbXA+6wFtwKZE6EP9lDRUGM0FRy0= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790350964951845.4558062996306; Fri, 25 Sep 2026 08:42:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA82e-0006nx-Gb; Fri, 25 Sep 2026 11:40:52 -0400 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 1xA82b-0006mp-Vh for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:50 -0400 Received: from smtp-out1.suse.de ([195.135.223.130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xA82a-0004eC-BJ for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:49 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id CD61F21E7C; Fri, 25 Sep 2026 15:40:38 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E8DE71333B; Fri, 25 Sep 2026 15:40:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xxRgCd2VtmqjOwAAD6G6ig:T19 (envelope-from ); Fri, 25 Sep 2026 15:40:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350842; h=from:from:reply-to: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=HKs/esBlOFAbBPmBNeIq0MYqcwqzt+NV/Ybw4pONbyc=; b=QI5prsAIhRA+9cn3PJPu3x3aevMhNM4zmzJ6mqJwauvMae1gPKCoycrCfQkZJenPmrLCDo wC46l7xFNWIajBGbQUCdhLVm4FnGQLTxY2THuYdeQxOwxPX09n4eJpk23JsEyzrKpjcN9q RNe841dUu3T7pX50pgJY/GAxQV743Lg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350842; h=from:from:reply-to: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=HKs/esBlOFAbBPmBNeIq0MYqcwqzt+NV/Ybw4pONbyc=; b=X9k7bHlAI/Jhm81i1N28LrThSx/PaFlKaoZuGf1Ek3vZjnBVE/UvKiAQw0ImORV1xxZ4eQ 045GPmbTTSTgJbBw== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350838; h=from:from:reply-to: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=HKs/esBlOFAbBPmBNeIq0MYqcwqzt+NV/Ybw4pONbyc=; b=hLLGjQkMpy/bGyNTREXCpwdpZEeG1pADcaIMX6wnl+Iur+t/qhymoNX09gFJDk3bV3i01Q +b9xOCjT8gurpawOlwoiKqTnyHNRc2H00svVHLEWcPCujdOvrmskVo3U/ZSQUHBlYxR7Ob lZnRVjtpIvHANqDkmQhJ7HCNSGnM2Eg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350838; h=from:from:reply-to: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=HKs/esBlOFAbBPmBNeIq0MYqcwqzt+NV/Ybw4pONbyc=; b=hIu4fjWbOaJ8YYZA5S7ExpGlHfCPv0ZLJ2Lamp5uXAGpQzSVtqQMfLli5FNwKS0hsD3/fj gNSQUWMxG+1bglBA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu Subject: [PULL 18/19] migration: Use migrate_params_free during finalize Date: Fri, 25 Sep 2026 12:40:09 -0300 Message-ID: <20260925154010.599247-19-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260925154010.599247-1-farosas@suse.de> References: <20260925154010.599247-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.997]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] 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=lists1p.gnu.org; Received-SPF: pass client-ip=195.135.223.130; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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: qemu development 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 @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1790350966581158500 Content-Type: text/plain; charset="utf-8" Use the recently introduced migrate_params_free routine at migration_instance_finalize() so that newly added pointers are already freed by default. Special case: The TLS options are currently the only pointers that also have a qdev property implementation, so they will be freed by qdev using the .release method. Update the method so that a second invocation of qapi_free_StrOrNull doesn't assert. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/migration.c | 3 +-- migration/options.c | 7 ++++--- migration/options.h | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index d14beb5d22..fab7949fe1 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -4052,8 +4052,7 @@ static void migration_instance_finalize(Object *obj) { MigrationState *ms =3D MIGRATION(obj); =20 - qapi_free_BitmapMigrationNodeAliasList(ms->parameters.block_bitmap_map= ping); - qapi_free_strList(ms->parameters.cpr_exec_command); + migrate_params_free(&ms->parameters, NULL); qemu_mutex_destroy(&ms->error_mutex); qemu_mutex_destroy(&ms->qemu_file_lock); qemu_sem_destroy(&ms->wait_unplug_sem); diff --git a/migration/options.c b/migration/options.c index bdcff002db..46d040fc3f 100644 --- a/migration/options.c +++ b/migration/options.c @@ -273,8 +273,9 @@ static void set_StrOrNull(Object *obj, Visitor *v, cons= t char *name, =20 static void release_StrOrNull(Object *obj, const char *name, void *opaque) { - const Property *prop =3D opaque; - qapi_free_StrOrNull(*(StrOrNull **)object_field_prop_ptr(obj, prop)); + StrOrNull **ptr =3D object_field_prop_ptr(obj, opaque); + + g_clear_pointer(ptr, qapi_free_StrOrNull); } =20 static void set_default_value_tls_opt(ObjectProperty *op, const Property *= prop) @@ -1067,7 +1068,7 @@ AnnounceParameters *migrate_announce_params(void) return ≈ } =20 -static bool migrate_params_free(MigrationParameters *params, Error **errp) +bool migrate_params_free(MigrationParameters *params, Error **errp) { Visitor *v =3D qapi_dealloc_visitor_new(); bool ret; diff --git a/migration/options.h b/migration/options.h index c272eb6208..c7da2d0b5b 100644 --- a/migration/options.h +++ b/migration/options.h @@ -93,4 +93,5 @@ uint64_t migrate_rdma_chunk_size(void); =20 bool migrate_params_check(MigrationParameters *params, Error **errp); void migrate_params_init(MigrationParameters *params); +bool migrate_params_free(MigrationParameters *params, Error **errp); #endif --=20 2.53.0 From nobody Sat Sep 26 19:12:10 2026 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=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1790350972; cv=none; d=zohomail.com; s=zohoarc; b=BVuN3LjNter4iH0kANqTPJGdEaEL2ORqhuXITht7t+UO9IGd6mSszy58PRzy6eok5YaqOYokrfvsS+fIaF1kk0Ip+MG5a1azRcy6Ec0HP9AFZ4855mVOLMJNxtkfHdKjMfDDJgRg5B9b3RMmnb7QOsWjONORSvGuVCNf2e7CrOs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790350972; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+uAMitxzrk8B1HSnf4ZFJY8Z36882uhnQwCBIpoR2cQ=; b=lw+ej94Lnk38Lakoi8fAS7q9sulsl0IORQ24bwJNVjm4NlEB8YQVIVZHD7Bgob4hKJW21H1flCBnjcBy/kz/N57xZCI1RNOtZe13O4Dno0lPgLvSwACMuwm4LI4JLtDfll3S7bqG+Xh3VyZEhTB/5dpom6dIs++9uZ9C/grCuMc= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790350972648825.8716290560689; Fri, 25 Sep 2026 08:42:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA82f-0006o6-2g; Fri, 25 Sep 2026 11:40:53 -0400 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 1xA82d-0006nS-1D for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:51 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xA82b-0004ed-Dj for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:40:50 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 209CE1FF16; Fri, 25 Sep 2026 15:40:40 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 0E99313353; Fri, 25 Sep 2026 15:40:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xxRgCd2VtmqjOwAAD6G6ig:T20 (envelope-from ); Fri, 25 Sep 2026 15:40:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350844; h=from:from:reply-to: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=+uAMitxzrk8B1HSnf4ZFJY8Z36882uhnQwCBIpoR2cQ=; b=UQxbQwZUFg1OCymd9Ypu+Ug1ewGZ4Fu5J8iiwm2tuKUzNRtXg722tFG+gCdnpKvr4d8/0e qCKcOqvgwUbNJN3h0vvlDM37ASUrjh2STuND4rBiSQQghx4WVf6hv1P4NPycpDu+0DEI1M Y4yFXYatcQnfLdNcy+hLnfPqAlsCG3o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350844; h=from:from:reply-to: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=+uAMitxzrk8B1HSnf4ZFJY8Z36882uhnQwCBIpoR2cQ=; b=2SUh7ODHehTjbTJavEiArTGlGNa6iOcYPWm0j/3JMQNq3QSUq2EBTlmFHkJlHJFoU7nz8s M4GIYSEyayJfADAg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1790350840; h=from:from:reply-to: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=+uAMitxzrk8B1HSnf4ZFJY8Z36882uhnQwCBIpoR2cQ=; b=q7cHVVuTWKSLxy3L/OhIqH7o2gYQzdrr71gsBXxfnues7v3tKjgWYy71e2jfKOHxl5RjAD B3Dbf5wSHwx3DBHtBnlBJZ1M2j9iTmr62UMi1HhjyHf5beoqhPhjvBP47E7YCIxM8clJjG nF8e0ewmRqGqdB4f5uMLeSiGhBbzdng= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1790350840; h=from:from:reply-to: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=+uAMitxzrk8B1HSnf4ZFJY8Z36882uhnQwCBIpoR2cQ=; b=voW7vlNK3SlmxLe7Ok5k3LFJepy/5M2gPyZMv8xk+Jj1sRmp3hw+KbUsmb7YeDsZCVleEV UXI3aFAAPlZx1CCA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Bin Guo Subject: [PULL 19/19] docs/migration: document that postcopy can be used with multifd Date: Fri, 25 Sep 2026 12:40:10 -0300 Message-ID: <20260925154010.599247-20-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260925154010.599247-1-farosas@suse.de> References: <20260925154010.599247-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.997]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[alibaba.com:email,imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de 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, 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: qemu development 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 @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1790350974757158500 Content-Type: text/plain; charset="utf-8" From: Bin Guo Since commit e27418861288 ("migration: enable multifd and postcopy together") in the 10.1 release, the multifd and postcopy-ram capabilities are no longer mutually exclusive, but the postcopy documentation does not mention multifd at all, leaving users unaware that the two features can be combined. Add a short section describing how they interact: multifd carries the pages of the precopy phase, the channels are flushed and synced before the switchover (because loading a page in a multifd receive thread is not atomic with regard to a running vCPU), and the postcopy phase itself does not use the multifd channels. Signed-off-by: Bin Guo Acked-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- docs/devel/migration/postcopy.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/devel/migration/postcopy.rst b/docs/devel/migration/postc= opy.rst index e319388d8f..570a3a1ce6 100644 --- a/docs/devel/migration/postcopy.rst +++ b/docs/devel/migration/postcopy.rst @@ -294,6 +294,32 @@ the background migration channel. Anyone who cares ab= out latencies of page faults during a postcopy migration should enable this feature. By default, it's not enabled. =20 +Postcopy with multifd +--------------------- + +The ``multifd`` capability can be enabled together with ``postcopy-ram`` +since the 10.1 QEMU release. The two features apply to different phases of +the migration: + + - During the precopy phase, guest pages are sent over the multifd channe= ls + as usual, so the initial RAM transfer can use all of them. + + - Just before switching to postcopy, the source flushes and syncs the + multifd channels. This guarantees that all the pages already queued on + those channels are loaded on the destination *before* the destination + CPUs are started, which is required because loading a page in a multifd + receive thread is not atomic with regard to a running vCPU. + + - During the postcopy phase the multifd channels are no longer used for + guest pages. Both the background stream and the pages requested by the + destination go through the background migration channel instead, or + through the preempt channel for the requested pages when postcopy + preemption is enabled. + +Consequently, multifd only speeds up the precopy phase of a postcopy +migration. The bandwidth available once postcopy has started is the same = as +without multifd. + Postcopy blocktime statistics ----------------------------- =20 --=20 2.53.0