From nobody Sun Nov 16 10:36:09 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599597107; cv=none; d=zohomail.com; s=zohoarc; b=XWLZYH788KsdO8fvt/ueMt3H33j22dOgORB27VlPA4FWNiCquXHoS9nFwI+BlvWUnccrXlnJWXDGqS7AzbqJVJSiQ3NVYFGfjruHnk5T5h739Xr6/if37E6K054OsWIXLaljyW1EaU6zwzOtiYQXNEGFK8FpesSEk4t6k/ivMxE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599597107; 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=Dj8PFivSAcJNd/FlfrotVGRkKpULTf3HJuqDkHyOKcI=; b=CvnpmNYi6bsmrHdWU2sQTtUyOICFdwlcJ5SCW8yGtEfDrzSU/FOwJX2ZRYvb6qfEwBrL1a/N5y4wYGvxgsnw/daBSABNADKSVGnNLkB6s0h3jedBW/GNarJXpmrPTwUnzV8Zo64w+og+U3VGTX+zNAzdBajvV5WQ4drG6tS9Wss= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599597107096540.133575192036; Tue, 8 Sep 2020 13:31:47 -0700 (PDT) Received: from localhost ([::1]:59124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFkHJ-0005rn-O2 for importer@patchew.org; Tue, 08 Sep 2020 16:31:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50210) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFkGA-0004DJ-M3 for qemu-devel@nongnu.org; Tue, 08 Sep 2020 16:30:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:39145) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kFkG7-0007uQ-VK for qemu-devel@nongnu.org; Tue, 08 Sep 2020 16:30:34 -0400 Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-64-htux_8cAMgO8vaMV3kPvkw-1; Tue, 08 Sep 2020 16:30:27 -0400 Received: by mail-qt1-f199.google.com with SMTP id t11so347065qtn.8 for ; Tue, 08 Sep 2020 13:30:27 -0700 (PDT) Received: from xz-x1.redhat.com (bras-vprn-toroon474qw-lp130-11-70-53-122-15.dsl.bell.ca. [70.53.122.15]) by smtp.gmail.com with ESMTPSA id o28sm595397qtl.62.2020.09.08.13.30.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 13:30:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599597029; 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=Dj8PFivSAcJNd/FlfrotVGRkKpULTf3HJuqDkHyOKcI=; b=JZkFXYxU74o/+fNAaQEpTKePd3L625hk8wTCKD0CW74JN2GufuXccizgb2CSKMgnNkKdJ+ JXrY/IkUTWbwA/H/nsn8wEYGmnLFmT9wX43pctVaZ52LiG9VghNayWLnkNP7tVYNglRr6k M+lTpmOX8YdF9VPsqzeXGPlCZzz0MlI= X-MC-Unique: htux_8cAMgO8vaMV3kPvkw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Dj8PFivSAcJNd/FlfrotVGRkKpULTf3HJuqDkHyOKcI=; b=WKG8HH+3M8jCHYeHnyRYXSdV3MaENA7p8YEEAJZQnof21Ix4aDUqY/yfukgimP1Xye YipncfVeFCbfbNNdIMjm8w2xIJzJf26c0/dGEyvk4L8j9Ik5G1gJGqdHLF2iKsQZi+74 Lt3SCgDZmSMt+A4PwhcMMF32v7tgSyb3/1NNEA81HjUYHsnMlnhKwlE5naQ64Gqlw6KC X5DpfSTOvSUuGHzl+sAwSWp99OCBnb1mIhAYtPZy2hkLSyjDmVpMxNuD6CugYNDEe0+v QYL2G2Ef7xZUFsV3FG5MXNu3MvBr5KGMaA9HTTLDssNwiw9CrzVr04GVGiDcUTrGipie QxPw== X-Gm-Message-State: AOAM5318hH/GeuLjJGgjdUIzQe2MzuYGBgAmK/wkTX3otwezuCZ709hm 2KvY+4PiogZiOEvUHHQ0qy6rPU32Psy54kxsbfT7enZajbjOZVBNLlRQkiLKwenna3mz9C3wv+6 ccOoVmhnULayv4i8= X-Received: by 2002:a37:a392:: with SMTP id m140mr331073qke.195.1599597026806; Tue, 08 Sep 2020 13:30:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKZqNGoI2qPVsxlQ52PMAe3LlObIL1VytGC6hZhmsjYNWZh1Ab2xnTyyqn+bHm0i+mZUMu0A== X-Received: by 2002:a37:a392:: with SMTP id m140mr331048qke.195.1599597026507; Tue, 08 Sep 2020 13:30:26 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Subject: [PATCH v2 1/6] migration: Properly destroy variables on incoming side Date: Tue, 8 Sep 2020 16:30:17 -0400 Message-Id: <20200908203022.341615-2-peterx@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200908203022.341615-1-peterx@redhat.com> References: <20200908203022.341615-1-peterx@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/08 12:54:58 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xiaohui Li , "Dr . David Alan Gilbert" , peterx@redhat.com, Juan Quintela Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" In migration_incoming_state_destroy(), we've got a few variables that aren't destroyed properly, namely: main_thread_load_event postcopy_pause_sem_dst postcopy_pause_sem_fault rp_mutex Destroy them properly. Signed-off-by: Peter Xu Reviewed-by: Dr. David Alan Gilbert --- migration/migration.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 58a5452471..749d9b145b 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -238,12 +238,15 @@ void migration_incoming_state_destroy(void) mis->postcopy_remote_fds =3D NULL; } =20 - qemu_event_reset(&mis->main_thread_load_event); - if (mis->socket_address_list) { qapi_free_SocketAddressList(mis->socket_address_list); mis->socket_address_list =3D NULL; } + + qemu_event_destroy(&mis->main_thread_load_event); + qemu_sem_destroy(&mis->postcopy_pause_sem_dst); + qemu_sem_destroy(&mis->postcopy_pause_sem_fault); + qemu_mutex_destroy(&mis->rp_mutex); } =20 static void migrate_generate_event(int new_state) --=20 2.26.2