From nobody Mon Feb 9 14:33:20 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650563089; cv=none; d=zohomail.com; s=zohoarc; b=Mo3lLy41cZAzyAXzU/g2syxVDfdrv39u0vF8IWY9UNsVSQXagLs0obaaPHmlDSp7EsiCOcXxD8Exxn5uC9g1H3XdrC7BCg8fGuU9fBd7X76kGs7btaZ05buJtlVPvnzA0baZ9ImlcMQe+FlqPwLflA1kywKsojdmS9ryJ4UI1+Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650563089; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UsAgmkYn4qnFiwWvE7fgO6WgOldiJGWTCZEXrnCrgMQ=; b=MjklKqMG8l335es+mNbQ5L3lm51pWuB/upMgzPXJxeAjjRAL2ESMB6c7VmVzNQrbVc7cuyPavaLrflcr8APPQyOytC2rG+5H6I30qjDBH620Ex559bjj6w5b0Z4W2baBAB0/Wxdx1OBsEyIQI/04c5wfBrIZ8vtPFoJ09o2aGyY= 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 1650563089319229.1316698829812; Thu, 21 Apr 2022 10:44:49 -0700 (PDT) Received: from localhost ([::1]:34760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nharH-0005o2-R1 for importer@patchew.org; Thu, 21 Apr 2022 13:44:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhZrd-0007g4-71 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 12:41:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:31084) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhZrb-00033m-L1 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 12:41:04 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-244-MttJ44zyOzqPFapkEAoI1Q-1; Thu, 21 Apr 2022 12:41:01 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 79BB7281AF08 for ; Thu, 21 Apr 2022 16:41:01 +0000 (UTC) Received: from dgilbert-t580.localhost (unknown [10.39.195.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id B3BDF40D016E; Thu, 21 Apr 2022 16:41:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650559263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UsAgmkYn4qnFiwWvE7fgO6WgOldiJGWTCZEXrnCrgMQ=; b=EPY4BjHeAavCr4atBRYeO59PXotlN2ye7YoIWiJL8l6Bh1RFJByPRXX+u2yStpcacQMq+0 ka2EtmZ/Hzkz26aMsumBEdBTM3SSHezXq2JNV+U/nODNfds+e2ObEfCIIyi0eNLUjpcFGE mATUCgexr+E5gT6qJeS3+Koi2itmBww= X-MC-Unique: MttJ44zyOzqPFapkEAoI1Q-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, peterx@redhat.com, berrange@redhat.com Subject: [PULL 11/18] migration: Drop multifd tls_hostname cache Date: Thu, 21 Apr 2022 17:40:36 +0100 Message-Id: <20220421164043.209703-12-dgilbert@redhat.com> In-Reply-To: <20220421164043.209703-1-dgilbert@redhat.com> References: <20220421164043.209703-1-dgilbert@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650563090841100001 From: Peter Xu The hostname is cached N times, N equals to the multifd channels. Drop that cache because after previous patch we've got s->hostname being alive for the whole lifecycle of migration procedure. Cc: Juan Quintela Cc: Daniel P. Berrange Signed-off-by: Peter Xu Message-Id: <20220331150857.74406-3-peterx@redhat.com> Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Dr. David Alan Gilbert --- migration/multifd.c | 10 +++------- migration/multifd.h | 2 -- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index 76b57a7177..1be4ab5d17 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -542,8 +542,6 @@ void multifd_save_cleanup(void) qemu_sem_destroy(&p->sem_sync); g_free(p->name); p->name =3D NULL; - g_free(p->tls_hostname); - p->tls_hostname =3D NULL; multifd_pages_clear(p->pages); p->pages =3D NULL; p->packet_len =3D 0; @@ -763,7 +761,7 @@ static void multifd_tls_channel_connect(MultiFDSendPara= ms *p, Error **errp) { MigrationState *s =3D migrate_get_current(); - const char *hostname =3D p->tls_hostname; + const char *hostname =3D s->hostname; QIOChannelTLS *tioc; =20 tioc =3D migration_tls_client_create(s, ioc, hostname, errp); @@ -787,7 +785,8 @@ static bool multifd_channel_connect(MultiFDSendParams *= p, MigrationState *s =3D migrate_get_current(); =20 trace_multifd_set_outgoing_channel( - ioc, object_get_typename(OBJECT(ioc)), p->tls_hostname, error); + ioc, object_get_typename(OBJECT(ioc)), + migrate_get_current()->hostname, error); =20 if (!error) { if (s->parameters.tls_creds && @@ -874,7 +873,6 @@ int multifd_save_setup(Error **errp) int thread_count; uint32_t page_count =3D MULTIFD_PACKET_SIZE / qemu_target_page_size(); uint8_t i; - MigrationState *s; =20 if (!migrate_use_multifd()) { return 0; @@ -884,7 +882,6 @@ int multifd_save_setup(Error **errp) return -1; } =20 - s =3D migrate_get_current(); thread_count =3D migrate_multifd_channels(); multifd_send_state =3D g_malloc0(sizeof(*multifd_send_state)); multifd_send_state->params =3D g_new0(MultiFDSendParams, thread_count); @@ -909,7 +906,6 @@ int multifd_save_setup(Error **errp) p->packet->magic =3D cpu_to_be32(MULTIFD_MAGIC); p->packet->version =3D cpu_to_be32(MULTIFD_VERSION); p->name =3D g_strdup_printf("multifdsend_%d", i); - p->tls_hostname =3D g_strdup(s->hostname); /* We need one extra place for the packet header */ p->iov =3D g_new0(struct iovec, page_count + 1); p->normal =3D g_new0(ram_addr_t, page_count); diff --git a/migration/multifd.h b/migration/multifd.h index 4dda900a0b..3d577b98b7 100644 --- a/migration/multifd.h +++ b/migration/multifd.h @@ -72,8 +72,6 @@ typedef struct { uint8_t id; /* channel thread name */ char *name; - /* tls hostname */ - char *tls_hostname; /* channel thread id */ QemuThread thread; /* communication channel */ --=20 2.35.1