From nobody Tue Apr 7 19:50:54 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=1773264968; cv=none; d=zohomail.com; s=zohoarc; b=TFDqPTsSP00aWSpn7FXk32toEVoeVf+d8AfgR/bzHgAsz8gQ5ycSleQkBWTt2FyJPVZ4i73fNkrrRdjyQhhDUFpLBtUrNwCb933LJBus/a9lIk1CmiXQAXvoR/Kj3SjjlgSn8/eg22ybq4MtUMgVyq25wqPlD33+1PI4Tt12zzM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773264968; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qLDUypVLJFruQUZaT2FvstlLe7oVVwkR5O8QRLHa66s=; b=e8EJxwCxdTFD+mQ9GSnEPUiXSJI4DASwf/qmDhnf+Lq9WcN4amMzSefiqHM0VH3CRUJIkcU3VwwNAshyI9ELkN7ox57+BrGT3hpZFc48drVB5Oi2GJ8jkwgJhYyyfPe+udQ7+bQgaznMKC7PNjXM4kHlXCM+Hs3OBGMPB2/cBBY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773264968489188.5415638998669; Wed, 11 Mar 2026 14:36:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w0RCT-0005NP-B1; Wed, 11 Mar 2026 17:34:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w0RCR-0005NB-Bf for qemu-devel@nongnu.org; Wed, 11 Mar 2026 17:34: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 1w0RCM-00035f-37 for qemu-devel@nongnu.org; Wed, 11 Mar 2026 17:34:36 -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 6D2735BD81; Wed, 11 Mar 2026 21:34:25 +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 315363FC1B; Wed, 11 Mar 2026 21:34:22 +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 QBQOOd7fsWngUgAAD6G6ig (envelope-from ); Wed, 11 Mar 2026 21:34:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773264866; 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=qLDUypVLJFruQUZaT2FvstlLe7oVVwkR5O8QRLHa66s=; b=dAe0v6j6DBJl6BBX8D7eKk30jnMS1Eyk12duq/syvzjiCzHlGpF34f5Vh1NJcXtTR75f/q p9MrtNgGUOePeP16FMDUJ5UsB0brTJB06mr7Nrs803DGYU0oqwfKneS1GJSzYmjehGwuOl ISJIILHgKoa8ek7c0dTVzd/e+HIFRhY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773264866; 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=qLDUypVLJFruQUZaT2FvstlLe7oVVwkR5O8QRLHa66s=; b=5Z/wLMaT/DbIkS3IRNeFhaqGADPYNpZ9LxNn/7l7ERocVnKXRAh3JOUL975caaUs2avGaU Nz3wwgmQ4VZY81BQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773264865; 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=qLDUypVLJFruQUZaT2FvstlLe7oVVwkR5O8QRLHa66s=; b=jS6Bw+Fi7zrvyYzO9mkJpqCXR3V9RbzMhnF+U0SAWPQ0OQOoB+SdhICHNbkgQ3YaG31KBx 393s+gtO2fnuQorfG++CGUbemIdeSHTpRjhyv7yQCfGk8NhGp7kbWWZ15qgPXFUxGmHIjg Nja9EXWCSM67v+WAyU0P85OlrrN1EkQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773264865; 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=qLDUypVLJFruQUZaT2FvstlLe7oVVwkR5O8QRLHa66s=; b=4mMaCnGyRZYh8qS77BL+AmasGJqexlG6kGUAIGl7kegxA7S87PseBo2+YQfpiSzTR2OBNj TioRIh7y4/5wfLDA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Peter Maydell , Prasad Pandit , Prasad Pandit , Laurent Vivier , Paolo Bonzini Subject: [PATCH v2 1/5] tests/qtest/migration: Fix leak of migration tests data Date: Wed, 11 Mar 2026 18:34:14 -0300 Message-ID: <20260311213418.16951-2-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260311213418.16951-1-farosas@suse.de> References: <20260311213418.16951-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%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.998]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[fedoraproject.org:email,suse.de:mid,suse.de:email]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; 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=lists.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: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, 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: 1773264971144154100 Content-Type: text/plain; charset="utf-8" When the migration-test is invoked with the '-p' flag (to run a single test), the glib code won't call the destroy function for the not-executed tests, causing the MigrationTest wrapper data to leak. This doesn't affect make check, but affects debugging use-cases where having a leak pop up in ASAN output is extra annoying. Fix by adding the tests data to a list and freeing them all at the end of migration-test execution. Any tests actually dispatched by glib will have the destroy function called as usual. Note that migration_test_add_suffix() is altered to call migration_test_add() so that there's only one place adding the data to the list. Performance is not an issue at the moment, we have < 100 tests. Reviewed-by: Peter Xu Reviewed-by: Prasad Pandit Signed-off-by: Fabiano Rosas --- tests/qtest/migration/framework.c | 2 ++ tests/qtest/migration/migration-util.c | 19 ++++++++++++++----- tests/qtest/migration/migration-util.h | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/tests/qtest/migration/framework.c b/tests/qtest/migration/fram= ework.c index 0bfc241914..b9371372de 100644 --- a/tests/qtest/migration/framework.c +++ b/tests/qtest/migration/framework.c @@ -1162,5 +1162,7 @@ int migration_env_clean(MigrationTestEnv *env) } g_free(tmpfs); =20 + migration_tests_free(); + return ret; } diff --git a/tests/qtest/migration/migration-util.c b/tests/qtest/migration= /migration-util.c index c2462306a1..2648ad7f61 100644 --- a/tests/qtest/migration/migration-util.c +++ b/tests/qtest/migration/migration-util.c @@ -38,6 +38,7 @@ #include "linux/kvm.h" #endif =20 +GQueue *tests; =20 static char *SocketAddress_to_str(SocketAddress *addr) { @@ -243,6 +244,8 @@ static void migration_test_destroy(gpointer data) { MigrationTest *test =3D (MigrationTest *)data; =20 + g_queue_remove(tests, test); + g_free(test->data); g_free(test->name); g_free(test); @@ -268,21 +271,27 @@ void migration_test_add(const char *path, =20 qtest_add_data_func_full(path, test, migration_test_wrapper, migration_test_destroy); + if (!tests) { + tests =3D g_queue_new(); + } + g_queue_push_tail(tests, test); } =20 void migration_test_add_suffix(const char *path, const char *suffix, void (*fn)(char *name, MigrateCommon *args)) { - MigrationTest *test =3D g_new0(MigrationTest, 1); + g_autofree char *name =3D NULL; =20 g_assert(g_str_has_suffix(path, "/")); g_assert(!g_str_has_prefix(suffix, "/")); =20 - test->func =3D fn; - test->name =3D g_strconcat(path, suffix, NULL); + name =3D g_strconcat(path, suffix, NULL); + migration_test_add(name, fn); +} =20 - qtest_add_data_func_full(test->name, test, migration_test_wrapper, - migration_test_destroy); +void migration_tests_free(void) +{ + g_queue_free_full(tests, migration_test_destroy); } =20 #ifdef O_DIRECT diff --git a/tests/qtest/migration/migration-util.h b/tests/qtest/migration= /migration-util.h index e73d69bab0..694773e594 100644 --- a/tests/qtest/migration/migration-util.h +++ b/tests/qtest/migration/migration-util.h @@ -59,5 +59,5 @@ void migration_test_add_suffix(const char *path, const ch= ar *suffix, void (*fn)(char *name, MigrateCommon *args)= ); char *migrate_get_connect_uri(QTestState *who); void migrate_set_ports(QTestState *to, QList *channel_list); - +void migration_tests_free(void); #endif /* MIGRATION_UTIL_H */ --=20 2.51.0 From nobody Tue Apr 7 19:50:54 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=1773264969; cv=none; d=zohomail.com; s=zohoarc; b=EkSIMQHks8j90F6DMaLYL6BzeKjPaI68be1h8tk53ok4jtNZyanwsiozceecPXXjM4BVhnoqJnHjjoYcBDhdUVuzz9VJPTotxOdf71GxO71pr+i1EMas76wF7PvjZuu1mzp8RHYZyOxlK8mJmNro28D6MYni3mdgTnxy7K6IqV8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773264969; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AR7PLUvSbBLT70HkEnsn7rXXK9qRCLWS1OcibFDk2p0=; b=CdVjqEwlh+8xlonDBa3GT7Y0bMctaTz7WTH5l5J/5JAtYqKgdjqMdSQ9BqJlIoBnEjgV4HF7sPHim2TkZvm2DWt7rE5bWH7zM6t6sg0maReUpjjGcxlVDryHhnqDRQNU2k9oqR9PiQq+4FoQenX1144ugC+fHPI/YpFL1pYhS8E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773264969136602.0636537877699; Wed, 11 Mar 2026 14:36:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w0RCZ-0005O6-Ns; Wed, 11 Mar 2026 17:34:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w0RCX-0005Nw-TB for qemu-devel@nongnu.org; Wed, 11 Mar 2026 17:34:45 -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 1w0RCW-00036R-9R for qemu-devel@nongnu.org; Wed, 11 Mar 2026 17:34: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 9400E5BD98; Wed, 11 Mar 2026 21:34: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 E98623FC1F; Wed, 11 Mar 2026 21:34:25 +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 WN8HKuHfsWngUgAAD6G6ig (envelope-from ); Wed, 11 Mar 2026 21:34:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773264867; 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=AR7PLUvSbBLT70HkEnsn7rXXK9qRCLWS1OcibFDk2p0=; b=Pw3QTn1RtD92Ev2QgR7jfcQf6J7EEOonXVvzwWRdAVnSxnqz1rNaM3IyYUS1REJf6u3qsD 0okt1wegePfKmTgS9AGSAwqnCSK4m8txkdYSnUROHvq1GIpvmfclHNZZDNe/JLtoVNQS5d pHQ3kqBrun/O4EipgsnhD9GGgFXa+U8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773264867; 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=AR7PLUvSbBLT70HkEnsn7rXXK9qRCLWS1OcibFDk2p0=; b=eJfSIdz+IYPluNO8xva7tvjor+ad2+xQmlHv3Xkq9ap4ChTUNIfLLhkjSBv2L3d/1pZGwg PqZXbt5ocamL06CA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773264867; 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=AR7PLUvSbBLT70HkEnsn7rXXK9qRCLWS1OcibFDk2p0=; b=Pw3QTn1RtD92Ev2QgR7jfcQf6J7EEOonXVvzwWRdAVnSxnqz1rNaM3IyYUS1REJf6u3qsD 0okt1wegePfKmTgS9AGSAwqnCSK4m8txkdYSnUROHvq1GIpvmfclHNZZDNe/JLtoVNQS5d pHQ3kqBrun/O4EipgsnhD9GGgFXa+U8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773264867; 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=AR7PLUvSbBLT70HkEnsn7rXXK9qRCLWS1OcibFDk2p0=; b=eJfSIdz+IYPluNO8xva7tvjor+ad2+xQmlHv3Xkq9ap4ChTUNIfLLhkjSBv2L3d/1pZGwg PqZXbt5ocamL06CA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Peter Maydell , Prasad Pandit , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 2/5] io: Fix TLS bye task leak Date: Wed, 11 Mar 2026 18:34:15 -0300 Message-ID: <20260311213418.16951-3-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260311213418.16951-1-farosas@suse.de> References: <20260311213418.16951-1-farosas@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.30 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-0.987]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; FUZZY_RATELIMITED(0.00)[rspamd.com]; 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)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email] X-Spam-Score: -3.30 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, 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) X-ZM-MESSAGEID: 1773264971125154100 Recent fixes to TLS tasks memory handling have left the TLS bye task uncovered. Fix by freeing the task in the same way the handshake task is freed. Direct leak of 704 byte(s) in 4 object(s) allocated from: #1 0x7f5909b1d6a0 in g_malloc0 ../glib/gmem.c:163 #2 0x557650496d61 in qio_task_new ../io/task.c:58:12 #3 0x557650475d7f in qio_channel_tls_bye ../io/channel-tls.c:352:12 #4 0x55764f7a1bb4 in migration_tls_channel_end ../migration/tls.c:159:5 #5 0x55764f709750 in migration_ioc_shutdown_gracefully ../migration/mul= tifd.c:462:9 #6 0x55764f6fcf53 in multifd_send_terminate_threads ../migration/multif= d.c:493:13 #7 0x55764f6fcafb in multifd_send_shutdown ../migration/multifd.c:580:5 #8 0x55764f6e1b14 in migration_cleanup ../migration/migration.c:1323:9 #9 0x55764f6f5bac in migration_cleanup_bh ../migration/migration.c:1350= :5 Fixes: d39d0f3acd ("io: fix cleanup for TLS I/O source data on cancellation= ") Reviewed-by: Daniel P. Berrang=C3=A9 Acked-by: Daniel P. Berrang=C3=A9 Signed-off-by: Fabiano Rosas --- io/channel-tls.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/io/channel-tls.c b/io/channel-tls.c index 940fc3c6d1..31ec4d236d 100644 --- a/io/channel-tls.c +++ b/io/channel-tls.c @@ -352,7 +352,9 @@ void qio_channel_tls_bye(QIOChannelTLS *ioc, Error **er= rp) task =3D qio_task_new(OBJECT(ioc), propagate_error, errp, NULL); =20 trace_qio_channel_tls_bye_start(ioc); - qio_channel_tls_bye_task(ioc, task, NULL); + if (qio_channel_tls_bye_task(ioc, task, NULL)) { + qio_task_free(task); + } } =20 static void qio_channel_tls_init(Object *obj G_GNUC_UNUSED) --=20 2.51.0 From nobody Tue Apr 7 19:50:54 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=1773264927; cv=none; d=zohomail.com; s=zohoarc; b=j7ZSm+E4qT1B/HkT2AyM3L9uIBQ2XKNLfMzewNZMTJpoqBK/IJrY8NjgLMdhmoADo1S0hwY12+ieg9yq/TprfR5yjhDNoVnMFUPvZX0z1i4n7xLpw3xSXBxdoIFeE8DsYxly+Udr9K1SsumCM8MFGYgCVRyUlD/U3M3aQS8fKUA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773264927; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pz9KB5gDhWYyKBCIaxcjvFsy3Xq478977CIMj+YESYY=; b=VkqF1KyysRyTldTarYyQ9pUNmwzNkuhwy4zj6YC6y8j5mGt6sR5MzmPPu9serMgNuYhO/JZDbamZH3677B4cAjymk3ptUHfbCZ5ZiaJUSaa1/wSdEe4alKWUpC9WzN8iGWohDaglHvBl8q7BoxFxbhcZ/LbL80tb5OwkKFvjKko= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773264927411150.31062671225277; Wed, 11 Mar 2026 14:35:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w0RCe-0005Ok-GK; Wed, 11 Mar 2026 17:34:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w0RCd-0005Oa-3w for qemu-devel@nongnu.org; Wed, 11 Mar 2026 17:34:51 -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 1w0RCb-000370-Iq for qemu-devel@nongnu.org; Wed, 11 Mar 2026 17:34: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 A97095BD30; Wed, 11 Mar 2026 21:34: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 1557F3FC1B; Wed, 11 Mar 2026 21:34: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 8B37MuPfsWngUgAAD6G6ig (envelope-from ); Wed, 11 Mar 2026 21:34:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773264870; 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=pz9KB5gDhWYyKBCIaxcjvFsy3Xq478977CIMj+YESYY=; b=NXhEf4dRr8DEwr2g4VJrfr1/AkX/uq1QmuwoG6LPCJ7VpA6OCXv7oYWT5xNKqwxVawEZuV 41dGm8Te8CyJ2NT/aovIRXFwORsC1ktdvdUHe5FNNdOosLVHm7zy21K1XPdn6BWDcO6sd+ Qzr+UYjvmOCrEMKRcIgsHcMVUG2rje4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773264870; 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=pz9KB5gDhWYyKBCIaxcjvFsy3Xq478977CIMj+YESYY=; b=kqFMqsRksNqvWcj8jSWfHB+3Z3M8egkljWptLtJFJJULa0OfqaiQ1uxbpea3GbM17xD/11 giLtNzCUgCg66HBw== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773264870; 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=pz9KB5gDhWYyKBCIaxcjvFsy3Xq478977CIMj+YESYY=; b=NXhEf4dRr8DEwr2g4VJrfr1/AkX/uq1QmuwoG6LPCJ7VpA6OCXv7oYWT5xNKqwxVawEZuV 41dGm8Te8CyJ2NT/aovIRXFwORsC1ktdvdUHe5FNNdOosLVHm7zy21K1XPdn6BWDcO6sd+ Qzr+UYjvmOCrEMKRcIgsHcMVUG2rje4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773264870; 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=pz9KB5gDhWYyKBCIaxcjvFsy3Xq478977CIMj+YESYY=; b=kqFMqsRksNqvWcj8jSWfHB+3Z3M8egkljWptLtJFJJULa0OfqaiQ1uxbpea3GbM17xD/11 giLtNzCUgCg66HBw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Peter Maydell , Prasad Pandit , Prasad Pandit , Mark Kanda , Ben Chaney , Laurent Vivier , Paolo Bonzini Subject: [PATCH v2 3/5] tests/qtest/migration: Fix leak in CPR exec test Date: Wed, 11 Mar 2026 18:34:16 -0300 Message-ID: <20260311213418.16951-4-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260311213418.16951-1-farosas@suse.de> References: <20260311213418.16951-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%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.998]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[fedoraproject.org:email,suse.de:mid,suse.de:email]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCPT_COUNT_SEVEN(0.00)[9]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; 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=lists.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: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, 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) X-ZM-MESSAGEID: 1773264930936154100 Content-Type: text/plain; charset="utf-8" The string was being dup'ed only to get around the const of the qdict_get_str() return value. Reviewed-by: Peter Xu Reviewed-by: Prasad Pandit Signed-off-by: Fabiano Rosas --- tests/qtest/migration/cpr-tests.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/qtest/migration/cpr-tests.c b/tests/qtest/migration/cpr-= tests.c index 0d97b5b89f..63ca5f3996 100644 --- a/tests/qtest/migration/cpr-tests.c +++ b/tests/qtest/migration/cpr-tests.c @@ -154,15 +154,16 @@ static void set_cpr_exec_args(QTestState *who, Migrat= eCommon *args) static void wait_for_migration_event(QTestState *who, const char *waitfor) { QDict *rsp, *data; - char *status; bool done =3D false; =20 while (!done) { + const char *status; + rsp =3D qtest_qmp_eventwait_ref(who, "MIGRATION"); g_assert(qdict_haskey(rsp, "data")); data =3D qdict_get_qdict(rsp, "data"); g_assert(qdict_haskey(data, "status")); - status =3D g_strdup(qdict_get_str(data, "status")); + status =3D qdict_get_str(data, "status"); g_assert(strcmp(status, "failed")); done =3D !strcmp(status, waitfor); qobject_unref(rsp); --=20 2.51.0 From nobody Tue Apr 7 19:50:54 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=1773264945; cv=none; d=zohomail.com; s=zohoarc; b=WlYgDGJ4IIz9d6q00IeUNT4PBOGuCTgBRKapeAFqNZ6F9+kmfCuOG8UzW2OkzduxwJtOHJCbtKQ0+drqyIphI+EFCMnea6o1Uh5Z+n6+5Q8EXV2q11uSywhdPo8udi7bkZxPbHcgxk8tdo4h0YB5qEQsoYjkrn1S56Nw/0+mtX8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773264945; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iFpzO2GOmQFZ7QvaZSsKWOWuuMK2/7Giq6BtAr8xSjQ=; b=a0gM3S7M5T8yZPLVDxjjNezsfIXNIKdq7mG2wQ02Kl+PPznttLhiqTh7ddLHPUXYWUUlDD0WWCzjbZyY4dqxk835BR+YXnzsUQetoOzF07+oWHd5JSv+v/8KgQFo/nSkWWhoY8cMQIQdO0J4yZquAOkb0lvDX+h4616AmGTQf2A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773264945587951.1270389508784; Wed, 11 Mar 2026 14:35:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w0RCl-0005Pi-9H; Wed, 11 Mar 2026 17:34:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w0RCi-0005PI-Ok for qemu-devel@nongnu.org; Wed, 11 Mar 2026 17:34:56 -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 1w0RCg-00037U-P2 for qemu-devel@nongnu.org; Wed, 11 Mar 2026 17:34:56 -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 D77A15BD9A; Wed, 11 Mar 2026 21:34: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 29C8F3FC1B; Wed, 11 Mar 2026 21:34: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 IDcWOObfsWngUgAAD6G6ig (envelope-from ); Wed, 11 Mar 2026 21:34:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773264872; 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=iFpzO2GOmQFZ7QvaZSsKWOWuuMK2/7Giq6BtAr8xSjQ=; b=FW5kxxaN4HIa8fR6goYBzCOVNLOLN5e9inKMXaB7uxk/b2tW+3+CEpRP6IVss05izNrOWi UbRmD/mLjvTo8hCR2caxuaAPzVHWyxSF7PEm0FZ/fTbHxxzMCodx8nzehlxKvnLCg+3lal UcAhdKVWq6fsdGtd7euiMIkoqxONvww= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773264872; 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=iFpzO2GOmQFZ7QvaZSsKWOWuuMK2/7Giq6BtAr8xSjQ=; b=xtqjbZEoe9oYc2pCP1n/gDw6ovjRavEkLsVf+7EEVbzpNv4M4kcbPZ6Vu6OACyWwHclPGu w8cwE1SB+OABV/CQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773264872; 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=iFpzO2GOmQFZ7QvaZSsKWOWuuMK2/7Giq6BtAr8xSjQ=; b=FW5kxxaN4HIa8fR6goYBzCOVNLOLN5e9inKMXaB7uxk/b2tW+3+CEpRP6IVss05izNrOWi UbRmD/mLjvTo8hCR2caxuaAPzVHWyxSF7PEm0FZ/fTbHxxzMCodx8nzehlxKvnLCg+3lal UcAhdKVWq6fsdGtd7euiMIkoqxONvww= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773264872; 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=iFpzO2GOmQFZ7QvaZSsKWOWuuMK2/7Giq6BtAr8xSjQ=; b=xtqjbZEoe9oYc2pCP1n/gDw6ovjRavEkLsVf+7EEVbzpNv4M4kcbPZ6Vu6OACyWwHclPGu w8cwE1SB+OABV/CQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Peter Maydell , Prasad Pandit , Prasad Pandit Subject: [PATCH v2 4/5] migration/multifd: Fix leaks of TLS error objects Date: Wed, 11 Mar 2026 18:34:17 -0300 Message-ID: <20260311213418.16951-5-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260311213418.16951-1-farosas@suse.de> References: <20260311213418.16951-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%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.998]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[fedoraproject.org:email,suse.de:mid,suse.de:email]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FUZZY_RATELIMITED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_FIVE(0.00)[5]; 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=lists.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: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, 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) X-ZM-MESSAGEID: 1773264947960158500 Content-Type: text/plain; charset="utf-8" The code currently ignores errors from multifd threads that happen after a first error has already been propagated. Make sure the subsequent errors are freed appopriately. This fixes a leak of the TLS session->werr when the certificate validation fails after multifd threads are already running. The first writes on the threads will fail deep into the gnutls stack. No need to check if(err) because the callers are all under a similar check. Reviewed-by: Peter Xu Reviewed-by: Prasad Pandit Signed-off-by: Fabiano Rosas --- migration/multifd.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index 8b9ed84805..035cb70f7b 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -412,28 +412,25 @@ bool multifd_send(MultiFDSendData **send_data) /* Multifd send side hit an error; remember it and prepare to quit */ static void multifd_send_error_propagate(Error *err) { + MigrationState *s =3D migrate_get_current(); + /* - * We don't want to exit each threads twice. Depending on where - * we get the error, or if there are two independent errors in two - * threads at the same time, we can end calling this function - * twice. + * There may be independent errors in each thread. Propagate the + * first and free the subsequent ones. */ if (qatomic_xchg(&multifd_send_state->exiting, 1)) { + error_free(err); return; } =20 - if (err) { - MigrationState *s =3D migrate_get_current(); + migrate_error_propagate(s, err); =20 - migrate_error_propagate(s, err); - - if (s->state =3D=3D MIGRATION_STATUS_SETUP || - s->state =3D=3D MIGRATION_STATUS_PRE_SWITCHOVER || - s->state =3D=3D MIGRATION_STATUS_DEVICE || - s->state =3D=3D MIGRATION_STATUS_ACTIVE) { - migrate_set_state(&s->state, s->state, - MIGRATION_STATUS_FAILING); - } + if (s->state =3D=3D MIGRATION_STATUS_SETUP || + s->state =3D=3D MIGRATION_STATUS_PRE_SWITCHOVER || + s->state =3D=3D MIGRATION_STATUS_DEVICE || + s->state =3D=3D MIGRATION_STATUS_ACTIVE) { + migrate_set_state(&s->state, s->state, + MIGRATION_STATUS_FAILING); } } =20 --=20 2.51.0 From nobody Tue Apr 7 19:50:54 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=1773264953; cv=none; d=zohomail.com; s=zohoarc; b=f+TiFjo6tMUUfq+9MaAx9UMwkbGWdeFZGg2h1m5gxEzKCWGoGgvO0Pd/MYd5P5w47vmLLfLQq2gtOn+l7YS4RQw2B5ttZBozgwaR5QrlK+D0Hf+sYdcC4idxW7Gv9O3X3376a3bSj/7gEUJ0JuXy4IZJE0kn57zlRBjPYX3+IQw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773264953; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MLxlWVB55Ex7WGdmcshjPBRAXrzJMBqpSVd7mYEbxxc=; b=Cq764UCNJwMlpm/xTqGWIlXTAvGIlqYiyor0KUeNpAZcApMz+qOtSoQz3C9CGfVitmw4yUUwT7XPu8Jb8heQXTcoaCGKdqS7UegVDy+9cLn2zGQgq16lg3aCN/VZ3n1Q1MGap/bBnYR5aR0l1q775MLbAMxo6ZBfTuIdcMLDm64= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773264953808912.1671673042212; Wed, 11 Mar 2026 14:35:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w0RCr-0005Uk-O4; Wed, 11 Mar 2026 17:35:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w0RCq-0005U5-RU for qemu-devel@nongnu.org; Wed, 11 Mar 2026 17:35:04 -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 1w0RCo-00038b-FM for qemu-devel@nongnu.org; Wed, 11 Mar 2026 17:35:04 -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 984125BDEC; Wed, 11 Mar 2026 21:34: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 6CB8B3FC1B; Wed, 11 Mar 2026 21:34:33 +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 MOpmC+nfsWngUgAAD6G6ig (envelope-from ); Wed, 11 Mar 2026 21:34:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773264875; 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=MLxlWVB55Ex7WGdmcshjPBRAXrzJMBqpSVd7mYEbxxc=; b=eSSkjSyr53dhuDmLUYzi0MAYIeGbcjyotLpbnREudUxZ3zngfUwt7/rMI0C4HC/MmeMvSq ZwcP7Sk/cpkIgx7J/hCNcmQtORfIirmmFx4MZDR5xFn1jW2+IeSemefxoL8DVgoXrmc0BQ hrM2Wz+DLf8lusO7SX2AQR48VCwGMmE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773264875; 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=MLxlWVB55Ex7WGdmcshjPBRAXrzJMBqpSVd7mYEbxxc=; b=BSiJcIOPddbUlnANJbi0rmZufzgneWPHJWE93ua3LyV97bEcOLmXi5GTZchLDt3rCTDDcA NsXki/ZL74hjhgDg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773264875; 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=MLxlWVB55Ex7WGdmcshjPBRAXrzJMBqpSVd7mYEbxxc=; b=eSSkjSyr53dhuDmLUYzi0MAYIeGbcjyotLpbnREudUxZ3zngfUwt7/rMI0C4HC/MmeMvSq ZwcP7Sk/cpkIgx7J/hCNcmQtORfIirmmFx4MZDR5xFn1jW2+IeSemefxoL8DVgoXrmc0BQ hrM2Wz+DLf8lusO7SX2AQR48VCwGMmE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773264875; 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=MLxlWVB55Ex7WGdmcshjPBRAXrzJMBqpSVd7mYEbxxc=; b=BSiJcIOPddbUlnANJbi0rmZufzgneWPHJWE93ua3LyV97bEcOLmXi5GTZchLDt3rCTDDcA NsXki/ZL74hjhgDg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Peter Maydell , Prasad Pandit , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Paolo Bonzini Subject: [PATCH v2 5/5] tests/qtest/migration: Force exit-on-error=false Date: Wed, 11 Mar 2026 18:34:18 -0300 Message-ID: <20260311213418.16951-6-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260311213418.16951-1-farosas@suse.de> References: <20260311213418.16951-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-2.80 / 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)[]; NEURAL_HAM_SHORT(-0.20)[-0.998]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -2.80 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=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) X-ZM-MESSAGEID: 1773264955927158500 Content-Type: text/plain; charset="utf-8" Some tests can cause QEMU to exit(1) too early while the incoming coroutine has not yielded for a first time yet. This trips ASAN because resources related to dispatching the incoming process will still be allocated in the io/channel.c layer without a straight-forward way for the migration code to clean them up. As an example of one such issue, the UUID validation happens early enough that the temporary socket from qio_net_listener_channel_func() still has an elevated refcount. If it fails, the listener dispatch code never gets to free the resource: Direct leak of 400 byte(s) in 1 object(s) allocated from: #0 0x55e668890a07 in malloc asan_malloc_linux.cpp:68:3 #1 0x7f3c7e2b6648 in g_malloc ../glib/gmem.c:130 #2 0x55e66a8ef05f in object_new_with_type ../qom/object.c:767:15 #3 0x55e66a8ef178 in object_new ../qom/object.c:789:12 #4 0x55e66a93bcc6 in qio_channel_socket_new ../io/channel-socket.c:70:31 #5 0x55e66a93f34f in qio_channel_socket_accept ../io/channel-socket.c:4= 01:12 #6 0x55e66a96752a in qio_net_listener_channel_func ../io/net-listener.c= :64:12 #7 0x55e66a94bdac in qio_channel_fd_source_dispatch ../io/channel-watch= .c:84:12 #8 0x7f3c7e2adf4b in g_main_dispatch ../glib/gmain.c:3476 #9 0x7f3c7e2adf4b in g_main_context_dispatch_unlocked ../glib/gmain.c:4= 284 #10 0x7f3c7e2b00c8 in g_main_context_dispatch ../glib/gmain.c:4272 The exit(1) also requires some tests to setup qtest to expect a return code of 1 from the QEMU process. Although we can check migration status changes to be fairly certain where the failure happened, there is always the possibility of QEMU exiting for another reason and the test passing. This happens frequently with sanitizers enabled, but also risks masking issues in the regular build. Stop allowing the incoming migration to exit and instead require the tests to wait for the FAILED state and end QEMU gracefully with qtest_quit. In practice this means setting exit-on-error=3Dfalse for every incoming migration, changing MIG_TEST_FAIL_DEST_QUIT_ERR to MIG_TEST_FAIL and waiting for a change of state where necessary. With this, the MIG_TEST_FAIL_DEST_QUIT_ERR error result is now unused, remove it. The affected tests are: validate_uuid_error multifd_tcp_cancel dirty_limit precopy_unix_tls_x509_default_host precopy_tcp_tls_no_hostname tcp_tls_x509_mismatch_host dbus_vmstate_missing_src dbus_vmstate_missing_dst Also add a comment to QEMU source explaining that the incoming coroutine might block for a while until it yields as this is the actual root cause of the issue. Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu Reviewed-by: Prasad Pandit --- migration/migration.c | 5 +++++ tests/qtest/dbus-vmstate-test.c | 5 +++-- tests/qtest/migration/framework.c | 5 +---- tests/qtest/migration/framework.h | 2 -- tests/qtest/migration/migration-qmp.c | 6 ++++++ tests/qtest/migration/misc-tests.c | 4 ++-- tests/qtest/migration/precopy-tests.c | 12 +++++------- tests/qtest/migration/tls-tests.c | 14 ++++++++------ 8 files changed, 30 insertions(+), 23 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index f949708629..c77832f851 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -898,6 +898,11 @@ void migration_start_incoming(void) =20 Coroutine *co =3D qemu_coroutine_create(process_incoming_migration_co,= NULL); qemu_coroutine_enter(co); + /* + * This doesn't return right away. The coroutine will run + * unimpeded until its first yield, which may happen as late as + * the force yield at ram_load_precopy(). + */ } =20 int migrate_send_rp_switchover_ack(MigrationIncomingState *mis) diff --git a/tests/qtest/dbus-vmstate-test.c b/tests/qtest/dbus-vmstate-tes= t.c index 6c990864e3..0a82cc9f93 100644 --- a/tests/qtest/dbus-vmstate-test.c +++ b/tests/qtest/dbus-vmstate-test.c @@ -219,8 +219,8 @@ test_dbus_vmstate(Test *test) =20 dstaddr =3D g_strsplit(g_test_dbus_get_bus_address(dstbus), ",", 2); dst_qemu_args =3D - g_strdup_printf("-object dbus-vmstate,id=3Ddv,addr=3D%s -incoming = %s", - dstaddr[0], uri); + g_strdup_printf("-object dbus-vmstate,id=3Ddv,addr=3D%s -incoming = defer", + dstaddr[0]); =20 src_qemu =3D qtest_init(src_qemu_args); dst_qemu =3D qtest_init(dst_qemu_args); @@ -229,6 +229,7 @@ test_dbus_vmstate(Test *test) =20 thread =3D g_thread_new("dbus-vmstate-thread", dbus_vmstate_thread, lo= op); =20 + migrate_incoming_qmp(dst_qemu, uri, NULL, "{}"); migrate_qmp(src_qemu, uri, "{}"); test->src_qemu =3D src_qemu; if (test->migrate_fail) { diff --git a/tests/qtest/migration/framework.c b/tests/qtest/migration/fram= ework.c index b9371372de..9f71d51f1e 100644 --- a/tests/qtest/migration/framework.c +++ b/tests/qtest/migration/framework.c @@ -576,6 +576,7 @@ static int migrate_postcopy_prepare(QTestState **from_p= tr, migrate_prepare_for_dirty_mem(from); qtest_qmp_assert_success(to, "{ 'execute': 'migrate-incoming'," " 'arguments': { " + " 'exit-on-error': false," " 'channels': [ { 'channel-type': 'main'= ," " 'addr': { 'transport': 'socket'," " 'type': 'inet'," @@ -906,10 +907,6 @@ int test_precopy_common(MigrateCommon *args) if (args->result !=3D MIG_TEST_SUCCEED) { bool allow_active =3D args->result =3D=3D MIG_TEST_FAIL; wait_for_migration_fail(from, allow_active); - - if (args->result =3D=3D MIG_TEST_FAIL_DEST_QUIT_ERR) { - qtest_set_expected_status(to, EXIT_FAILURE); - } } else { if (args->live) { /* diff --git a/tests/qtest/migration/framework.h b/tests/qtest/migration/fram= ework.h index 80eef75893..79604c60f5 100644 --- a/tests/qtest/migration/framework.h +++ b/tests/qtest/migration/framework.h @@ -208,8 +208,6 @@ typedef struct { MIG_TEST_SUCCEED =3D 0, /* This test should fail, dest qemu should keep alive */ MIG_TEST_FAIL, - /* This test should fail, dest qemu should fail with abnormal stat= us */ - MIG_TEST_FAIL_DEST_QUIT_ERR, /* The QMP command for this migration should fail with an error */ MIG_TEST_QMP_ERROR, } result; diff --git a/tests/qtest/migration/migration-qmp.c b/tests/qtest/migration/= migration-qmp.c index 8279504db1..61cd7db6cc 100644 --- a/tests/qtest/migration/migration-qmp.c +++ b/tests/qtest/migration/migration-qmp.c @@ -173,6 +173,12 @@ void migrate_incoming_qmp(QTestState *to, const char *= uri, QObject *channels, /* This function relies on the event to work, make sure it's enabled */ migrate_set_capability(to, "events", true); =20 + /* + * Set the incoming migration to never exit QEMU abruptly during + * the tests. It causes issues when running sanitizers and + * expecting a failure exit code can mask other issues. + */ + qdict_put_bool(args, "exit-on-error", false); rsp =3D qtest_qmp(to, "{ 'execute': 'migrate-incoming', 'arguments': %= p}", args); =20 diff --git a/tests/qtest/migration/misc-tests.c b/tests/qtest/migration/mis= c-tests.c index 810e9e6549..196f1ca842 100644 --- a/tests/qtest/migration/misc-tests.c +++ b/tests/qtest/migration/misc-tests.c @@ -131,7 +131,7 @@ static void do_test_validate_uuid(MigrateStart *args, b= ool should_fail) g_autofree char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); QTestState *from, *to; =20 - if (migrate_start(&from, &to, uri, args)) { + if (migrate_start(&from, &to, "defer", args)) { return; } =20 @@ -146,10 +146,10 @@ static void do_test_validate_uuid(MigrateStart *args,= bool should_fail) /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); =20 + migrate_incoming_qmp(to, uri, NULL, "{}"); migrate_qmp(from, to, uri, NULL, "{}"); =20 if (should_fail) { - qtest_set_expected_status(to, EXIT_FAILURE); wait_for_migration_fail(from, true); } else { wait_for_migration_complete(from); diff --git a/tests/qtest/migration/precopy-tests.c b/tests/qtest/migration/= precopy-tests.c index f17dc5176d..c6c8ae3004 100644 --- a/tests/qtest/migration/precopy-tests.c +++ b/tests/qtest/migration/precopy-tests.c @@ -545,8 +545,7 @@ static void test_multifd_tcp_cancel(MigrateCommon *args= , bool postcopy_ram) migrate_cancel(from); =20 /* Make sure QEMU process "to" exited */ - qtest_set_expected_status(to, EXIT_FAILURE); - qtest_wait_qemu(to); + migration_event_wait(to, "failed"); qtest_quit(to); =20 /* @@ -634,7 +633,7 @@ static void test_cancel_src_after_cancelled(QTestState = *from, QTestState *to, const char *uri, const char *p= hase, MigrateStart *args) { - migrate_incoming_qmp(to, uri, NULL, "{ 'exit-on-error': false }"); + migrate_incoming_qmp(to, uri, NULL, "{}"); =20 wait_for_serial("src_serial"); migrate_ensure_converge(from); @@ -659,7 +658,7 @@ static void test_cancel_src_after_complete(QTestState *= from, QTestState *to, const char *uri, const char *ph= ase, MigrateStart *args) { - migrate_incoming_qmp(to, uri, NULL, "{ 'exit-on-error': false }"); + migrate_incoming_qmp(to, uri, NULL, "{}"); =20 wait_for_serial("src_serial"); migrate_ensure_converge(from); @@ -690,7 +689,7 @@ static void test_cancel_src_after_none(QTestState *from= , QTestState *to, wait_for_serial("src_serial"); migrate_cancel(from); =20 - migrate_incoming_qmp(to, uri, NULL, "{ 'exit-on-error': false }"); + migrate_incoming_qmp(to, uri, NULL, "{}"); =20 migrate_ensure_converge(from); migrate_qmp(from, to, uri, NULL, "{}"); @@ -709,7 +708,7 @@ static void test_cancel_src_pre_switchover(QTestState *= from, QTestState *to, migrate_set_capability(from, "multifd", true); migrate_set_capability(to, "multifd", true); =20 - migrate_incoming_qmp(to, uri, NULL, "{ 'exit-on-error': false }"); + migrate_incoming_qmp(to, uri, NULL, "{}"); =20 wait_for_serial("src_serial"); migrate_ensure_converge(from); @@ -1101,7 +1100,6 @@ static void test_dirty_limit(char *name, MigrateCommo= n *args) =20 /* destination always fails after cancel */ migration_event_wait(to, "failed"); - qtest_set_expected_status(to, EXIT_FAILURE); qtest_quit(to); =20 /* Check if dirty limit throttle switched off, set timeout 1ms */ diff --git a/tests/qtest/migration/tls-tests.c b/tests/qtest/migration/tls-= tests.c index 4ce7f6c676..87898af260 100644 --- a/tests/qtest/migration/tls-tests.c +++ b/tests/qtest/migration/tls-tests.c @@ -441,10 +441,10 @@ static void test_precopy_unix_tls_x509_default_host(c= har *name, g_autofree char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); =20 args->connect_uri =3D uri; - args->listen_uri =3D uri; + args->listen_uri =3D "defer"; args->start_hook =3D migrate_hook_start_tls_x509_default_host; args->end_hook =3D migrate_hook_end_tls_x509; - args->result =3D MIG_TEST_FAIL_DEST_QUIT_ERR; + args->result =3D MIG_TEST_FAIL; =20 args->start.hide_stderr =3D true; =20 @@ -522,10 +522,11 @@ migrate_hook_start_tls_x509_no_host(QTestState *from,= QTestState *to) =20 static void test_precopy_tcp_tls_no_hostname(char *name, MigrateCommon *ar= gs) { - args->listen_uri =3D "tcp:127.0.0.1:0"; + args->listen_uri =3D "defer"; + args->connect_uri =3D "tcp:127.0.0.1:0"; args->start_hook =3D migrate_hook_start_tls_x509_no_host; args->end_hook =3D migrate_hook_end_tls_x509; - args->result =3D MIG_TEST_FAIL_DEST_QUIT_ERR; + args->result =3D MIG_TEST_FAIL; =20 args->start.hide_stderr =3D true; =20 @@ -556,10 +557,11 @@ static void test_precopy_tcp_tls_x509_override_host(c= har *name, static void test_precopy_tcp_tls_x509_mismatch_host(char *name, MigrateCommon *args) { - args->listen_uri =3D "tcp:127.0.0.1:0"; + args->listen_uri =3D "defer"; + args->connect_uri =3D "tcp:127.0.0.1:0"; args->start_hook =3D migrate_hook_start_tls_x509_mismatch_host; args->end_hook =3D migrate_hook_end_tls_x509; - args->result =3D MIG_TEST_FAIL_DEST_QUIT_ERR; + args->result =3D MIG_TEST_FAIL; =20 args->start.hide_stderr =3D true; =20 --=20 2.51.0